mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: - new driver for eGalaxTouch serial touchscreen - new driver for TS-4800 touchscreen - an update for Goodix touchscreen driver - PS/2 mouse module was reworked to limit number of protocols we try on pass-through ports to speed up their detection time - wacom_w8001 touchscreen driver now reports pen and touch via separate instances of input devices - other driver changes * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (42 commits) Input: elantech - mark protocols v2 and v3 as semi-mt Input: wacom_w8001 - drop use of ABS_MT_TOOL_TYPE Input: gpio-keys - fix check for disabling unsupported keys Input: omap-keypad - remove dead check Input: ti_am335x_tsc - fix HWPEN interrupt handling Input: omap-keypad - set tasklet data earlier Input: rohm_bu21023 - fix handling of retrying firmware update Input: ALPS - report v3 pinnacle trackstick device only if is present Input: ALPS - detect trackstick presence for v7 protocol Input: pcap_ts - use to_delayed_work Input: bma150 - constify bma150_cfg structure Input: i8042 - add Fujitsu Lifebook U745 to the nomux list Input: egalax_ts_serial - fix potential NULL dereference on error Input: uinput - sanity check on ff_effects_max and EV_FF Input: uinput - rework ABS validation Input: uinput - add new UINPUT_DEV_SETUP and UI_ABS_SETUP ioctl Input: goodix - use "inverted_[xy]" flags instead of "rotated_screen" Input: goodix - add axis swapping and axis inversion support Input: goodix - use goodix_i2c_write_u8 instead of i2c_master_send Input: goodix - add power management support ...
This commit is contained in:
commit
1c5ff2ab7b
33 changed files with 1900 additions and 655 deletions
|
|
@ -943,3 +943,46 @@ int acpi_gpio_count(struct device *dev, const char *con_id)
|
|||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
struct acpi_crs_lookup {
|
||||
struct list_head node;
|
||||
struct acpi_device *adev;
|
||||
const char *con_id;
|
||||
};
|
||||
|
||||
static DEFINE_MUTEX(acpi_crs_lookup_lock);
|
||||
static LIST_HEAD(acpi_crs_lookup_list);
|
||||
|
||||
bool acpi_can_fallback_to_crs(struct acpi_device *adev, const char *con_id)
|
||||
{
|
||||
struct acpi_crs_lookup *l, *lookup = NULL;
|
||||
|
||||
/* Never allow fallback if the device has properties */
|
||||
if (adev->data.properties || adev->driver_gpios)
|
||||
return false;
|
||||
|
||||
mutex_lock(&acpi_crs_lookup_lock);
|
||||
|
||||
list_for_each_entry(l, &acpi_crs_lookup_list, node) {
|
||||
if (l->adev == adev) {
|
||||
lookup = l;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!lookup) {
|
||||
lookup = kmalloc(sizeof(*lookup), GFP_KERNEL);
|
||||
if (lookup) {
|
||||
lookup->adev = adev;
|
||||
lookup->con_id = con_id;
|
||||
list_add_tail(&lookup->node, &acpi_crs_lookup_list);
|
||||
}
|
||||
}
|
||||
|
||||
mutex_unlock(&acpi_crs_lookup_lock);
|
||||
|
||||
return lookup &&
|
||||
((!lookup->con_id && !con_id) ||
|
||||
(lookup->con_id && con_id &&
|
||||
strcmp(lookup->con_id, con_id) == 0));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1874,6 +1874,9 @@ static struct gpio_desc *acpi_find_gpio(struct device *dev, const char *con_id,
|
|||
|
||||
/* Then from plain _CRS GPIOs */
|
||||
if (IS_ERR(desc)) {
|
||||
if (!acpi_can_fallback_to_crs(adev, con_id))
|
||||
return ERR_PTR(-ENOENT);
|
||||
|
||||
desc = acpi_get_gpiod_by_index(adev, NULL, idx, &info);
|
||||
if (IS_ERR(desc))
|
||||
return desc;
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ struct gpio_desc *acpi_node_get_gpiod(struct fwnode_handle *fwnode,
|
|||
struct acpi_gpio_info *info);
|
||||
|
||||
int acpi_gpio_count(struct device *dev, const char *con_id);
|
||||
|
||||
bool acpi_can_fallback_to_crs(struct acpi_device *adev, const char *con_id);
|
||||
#else
|
||||
static inline void acpi_gpiochip_add(struct gpio_chip *chip) { }
|
||||
static inline void acpi_gpiochip_remove(struct gpio_chip *chip) { }
|
||||
|
|
@ -74,6 +76,12 @@ static inline int acpi_gpio_count(struct device *dev, const char *con_id)
|
|||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline bool acpi_can_fallback_to_crs(struct acpi_device *adev,
|
||||
const char *con_id)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np,
|
||||
|
|
|
|||
Loading…
Reference in a new issue