diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-05-03 22:38:20 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-05-03 22:38:20 +0300 |
commit | 16a12fa9aed176444fc795b09e796be41902bb08 (patch) | |
tree | bd158def3263a8b0d0f0886fd0fcd32728242dc4 /drivers/input/rmi4/rmi_i2c.c | |
parent | d25e436c4b68db2895185b24ad1f22499c2f87b0 (diff) | |
parent | 0337966d121ebebf73a1c346123e8112796e684e (diff) | |
download | linux-16a12fa9aed176444fc795b09e796be41902bb08.tar.xz |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input subsystem updates from Dmitry Torokhov:
- a big update from Mauro converting input documentation to ReST format
- Synaptics PS/2 is now aware of SMBus companion devices, which means
that we can now use native RMI4 protocol to handle touchpads, instead
of relying on legacy PS/2 mode.
- we removed support from BMA180 accelerometer from input devices as it
is now handled properly by IIO
- update to TSC2007 to corretcly report pressure
- other miscellaneous driver fixes.
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (152 commits)
Input: ar1021_i2c - use BIT to check for a bit
Input: twl4030-pwrbutton - use input_set_capability() helper
Input: twl4030-pwrbutton - use correct device for irq request
Input: ar1021_i2c - enable touch mode during open
Input: add uinput documentation
dt-bindings: input: add bindings document for ar1021_i2c driver
dt-bindings: input: rotary-encoder: fix typo
Input: xen-kbdfront - add module parameter for setting resolution
ARM: pxa/raumfeld: fix compile error in rotary controller resources
Input: xpad - do not suggest writing to Dominic
Input: xpad - don't use literal blocks inside footnotes
Input: xpad - note that usb/devices is now at /sys/kernel/debug/
Input: docs - freshen up introduction
Input: docs - split input docs into kernel- and user-facing
Input: docs - note that MT-A protocol is obsolete
Input: docs - update joystick documentation a bit
Input: docs - remove disclaimer/GPL notice
Input: fix "Game console" heading level in joystick documentation
Input: rotary-encoder - remove references to platform data from docs
Input: move documentation for Amiga CD32
...
Diffstat (limited to 'drivers/input/rmi4/rmi_i2c.c')
-rw-r--r-- | drivers/input/rmi4/rmi_i2c.c | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/drivers/input/rmi4/rmi_i2c.c b/drivers/input/rmi4/rmi_i2c.c index 082306d7c207..e28663ef9e5a 100644 --- a/drivers/input/rmi4/rmi_i2c.c +++ b/drivers/input/rmi4/rmi_i2c.c @@ -204,7 +204,7 @@ static int rmi_i2c_probe(struct i2c_client *client, struct rmi_device_platform_data *client_pdata = dev_get_platdata(&client->dev); struct rmi_i2c_xport *rmi_i2c; - int retval; + int error; rmi_i2c = devm_kzalloc(&client->dev, sizeof(struct rmi_i2c_xport), GFP_KERNEL); @@ -220,30 +220,31 @@ static int rmi_i2c_probe(struct i2c_client *client, rmi_dbg(RMI_DEBUG_XPORT, &client->dev, "Probing %s.\n", dev_name(&client->dev)); + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { dev_err(&client->dev, - "adapter does not support required functionality.\n"); + "adapter does not support required functionality\n"); return -ENODEV; } rmi_i2c->supplies[0].supply = "vdd"; rmi_i2c->supplies[1].supply = "vio"; - retval = devm_regulator_bulk_get(&client->dev, + error = devm_regulator_bulk_get(&client->dev, ARRAY_SIZE(rmi_i2c->supplies), rmi_i2c->supplies); - if (retval < 0) - return retval; + if (error < 0) + return error; - retval = regulator_bulk_enable(ARRAY_SIZE(rmi_i2c->supplies), + error = regulator_bulk_enable(ARRAY_SIZE(rmi_i2c->supplies), rmi_i2c->supplies); - if (retval < 0) - return retval; + if (error < 0) + return error; - retval = devm_add_action_or_reset(&client->dev, + error = devm_add_action_or_reset(&client->dev, rmi_i2c_regulator_bulk_disable, rmi_i2c); - if (retval) - return retval; + if (error) + return error; of_property_read_u32(client->dev.of_node, "syna,startup-delay-ms", &rmi_i2c->startup_delay); @@ -263,26 +264,26 @@ static int rmi_i2c_probe(struct i2c_client *client, * Setting the page to zero will (a) make sure the PSR is in a * known state, and (b) make sure we can talk to the device. */ - retval = rmi_set_page(rmi_i2c, 0); - if (retval) { - dev_err(&client->dev, "Failed to set page select to 0.\n"); - return retval; + error = rmi_set_page(rmi_i2c, 0); + if (error) { + dev_err(&client->dev, "Failed to set page select to 0\n"); + return error; } - retval = rmi_register_transport_device(&rmi_i2c->xport); - if (retval) { - dev_err(&client->dev, "Failed to register transport driver at 0x%.2X.\n", - client->addr); - return retval; + dev_info(&client->dev, "registering I2C-connected sensor\n"); + + error = rmi_register_transport_device(&rmi_i2c->xport); + if (error) { + dev_err(&client->dev, "failed to register sensor: %d\n", error); + return error; } - retval = devm_add_action_or_reset(&client->dev, + + error = devm_add_action_or_reset(&client->dev, rmi_i2c_unregister_transport, rmi_i2c); - if (retval) - return retval; + if (error) + return error; - dev_info(&client->dev, "registered rmi i2c driver at %#04x.\n", - client->addr); return 0; } |