Files
kernel_google_b4s4/include/linux/extcon/extcon-gpio.h
Subhash Jadavani e5371bdd86 extcon: gpio: add support to parse platform data from device tree
extcon-gpio driver currently doesn't support passing the platfroom data via
device tree, we are adding this support so extcon-gpio driver can be used
with platforms using the DT from platform data. We are also fixing the
issue where we were passing the supported_cable incorrect way to
extcon_dev_allocate() API.

Change-Id: I035c2f6c43d6c5140bc9a3088da7c1b3f2f108f1
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2017-05-15 12:08:11 -07:00

53 lines
1.7 KiB
C

/*
* Single-state GPIO extcon driver based on extcon class
*
* Copyright (C) 2012 Samsung Electronics
* Author: MyungJoo Ham <myungjoo.ham@samsung.com>
*
* based on switch class driver
* Copyright (C) 2008 Google, Inc.
* Author: Mike Lockwood <lockwood@android.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __EXTCON_GPIO_H__
#define __EXTCON_GPIO_H__ __FILE__
#include <linux/extcon.h>
/**
* struct gpio_extcon_pdata - A simple GPIO-controlled extcon device.
* @extcon_id: The unique id of specific external connector.
* @gpio: Corresponding GPIO.
* @gpio_active_low: Boolean describing whether gpio active state is 1 or 0
* If true, low state of gpio means active.
* If false, high state of gpio means active.
* @debounce: Debounce time for GPIO IRQ in ms.
* @irq_flags: IRQ Flags (e.g., IRQF_TRIGGER_LOW).
* @check_on_resume: Boolean describing whether to check the state of gpio
* while resuming from sleep.
* @pctrl: GPIO pinctrl handle
* @pctrl_default: GPIO pinctrl default state handle
*/
struct gpio_extcon_pdata {
unsigned int extcon_id;
unsigned gpio;
bool gpio_active_low;
unsigned long debounce;
unsigned long irq_flags;
bool check_on_resume;
struct pinctrl *pctrl;
struct pinctrl_state *pins_default;
};
#endif /* __EXTCON_GPIO_H__ */