.. | .. |
---|
109 | 109 | }; |
---|
110 | 110 | |
---|
111 | 111 | /* |
---|
| 112 | + * Some devices have a wrong entry which points to a GPIO which is |
---|
| 113 | + * required in another driver, so this driver must not claim it. |
---|
| 114 | + */ |
---|
| 115 | +static const struct dmi_system_id dmi_invalid_acpi_index[] = { |
---|
| 116 | + { |
---|
| 117 | + /* |
---|
| 118 | + * Lenovo Yoga Book X90F / X90L, the PNP0C40 home button entry |
---|
| 119 | + * points to a GPIO which is not a home button and which is |
---|
| 120 | + * required by the lenovo-yogabook driver. |
---|
| 121 | + */ |
---|
| 122 | + .matches = { |
---|
| 123 | + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"), |
---|
| 124 | + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"), |
---|
| 125 | + DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "YETI-11"), |
---|
| 126 | + }, |
---|
| 127 | + .driver_data = (void *)1l, |
---|
| 128 | + }, |
---|
| 129 | + {} /* Terminating entry */ |
---|
| 130 | +}; |
---|
| 131 | + |
---|
| 132 | +/* |
---|
112 | 133 | * Get the Nth GPIO number from the ACPI object. |
---|
113 | 134 | */ |
---|
114 | 135 | static int soc_button_lookup_gpio(struct device *dev, int acpi_index, |
---|
.. | .. |
---|
137 | 158 | struct platform_device *pd; |
---|
138 | 159 | struct gpio_keys_button *gpio_keys; |
---|
139 | 160 | struct gpio_keys_platform_data *gpio_keys_pdata; |
---|
| 161 | + const struct dmi_system_id *dmi_id; |
---|
| 162 | + int invalid_acpi_index = -1; |
---|
140 | 163 | int error, gpio, irq; |
---|
141 | 164 | int n_buttons = 0; |
---|
142 | 165 | |
---|
.. | .. |
---|
154 | 177 | gpio_keys = (void *)(gpio_keys_pdata + 1); |
---|
155 | 178 | n_buttons = 0; |
---|
156 | 179 | |
---|
| 180 | + dmi_id = dmi_first_match(dmi_invalid_acpi_index); |
---|
| 181 | + if (dmi_id) |
---|
| 182 | + invalid_acpi_index = (long)dmi_id->driver_data; |
---|
| 183 | + |
---|
157 | 184 | for (info = button_info; info->name; info++) { |
---|
158 | 185 | if (info->autorepeat != autorepeat) |
---|
159 | 186 | continue; |
---|
160 | 187 | |
---|
| 188 | + if (info->acpi_index == invalid_acpi_index) |
---|
| 189 | + continue; |
---|
| 190 | + |
---|
161 | 191 | error = soc_button_lookup_gpio(&pdev->dev, info->acpi_index, &gpio, &irq); |
---|
162 | 192 | if (error || irq < 0) { |
---|
163 | 193 | /* |
---|