Skip to content

Commit dcde98d

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: - a fixup for Goodix touchscreen driver allowing it to work on certain Cherry Trail devices - a fix for imbalanced enable/disable regulator in Elam touchpad driver that became apparent when used with Asus TF103C 2-in-1 dock - a couple new input keycodes used on newer keyboards * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: HID: add mapping for KEY_ALL_APPLICATIONS HID: add mapping for KEY_DICTATE Input: elan_i2c - fix regulator enable count imbalance after suspend/resume Input: elan_i2c - move regulator_[en|dis]able() out of elan_[en|dis]able_power() Input: goodix - workaround Cherry Trail devices with a bogus ACPI Interrupt() resource Input: goodix - use the new soc_intel_is_byt() helper Input: samsung-keypad - properly state IOMEM dependency
2 parents 0014404 + 327b89f commit dcde98d

File tree

6 files changed

+51
-61
lines changed

6 files changed

+51
-61
lines changed

drivers/hid/hid-debug.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,9 @@ static const char *keys[KEY_MAX + 1] = {
860860
[KEY_F22] = "F22", [KEY_F23] = "F23",
861861
[KEY_F24] = "F24", [KEY_PLAYCD] = "PlayCD",
862862
[KEY_PAUSECD] = "PauseCD", [KEY_PROG3] = "Prog3",
863-
[KEY_PROG4] = "Prog4", [KEY_SUSPEND] = "Suspend",
863+
[KEY_PROG4] = "Prog4",
864+
[KEY_ALL_APPLICATIONS] = "AllApplications",
865+
[KEY_SUSPEND] = "Suspend",
864866
[KEY_CLOSE] = "Close", [KEY_PLAY] = "Play",
865867
[KEY_FASTFORWARD] = "FastForward", [KEY_BASSBOOST] = "BassBoost",
866868
[KEY_PRINT] = "Print", [KEY_HP] = "HP",
@@ -969,6 +971,7 @@ static const char *keys[KEY_MAX + 1] = {
969971
[KEY_ASSISTANT] = "Assistant",
970972
[KEY_KBD_LAYOUT_NEXT] = "KbdLayoutNext",
971973
[KEY_EMOJI_PICKER] = "EmojiPicker",
974+
[KEY_DICTATE] = "Dictate",
972975
[KEY_BRIGHTNESS_MIN] = "BrightnessMin",
973976
[KEY_BRIGHTNESS_MAX] = "BrightnessMax",
974977
[KEY_BRIGHTNESS_AUTO] = "BrightnessAuto",

drivers/hid/hid-input.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
992992
case 0x0cd: map_key_clear(KEY_PLAYPAUSE); break;
993993
case 0x0cf: map_key_clear(KEY_VOICECOMMAND); break;
994994

995+
case 0x0d8: map_key_clear(KEY_DICTATE); break;
995996
case 0x0d9: map_key_clear(KEY_EMOJI_PICKER); break;
996997

997998
case 0x0e0: map_abs_clear(ABS_VOLUME); break;
@@ -1083,6 +1084,8 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
10831084

10841085
case 0x29d: map_key_clear(KEY_KBD_LAYOUT_NEXT); break;
10851086

1087+
case 0x2a2: map_key_clear(KEY_ALL_APPLICATIONS); break;
1088+
10861089
case 0x2c7: map_key_clear(KEY_KBDINPUTASSIST_PREV); break;
10871090
case 0x2c8: map_key_clear(KEY_KBDINPUTASSIST_NEXT); break;
10881091
case 0x2c9: map_key_clear(KEY_KBDINPUTASSIST_PREVGROUP); break;

drivers/input/keyboard/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ config KEYBOARD_PMIC8XXX
556556

557557
config KEYBOARD_SAMSUNG
558558
tristate "Samsung keypad support"
559-
depends on HAVE_CLK
559+
depends on HAS_IOMEM && HAVE_CLK
560560
select INPUT_MATRIXKMAP
561561
help
562562
Say Y here if you want to use the keypad on your Samsung mobile

drivers/input/mouse/elan_i2c_core.c

Lines changed: 23 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -186,55 +186,21 @@ static int elan_get_fwinfo(u16 ic_type, u8 iap_version, u16 *validpage_count,
186186
return 0;
187187
}
188188

189-
static int elan_enable_power(struct elan_tp_data *data)
189+
static int elan_set_power(struct elan_tp_data *data, bool on)
190190
{
191191
int repeat = ETP_RETRY_COUNT;
192192
int error;
193193

194-
error = regulator_enable(data->vcc);
195-
if (error) {
196-
dev_err(&data->client->dev,
197-
"failed to enable regulator: %d\n", error);
198-
return error;
199-
}
200-
201194
do {
202-
error = data->ops->power_control(data->client, true);
195+
error = data->ops->power_control(data->client, on);
203196
if (error >= 0)
204197
return 0;
205198

206199
msleep(30);
207200
} while (--repeat > 0);
208201

209-
dev_err(&data->client->dev, "failed to enable power: %d\n", error);
210-
return error;
211-
}
212-
213-
static int elan_disable_power(struct elan_tp_data *data)
214-
{
215-
int repeat = ETP_RETRY_COUNT;
216-
int error;
217-
218-
do {
219-
error = data->ops->power_control(data->client, false);
220-
if (!error) {
221-
error = regulator_disable(data->vcc);
222-
if (error) {
223-
dev_err(&data->client->dev,
224-
"failed to disable regulator: %d\n",
225-
error);
226-
/* Attempt to power the chip back up */
227-
data->ops->power_control(data->client, true);
228-
break;
229-
}
230-
231-
return 0;
232-
}
233-
234-
msleep(30);
235-
} while (--repeat > 0);
236-
237-
dev_err(&data->client->dev, "failed to disable power: %d\n", error);
202+
dev_err(&data->client->dev, "failed to set power %s: %d\n",
203+
on ? "on" : "off", error);
238204
return error;
239205
}
240206

@@ -1399,9 +1365,19 @@ static int __maybe_unused elan_suspend(struct device *dev)
13991365
/* Enable wake from IRQ */
14001366
data->irq_wake = (enable_irq_wake(client->irq) == 0);
14011367
} else {
1402-
ret = elan_disable_power(data);
1368+
ret = elan_set_power(data, false);
1369+
if (ret)
1370+
goto err;
1371+
1372+
ret = regulator_disable(data->vcc);
1373+
if (ret) {
1374+
dev_err(dev, "error %d disabling regulator\n", ret);
1375+
/* Attempt to power the chip back up */
1376+
elan_set_power(data, true);
1377+
}
14031378
}
14041379

1380+
err:
14051381
mutex_unlock(&data->sysfs_mutex);
14061382
return ret;
14071383
}
@@ -1412,12 +1388,18 @@ static int __maybe_unused elan_resume(struct device *dev)
14121388
struct elan_tp_data *data = i2c_get_clientdata(client);
14131389
int error;
14141390

1415-
if (device_may_wakeup(dev) && data->irq_wake) {
1391+
if (!device_may_wakeup(dev)) {
1392+
error = regulator_enable(data->vcc);
1393+
if (error) {
1394+
dev_err(dev, "error %d enabling regulator\n", error);
1395+
goto err;
1396+
}
1397+
} else if (data->irq_wake) {
14161398
disable_irq_wake(client->irq);
14171399
data->irq_wake = false;
14181400
}
14191401

1420-
error = elan_enable_power(data);
1402+
error = elan_set_power(data, true);
14211403
if (error) {
14221404
dev_err(dev, "power up when resuming failed: %d\n", error);
14231405
goto err;

drivers/input/touchscreen/goodix.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/delay.h>
1919
#include <linux/irq.h>
2020
#include <linux/interrupt.h>
21+
#include <linux/platform_data/x86/soc.h>
2122
#include <linux/slab.h>
2223
#include <linux/acpi.h>
2324
#include <linux/of.h>
@@ -805,21 +806,6 @@ static int goodix_reset(struct goodix_ts_data *ts)
805806
}
806807

807808
#ifdef ACPI_GPIO_SUPPORT
808-
#include <asm/cpu_device_id.h>
809-
#include <asm/intel-family.h>
810-
811-
static const struct x86_cpu_id baytrail_cpu_ids[] = {
812-
{ X86_VENDOR_INTEL, 6, INTEL_FAM6_ATOM_SILVERMONT, X86_FEATURE_ANY, },
813-
{}
814-
};
815-
816-
static inline bool is_byt(void)
817-
{
818-
const struct x86_cpu_id *id = x86_match_cpu(baytrail_cpu_ids);
819-
820-
return !!id;
821-
}
822-
823809
static const struct acpi_gpio_params first_gpio = { 0, 0, false };
824810
static const struct acpi_gpio_params second_gpio = { 1, 0, false };
825811

@@ -878,7 +864,7 @@ static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts)
878864
const struct acpi_gpio_mapping *gpio_mapping = NULL;
879865
struct device *dev = &ts->client->dev;
880866
LIST_HEAD(resources);
881-
int ret;
867+
int irq, ret;
882868

883869
ts->gpio_count = 0;
884870
ts->gpio_int_idx = -1;
@@ -891,6 +877,20 @@ static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts)
891877

892878
acpi_dev_free_resource_list(&resources);
893879

880+
/*
881+
* CHT devices should have a GpioInt + a regular GPIO ACPI resource.
882+
* Some CHT devices have a bug (where the also is bogus Interrupt
883+
* resource copied from a previous BYT based generation). i2c-core-acpi
884+
* will use the non-working Interrupt resource, fix this up.
885+
*/
886+
if (soc_intel_is_cht() && ts->gpio_count == 2 && ts->gpio_int_idx != -1) {
887+
irq = acpi_dev_gpio_irq_get(ACPI_COMPANION(dev), 0);
888+
if (irq > 0 && irq != ts->client->irq) {
889+
dev_warn(dev, "Overriding IRQ %d -> %d\n", ts->client->irq, irq);
890+
ts->client->irq = irq;
891+
}
892+
}
893+
894894
if (ts->gpio_count == 2 && ts->gpio_int_idx == 0) {
895895
ts->irq_pin_access_method = IRQ_PIN_ACCESS_ACPI_GPIO;
896896
gpio_mapping = acpi_goodix_int_first_gpios;
@@ -903,7 +903,7 @@ static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts)
903903
dev_info(dev, "Using ACPI INTI and INTO methods for IRQ pin access\n");
904904
ts->irq_pin_access_method = IRQ_PIN_ACCESS_ACPI_METHOD;
905905
gpio_mapping = acpi_goodix_reset_only_gpios;
906-
} else if (is_byt() && ts->gpio_count == 2 && ts->gpio_int_idx == -1) {
906+
} else if (soc_intel_is_byt() && ts->gpio_count == 2 && ts->gpio_int_idx == -1) {
907907
dev_info(dev, "No ACPI GpioInt resource, assuming that the GPIO order is reset, int\n");
908908
ts->irq_pin_access_method = IRQ_PIN_ACCESS_ACPI_GPIO;
909909
gpio_mapping = acpi_goodix_int_last_gpios;

include/uapi/linux/input-event-codes.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@
278278
#define KEY_PAUSECD 201
279279
#define KEY_PROG3 202
280280
#define KEY_PROG4 203
281-
#define KEY_DASHBOARD 204 /* AL Dashboard */
281+
#define KEY_ALL_APPLICATIONS 204 /* AC Desktop Show All Applications */
282+
#define KEY_DASHBOARD KEY_ALL_APPLICATIONS
282283
#define KEY_SUSPEND 205
283284
#define KEY_CLOSE 206 /* AC Close */
284285
#define KEY_PLAY 207
@@ -612,6 +613,7 @@
612613
#define KEY_ASSISTANT 0x247 /* AL Context-aware desktop assistant */
613614
#define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */
614615
#define KEY_EMOJI_PICKER 0x249 /* Show/hide emoji picker (HUTRR101) */
616+
#define KEY_DICTATE 0x24a /* Start or Stop Voice Dictation Session (HUTRR99) */
615617

616618
#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */
617619
#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */

0 commit comments

Comments
 (0)