* Re: [PATCH] Input: use dev_get_platdata()
From: Dmitry Torokhov @ 2013-12-06 3:23 UTC (permalink / raw)
To: Jingoo Han
Cc: linux-input, 'Fugang Duan', 'Michael Hennerich',
'Wan ZongShun', 'Josh Wu', 'Ferruh Yigit'
In-Reply-To: <000e01ceeff2$8b6f62e0$a24e28a0$%han@samsung.com>
On Tue, Dec 03, 2013 at 03:40:23PM +0900, Jingoo Han wrote:
> Use the wrapper function for retrieving the platform data instead
> of accessing dev->platform_data directly. This is a cosmetic change
> to make the code simpler and enhance the readability.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> Acked-by: Fugang Duan <B38611@freescale.com>
Applied, thank you.
--
Dmitry
^ permalink raw reply
* Re: [PATCH 02/15] input: sh_keysc: Restrict non-COMPILE_TEST compilation
From: Dmitry Torokhov @ 2013-12-06 3:20 UTC (permalink / raw)
To: Simon Horman; +Cc: Laurent Pinchart, linux-sh, linux-arm-kernel, linux-input
In-Reply-To: <20131128073636.GD24146@verge.net.au>
On Thu, Nov 28, 2013 at 04:36:36PM +0900, Simon Horman wrote:
> On Wed, Nov 27, 2013 at 02:18:24AM +0100, Laurent Pinchart wrote:
> > Hardware supported by the driver is only found on SUPERH or
> > ARCH_SHMOBILE platforms. Restrict non-COMPILE_TEST compilation to them.
> >
> > Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > Cc: linux-input@vger.kernel.org
> > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
>
> Acked-by: Simon Horman <horms+renesas@verge.net.au>
Applied, thank you.
>
> > ---
> > drivers/input/keyboard/Kconfig | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
> > index bb174c1..a673c9f 100644
> > --- a/drivers/input/keyboard/Kconfig
> > +++ b/drivers/input/keyboard/Kconfig
> > @@ -525,7 +525,7 @@ config KEYBOARD_SUNKBD
> >
> > config KEYBOARD_SH_KEYSC
> > tristate "SuperH KEYSC keypad support"
> > - depends on SUPERH || ARM || COMPILE_TEST
> > + depends on SUPERH || ARCH_SHMOBILE || COMPILE_TEST
> > help
> > Say Y here if you want to use a keypad attached to the KEYSC block
> > on SuperH processors such as sh7722 and sh7343.
> > --
> > 1.8.3.2
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
--
Dmitry
^ permalink raw reply
* [PATCH] input synaptics-rmi4: elliminate multiple sensor support from rmi_f11.c
From: Andrew Duggan @ 2013-12-06 1:59 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Linux Input, Christopher Heiny, Andrew Duggan, Vincent Huang,
Vivian Ly, Daniel Rosenberg, Jean Delvare, Joerie de Gram,
Linus Walleij, Benjamin Tissoires
This patch implements changes to the synaptics-rmi4 branch of
Dmitry's input tree. The base for the patch is commit
8ca01dc61a42b6f7bcba052a8c084000f7057a34.
This patch elliminates support for multiple sensors in rmi_f11. This feature
has been removed from the RMI4 spec and no devices have every used multiple
F11 sensors on a single device.
Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
---
drivers/input/rmi4/rmi_f11.c | 374 +++++++++++++++++++------------------------
include/linux/rmi.h | 10 +-
2 files changed, 170 insertions(+), 214 deletions(-)
diff --git a/drivers/input/rmi4/rmi_f11.c b/drivers/input/rmi4/rmi_f11.c
index 8984054..d3a9ba8 100644
--- a/drivers/input/rmi4/rmi_f11.c
+++ b/drivers/input/rmi4/rmi_f11.c
@@ -19,7 +19,6 @@
#include <linux/slab.h>
#include "rmi_driver.h"
-#define F11_MAX_NUM_OF_SENSORS 8
#define F11_MAX_NUM_OF_FINGERS 10
#define F11_MAX_NUM_OF_TOUCH_SHAPES 16
@@ -42,40 +41,23 @@
/** A note about RMI4 F11 register structure.
*
- * There may be one or more individual 2D touch surfaces associated with an
- * instance for F11. For example, a handheld device might have a touchscreen
- * display on the front, and a touchpad on the back. F11 represents these touch
- * surfaces as individual sensors, up to 7 on a given RMI4 device.
- *
* The properties for
* a given sensor are described by its query registers. The number of query
* registers and the layout of their contents are described by the F11 device
- * queries as well as the per-sensor query information. The query registers
- * for sensor[n+1] immediately follow those for sensor[n], so the start address
- * of the sensor[n+1] queries can only be computed if you know the size of the
- * sensor[n] queries. Because each of the sensors may have different
- * properties, the size of the query registers for each sensor must be
- * calculated on a sensor by sensor basis.
+ * queries as well as the sensor query information.
*
* Similarly, each sensor has control registers that govern its behavior. The
* size and layout of the control registers for a given sensor can be determined
- * by parsing that sensors query registers. The control registers for
- * sensor[n+1] immediately follow those for sensor[n], so you can only know
- * the start address for the sensor[n+1] controls if you know the size (and
- * location) of the sensor[n] controls.
+ * by parsing that sensors query registers.
*
* And in a likewise fashion, each sensor has data registers where it reports
* its touch data and other interesting stuff. The size and layout of a
* sensors data registers must be determined by parsing its query registers.
- * The data registers for sensor[n+1] immediately follow those for sensor[n],
- * so you can only know the start address for the sensor[n+1] controls if you
- * know the size (and location) of the sensor[n] controls.
*
* The short story is that we need to read and parse a lot of query
- * registers in order to determine the attributes of a sensor[0]. Then
+ * registers in order to determine the attributes of a sensor. Then
* we need to use that data to compute the size of the control and data
- * registers for sensor[0]. Once we have that figured out, we can then do
- * the same thing for each subsequent sensor.
+ * registers for sensor.
*
* The end result is that we have a number of structs that aren't used to
* directly generate the input events, but their size, location and contents
@@ -811,7 +793,7 @@ struct f11_data {
struct f11_2d_ctrl dev_controls;
struct mutex dev_controls_mutex;
u16 rezero_wait_ms;
- struct f11_2d_sensor sensors[F11_MAX_NUM_OF_SENSORS];
+ struct f11_2d_sensor sensor;
};
enum finger_state_values {
@@ -1519,10 +1501,10 @@ static int rmi_f11_get_query_parameters(struct rmi_device *rmi_dev,
/* This operation is done in a number of places, so we have a handy routine
* for it.
*/
-static void f11_set_abs_params(struct rmi_function *fn, int index)
+static void f11_set_abs_params(struct rmi_function *fn)
{
struct f11_data *f11 = fn->data;
- struct f11_2d_sensor *sensor = &f11->sensors[index];
+ struct f11_2d_sensor *sensor = &f11->sensor;
struct input_dev *input = sensor->input;
u16 device_x_max =
f11->dev_controls.ctrl0_9->sensor_max_x_pos;
@@ -1604,8 +1586,8 @@ static int rmi_f11_initialize(struct rmi_function *fn)
u16 control_base_addr;
u16 max_x_pos, max_y_pos, temp;
int rc;
- int i;
struct rmi_device_platform_data *pdata = to_rmi_platform_data(rmi_dev);
+ struct f11_2d_sensor *sensor;
dev_dbg(&fn->dev, "Initializing F11 values for %s.\n",
pdata->sensor_name);
@@ -1628,92 +1610,88 @@ static int rmi_f11_initialize(struct rmi_function *fn)
return rc;
query_offset = (query_base_addr + 1);
- /* Increase with one since number of sensors is zero based */
- for (i = 0; i < (f11->dev_query.nbr_of_sensors + 1); i++) {
- struct f11_2d_sensor *sensor = &f11->sensors[i];
- sensor->sensor_index = i;
- sensor->fn = fn;
-
- rc = rmi_f11_get_query_parameters(rmi_dev, &f11->dev_query,
- &sensor->sens_query, query_offset);
- if (rc < 0)
- return rc;
- query_offset += rc;
+ sensor = &f11->sensor;
+ sensor->fn = fn;
- rc = f11_allocate_control_regs(fn,
- &f11->dev_query, &sensor->sens_query,
- &f11->dev_controls, control_base_addr);
- if (rc < 0) {
- dev_err(&fn->dev,
- "Failed to allocate F11 control params.\n");
- return rc;
- }
+ rc = rmi_f11_get_query_parameters(rmi_dev, &f11->dev_query,
+ &sensor->sens_query, query_offset);
+ if (rc < 0)
+ return rc;
+ query_offset += rc;
- rc = f11_read_control_regs(fn, &f11->dev_controls,
- control_base_addr);
- if (rc < 0) {
- dev_err(&fn->dev,
- "Failed to read F11 control params.\n");
- return rc;
- }
+ rc = f11_allocate_control_regs(fn,
+ &f11->dev_query, &sensor->sens_query,
+ &f11->dev_controls, control_base_addr);
+ if (rc < 0) {
+ dev_err(&fn->dev,
+ "Failed to allocate F11 control params.\n");
+ return rc;
+ }
- if (i < pdata->f11_sensor_count) {
- sensor->axis_align =
- pdata->f11_sensor_data[i].axis_align;
- sensor->type_a = pdata->f11_sensor_data[i].type_a;
- sensor->sensor_type =
- pdata->f11_sensor_data[i].sensor_type;
- }
+ rc = f11_read_control_regs(fn, &f11->dev_controls,
+ control_base_addr);
+ if (rc < 0) {
+ dev_err(&fn->dev,
+ "Failed to read F11 control params.\n");
+ return rc;
+ }
- rc = rmi_read_block(rmi_dev,
- control_base_addr + F11_CTRL_SENSOR_MAX_X_POS_OFFSET,
- (u8 *)&max_x_pos, sizeof(max_x_pos));
- if (rc < 0)
- return rc;
+ if (pdata->f11_sensor_data) {
+ sensor->axis_align =
+ pdata->f11_sensor_data->axis_align;
+ sensor->type_a = pdata->f11_sensor_data->type_a;
+ sensor->sensor_type =
+ pdata->f11_sensor_data->sensor_type;
+ }
- rc = rmi_read_block(rmi_dev,
- control_base_addr + F11_CTRL_SENSOR_MAX_Y_POS_OFFSET,
- (u8 *)&max_y_pos, sizeof(max_y_pos));
- if (rc < 0)
- return rc;
+ rc = rmi_read_block(rmi_dev,
+ control_base_addr + F11_CTRL_SENSOR_MAX_X_POS_OFFSET,
+ (u8 *)&max_x_pos, sizeof(max_x_pos));
+ if (rc < 0)
+ return rc;
- if (sensor->axis_align.swap_axes) {
- temp = max_x_pos;
- max_x_pos = max_y_pos;
- max_y_pos = temp;
- }
- sensor->max_x = max_x_pos;
- sensor->max_y = max_y_pos;
+ rc = rmi_read_block(rmi_dev,
+ control_base_addr + F11_CTRL_SENSOR_MAX_Y_POS_OFFSET,
+ (u8 *)&max_y_pos, sizeof(max_y_pos));
+ if (rc < 0)
+ return rc;
- rc = f11_2d_construct_data(sensor);
- if (rc < 0)
- return rc;
+ if (sensor->axis_align.swap_axes) {
+ temp = max_x_pos;
+ max_x_pos = max_y_pos;
+ max_y_pos = temp;
+ }
+ sensor->max_x = max_x_pos;
+ sensor->max_y = max_y_pos;
- ctrl = &f11->dev_controls;
- if (sensor->axis_align.delta_x_threshold) {
- ctrl->ctrl0_9->delta_x_threshold =
- sensor->axis_align.delta_x_threshold;
- rc = rmi_write_block(rmi_dev,
- ctrl->ctrl0_9_address,
- ctrl->ctrl0_9,
- sizeof(*ctrl->ctrl0_9));
- if (rc < 0)
- dev_warn(&fn->dev, "Failed to write to delta_x_threshold %d. Code: %d.\n",
- i, rc);
+ rc = f11_2d_construct_data(sensor);
+ if (rc < 0)
+ return rc;
- }
+ ctrl = &f11->dev_controls;
+ if (sensor->axis_align.delta_x_threshold) {
+ ctrl->ctrl0_9->delta_x_threshold =
+ sensor->axis_align.delta_x_threshold;
+ rc = rmi_write_block(rmi_dev,
+ ctrl->ctrl0_9_address,
+ ctrl->ctrl0_9,
+ sizeof(*ctrl->ctrl0_9));
+ if (rc < 0)
+ dev_warn(&fn->dev, "Failed to write to delta_x_threshold. Code: %d.\n",
+ rc);
- if (sensor->axis_align.delta_y_threshold) {
- ctrl->ctrl0_9->delta_y_threshold =
- sensor->axis_align.delta_y_threshold;
- rc = rmi_write_block(rmi_dev,
- ctrl->ctrl0_9_address,
- ctrl->ctrl0_9,
- sizeof(*ctrl->ctrl0_9));
- if (rc < 0)
- dev_warn(&fn->dev, "Failed to write to delta_y_threshold %d. Code: %d.\n",
- i, rc);
- }
+ }
+
+ if (sensor->axis_align.delta_y_threshold) {
+ ctrl->ctrl0_9->delta_y_threshold =
+ sensor->axis_align.delta_y_threshold;
+ rc = rmi_write_block(rmi_dev,
+ ctrl->ctrl0_9_address,
+ ctrl->ctrl0_9,
+ sizeof(*ctrl->ctrl0_9));
+ if (rc < 0)
+ dev_warn(&fn->dev, "Failed to write to delta_y_threshold. Code: %d.\n",
+ rc);
}
mutex_init(&f11->dev_controls_mutex);
@@ -1728,22 +1706,61 @@ static int rmi_f11_register_devices(struct rmi_function *fn)
struct input_dev *input_dev_mouse;
struct rmi_driver_data *driver_data = dev_get_drvdata(&rmi_dev->dev);
struct rmi_driver *driver = rmi_dev->driver;
- int sensors_itertd = 0;
- int i;
+ struct f11_2d_sensor *sensor = &f11->sensor;
int rc;
- for (i = 0; i < (f11->dev_query.nbr_of_sensors + 1); i++) {
- struct f11_2d_sensor *sensor = &f11->sensors[i];
- sensors_itertd = i;
- input_dev = input_allocate_device();
- if (!input_dev) {
+ input_dev = input_allocate_device();
+ if (!input_dev) {
+ rc = -ENOMEM;
+ goto error_unregister;
+ }
+
+ sensor->input = input_dev;
+ if (driver->set_input_params) {
+ rc = driver->set_input_params(rmi_dev, input_dev);
+ if (rc < 0) {
+ dev_err(&fn->dev,
+ "%s: Error in setting input device.\n",
+ __func__);
+ goto error_unregister;
+ }
+ }
+ sprintf(sensor->input_phys, "%s.abs/input0",
+ dev_name(&fn->dev));
+ input_dev->phys = sensor->input_phys;
+ input_dev->dev.parent = &rmi_dev->dev;
+ input_set_drvdata(input_dev, f11);
+
+ set_bit(EV_SYN, input_dev->evbit);
+ set_bit(EV_ABS, input_dev->evbit);
+ input_set_capability(input_dev, EV_KEY, BTN_TOUCH);
+
+ f11_set_abs_params(fn);
+
+ if (sensor->sens_query.info.has_rel) {
+ set_bit(EV_REL, input_dev->evbit);
+ set_bit(REL_X, input_dev->relbit);
+ set_bit(REL_Y, input_dev->relbit);
+ }
+ rc = input_register_device(input_dev);
+ if (rc < 0) {
+ input_free_device(input_dev);
+ sensor->input = NULL;
+ goto error_unregister;
+ }
+
+ if (sensor->sens_query.info.has_rel) {
+ /*create input device for mouse events */
+ input_dev_mouse = input_allocate_device();
+ if (!input_dev_mouse) {
rc = -ENOMEM;
goto error_unregister;
}
- sensor->input = input_dev;
+ sensor->mouse_input = input_dev_mouse;
if (driver->set_input_params) {
- rc = driver->set_input_params(rmi_dev, input_dev);
+ rc = driver->set_input_params(rmi_dev,
+ input_dev_mouse);
if (rc < 0) {
dev_err(&fn->dev,
"%s: Error in setting input device.\n",
@@ -1751,87 +1768,39 @@ static int rmi_f11_register_devices(struct rmi_function *fn)
goto error_unregister;
}
}
- sprintf(sensor->input_phys, "%s.abs%d/input0",
- dev_name(&fn->dev), i);
- input_dev->phys = sensor->input_phys;
- input_dev->dev.parent = &rmi_dev->dev;
- input_set_drvdata(input_dev, f11);
-
- set_bit(EV_SYN, input_dev->evbit);
- set_bit(EV_ABS, input_dev->evbit);
- input_set_capability(input_dev, EV_KEY, BTN_TOUCH);
-
- f11_set_abs_params(fn, i);
-
- if (sensor->sens_query.info.has_rel) {
- set_bit(EV_REL, input_dev->evbit);
- set_bit(REL_X, input_dev->relbit);
- set_bit(REL_Y, input_dev->relbit);
- }
- rc = input_register_device(input_dev);
+ sprintf(sensor->input_phys_mouse, "%s.rel/input0",
+ dev_name(&fn->dev));
+ set_bit(EV_REL, input_dev_mouse->evbit);
+ set_bit(REL_X, input_dev_mouse->relbit);
+ set_bit(REL_Y, input_dev_mouse->relbit);
+
+ set_bit(BTN_MOUSE, input_dev_mouse->evbit);
+ /* Register device's buttons and keys */
+ set_bit(EV_KEY, input_dev_mouse->evbit);
+ set_bit(BTN_LEFT, input_dev_mouse->keybit);
+ set_bit(BTN_MIDDLE, input_dev_mouse->keybit);
+ set_bit(BTN_RIGHT, input_dev_mouse->keybit);
+
+ rc = input_register_device(input_dev_mouse);
if (rc < 0) {
- input_free_device(input_dev);
- sensor->input = NULL;
+ input_free_device(input_dev_mouse);
+ sensor->mouse_input = NULL;
goto error_unregister;
}
- if (sensor->sens_query.info.has_rel) {
- /*create input device for mouse events */
- input_dev_mouse = input_allocate_device();
- if (!input_dev_mouse) {
- rc = -ENOMEM;
- goto error_unregister;
- }
-
- sensor->mouse_input = input_dev_mouse;
- if (driver->set_input_params) {
- rc = driver->set_input_params(rmi_dev,
- input_dev_mouse);
- if (rc < 0) {
- dev_err(&fn->dev,
- "%s: Error in setting input device.\n",
- __func__);
- goto error_unregister;
- }
- }
- sprintf(sensor->input_phys_mouse, "%s.rel%d/input0",
- dev_name(&fn->dev), i);
- set_bit(EV_REL, input_dev_mouse->evbit);
- set_bit(REL_X, input_dev_mouse->relbit);
- set_bit(REL_Y, input_dev_mouse->relbit);
-
- set_bit(BTN_MOUSE, input_dev_mouse->evbit);
- /* Register device's buttons and keys */
- set_bit(EV_KEY, input_dev_mouse->evbit);
- set_bit(BTN_LEFT, input_dev_mouse->keybit);
- set_bit(BTN_MIDDLE, input_dev_mouse->keybit);
- set_bit(BTN_RIGHT, input_dev_mouse->keybit);
-
- rc = input_register_device(input_dev_mouse);
- if (rc < 0) {
- input_free_device(input_dev_mouse);
- sensor->mouse_input = NULL;
- goto error_unregister;
- }
-
- set_bit(BTN_RIGHT, input_dev_mouse->keybit);
- }
-
+ set_bit(BTN_RIGHT, input_dev_mouse->keybit);
}
return 0;
error_unregister:
- for (; sensors_itertd > 0; sensors_itertd--) {
- if (f11->sensors[sensors_itertd].input) {
- if (f11->sensors[sensors_itertd].mouse_input) {
- input_unregister_device(
- f11->sensors[sensors_itertd].mouse_input);
- f11->sensors[sensors_itertd].mouse_input = NULL;
- }
- input_unregister_device(f11->sensors[i].input);
- f11->sensors[i].input = NULL;
+ if (f11->sensor.input) {
+ if (f11->sensor.mouse_input) {
+ input_unregister_device(f11->sensor.mouse_input);
+ f11->sensor.mouse_input = NULL;
}
+ input_unregister_device(f11->sensor.input);
+ f11->sensor.input = NULL;
}
return rc;
@@ -1840,28 +1809,22 @@ error_unregister:
static void rmi_f11_free_devices(struct rmi_function *fn)
{
struct f11_data *f11 = fn->data;
- int i;
- for (i = 0; i < (f11->dev_query.nbr_of_sensors + 1); i++) {
- if (f11->sensors[i].input)
- input_unregister_device(f11->sensors[i].input);
- if (f11->sensors[i].mouse_input)
- input_unregister_device(f11->sensors[i].mouse_input);
- }
+ if (f11->sensor.input)
+ input_unregister_device(f11->sensor.input);
+ if (f11->sensor.mouse_input)
+ input_unregister_device(f11->sensor.mouse_input);
}
static int rmi_f11_config(struct rmi_function *fn)
{
struct f11_data *f11 = fn->data;
- int i;
int rc;
- for (i = 0; i < (f11->dev_query.nbr_of_sensors + 1); i++) {
- rc = f11_write_control_regs(fn, &f11->sensors[i].sens_query,
- &f11->dev_controls, fn->fd.query_base_addr);
- if (rc < 0)
- return rc;
- }
+ rc = f11_write_control_regs(fn, &f11->sensor.sens_query,
+ &f11->dev_controls, fn->fd.query_base_addr);
+ if (rc < 0)
+ return rc;
return 0;
}
@@ -1874,19 +1837,16 @@ int rmi_f11_attention(struct rmi_function *fn,
u16 data_base_addr = fn->fd.data_base_addr;
u16 data_base_addr_offset = 0;
int error;
- int i;
- for (i = 0; i < f11->dev_query.nbr_of_sensors + 1; i++) {
- error = rmi_read_block(rmi_dev,
- data_base_addr + data_base_addr_offset,
- f11->sensors[i].data_pkt,
- f11->sensors[i].pkt_size);
- if (error < 0)
- return error;
+ error = rmi_read_block(rmi_dev,
+ data_base_addr + data_base_addr_offset,
+ f11->sensor.data_pkt,
+ f11->sensor.pkt_size);
+ if (error < 0)
+ return error;
- rmi_f11_finger_handler(f11, &f11->sensors[i]);
- data_base_addr_offset += f11->sensors[i].pkt_size;
- }
+ rmi_f11_finger_handler(f11, &f11->sensor);
+ data_base_addr_offset += f11->sensor.pkt_size;
return 0;
}
diff --git a/include/linux/rmi.h b/include/linux/rmi.h
index dc94dc1..735e978 100644
--- a/include/linux/rmi.h
+++ b/include/linux/rmi.h
@@ -222,13 +222,10 @@ struct rmi_device_platform_data_spi {
* @spi_data - override default settings for SPI delays and SSB management (see
* above).
*
- * @f11_sensor_data - an array of platform data for individual F11 2D sensors.
- * @f11_sensor_count - the length of f11_sensor_data array. Extra entries will
- * be ignored; if there are too few entries, all settings for the additional
- * sensors will be defaulted.
+ * @f11_sensor_data - platform data for the F11 2D sensor.
* @f11_rezero_wait - if non-zero, this is how may milliseconds the F11 2D
- * sensor(s) will wait before being be rezeroed on exit from suspend. If
- * this value is zero, the F11 2D sensor(s) will not be rezeroed on resume.
+ * sensor will wait before being be rezeroed on exit from suspend. If
+ * this value is zero, the F11 2D sensor will not be rezeroed on resume.
* @pre_suspend - this will be called before any other suspend operations are
* done.
* @power_management - overrides default touch sensor doze mode settings (see
@@ -266,7 +263,6 @@ struct rmi_device_platform_data {
/* function handler pdata */
struct rmi_f11_sensor_data *f11_sensor_data;
- u8 f11_sensor_count;
u16 f11_rezero_wait;
struct rmi_f01_power_management power_management;
struct rmi_button_map *f19_button_map;
--
1.8.3.2
^ permalink raw reply related
* [PATCH v1] HID: hid-sensor-hub: Fix kernel warning and failure
From: Srinivas Pandruvada @ 2013-12-06 0:34 UTC (permalink / raw)
To: jkosina; +Cc: linux-input, Srinivas Pandruvada
In-Reply-To: <1386290065-31813-1-git-send-email-srinivas.pandruvada@linux.intel.com>
Fix kernel warning and failure to register sensor hub devices with MFD.
Now many devices has in-built sensor hubs. So by default this HID hub,
is properly parsed and register individual sensors as platform device
using MFD framework. But if a second sensor hub is attached via USB,
which has same sensors, it will result in kernel warning and failure
to register MFD cell as the platform device sysfs file name will be
same as created by in-built sensor hubs. This patch sets MFD cell id
to PLATFORM_DEVID_AUTO. In this way there will never
be duplicate sysfs file names.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
drivers/hid/hid-sensor-hub.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index a184e19..8af2d90 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -573,6 +573,8 @@ static int sensor_hub_probe(struct hid_device *hdev,
goto err_free_names;
}
sd->hid_sensor_hub_client_devs[
+ sd->hid_sensor_client_cnt].id = PLATFORM_DEVID_AUTO;
+ sd->hid_sensor_hub_client_devs[
sd->hid_sensor_client_cnt].name = name;
sd->hid_sensor_hub_client_devs[
sd->hid_sensor_client_cnt].platform_data =
--
1.8.1.2
^ permalink raw reply related
* [PATCH v1] Fix kernel warning and failure
From: Srinivas Pandruvada @ 2013-12-06 0:34 UTC (permalink / raw)
To: jkosina; +Cc: linux-input, Srinivas Pandruvada
v1:
Use platform driver capability to assign unique id.
In this way it is just one line change.
v0:
Use idr to allocate unique cell id
Srinivas Pandruvada (1):
HID: hid-sensor-hub: Fix kernel warning and failure
drivers/hid/hid-sensor-hub.c | 2 ++
1 file changed, 2 insertions(+)
--
1.8.1.2
^ permalink raw reply
* [PATCH V2] input synaptics-rmi4: Reorder declarations in rmi_bus.c
From: Christopher Heiny @ 2013-12-06 0:29 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Linux Input, Christopher Heiny, Andrew Duggan, Vincent Huang,
Vivian Ly, Daniel Rosenberg, Jean Delvare, Joerie de Gram,
Linus Walleij, Benjamin Tissoires
This patch implements changes to the synaptics-rmi4 branch of
Dmitry's input tree. The base for the patch is commit
8ca01dc61a42b6f7bcba052a8c084000f7057a34.
This patch primarily reorders the various declarations in rmi_bus.c in order to
group related elements together, along with some typo fixes. The code is still
horribly broken, but this change should make the following fixes easier to
review.
Signed-off-by: Christopher Heiny <cheiny@synaptics.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Linus Walleij <linus.walleij@stericsson.com>
Cc: Joerie de Gram <j.de.gram@gmail.com>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
drivers/input/rmi4/rmi_bus.c | 189 +++++++++++++++++++++----------------------
1 file changed, 90 insertions(+), 99 deletions(-)
diff --git a/drivers/input/rmi4/rmi_bus.c b/drivers/input/rmi4/rmi_bus.c
index 88f60ca..d9c450b 100644
--- a/drivers/input/rmi4/rmi_bus.c
+++ b/drivers/input/rmi4/rmi_bus.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012 Synaptics Incorporated
+ * Copyright (c) 2011-2013 Synaptics Incorporated
* Copyright (c) 2011 Unixphere
*
* This program is free software; you can redistribute it and/or modify it
@@ -19,77 +19,20 @@
#include "rmi_bus.h"
#include "rmi_driver.h"
-static int rmi_function_match(struct device *dev, struct device_driver *drv)
-{
- struct rmi_function_handler *handler = to_rmi_function_handler(drv);
- struct rmi_function *fn = to_rmi_function(dev);
-
- return fn->fd.function_number == handler->func;
-}
-
-static int rmi_bus_match(struct device *dev, struct device_driver *drv)
-{
- bool physical = rmi_is_physical_device(dev);
-
- /* First see if types are not compatible */
- if (physical != rmi_is_physical_driver(drv))
- return 0;
-
- return physical || rmi_function_match(dev, drv);
-}
-
-struct bus_type rmi_bus_type = {
- .match = rmi_bus_match,
- .name = "rmi",
-};
-
-#ifdef CONFIG_RMI4_DEBUG
-
-static struct dentry *rmi_debugfs_root;
-
-static void rmi_bus_setup_debugfs(void)
-{
- rmi_debugfs_root = debugfs_create_dir(rmi_bus_type.name, NULL);
- if (!rmi_debugfs_root)
- pr_err("%s: Failed to create debugfs root\n",
- __func__);
-}
-
-static void rmi_bus_teardown_debugfs(void)
-{
- if (rmi_debugfs_root)
- debugfs_remove_recursive(rmi_debugfs_root);
-}
-
-#else
-
-static void rmi_bus_setup_debugfs(void)
-{
-}
-
-static void rmi_bus_teardown_debugfs(void)
-{
-}
-
-#endif
-
-
/*
* RMI Physical devices
*
* Physical RMI device consists of several functions serving particular
- * purpose. For example F11 is a 2D touch sensor while F10 is a generic
+ * purpose. For example F11 is a 2D touch sensor while F01 is a generic
* function present in every RMI device.
*/
static void rmi_release_device(struct device *dev)
{
struct rmi_device *rmi_dev = to_rmi_device(dev);
-
kfree(rmi_dev);
}
-/* Device type for physical RMI devices */
struct device_type rmi_device_type = {
.name = "rmi_sensor",
.release = rmi_release_device,
@@ -118,7 +61,7 @@ static void rmi_physical_teardown_debugfs(struct rmi_device *rmi_dev)
#else
-static void rmi_physocal_setup_debugfs(struct rmi_device *rmi_dev)
+static void rmi_physical_setup_debugfs(struct rmi_device *rmi_dev)
{
}
@@ -128,7 +71,6 @@ static void rmi_physical_teardown_debugfs(struct rmi_device *rmi_dev)
#endif
-
/**
* rmi_register_physical_device - register a physical device connection on the RMI
* bus. Physical drivers provide communication from the devices on the bus to
@@ -174,7 +116,7 @@ int rmi_register_physical_device(struct rmi_phys_device *phys)
return 0;
}
-EXPORT_SYMBOL(rmi_register_physical_device);
+EXPORT_SYMBOL_GPL(rmi_register_physical_device);
/**
* rmi_unregister_physical_device - unregister a physical device connection
@@ -191,18 +133,14 @@ void rmi_unregister_physical_device(struct rmi_phys_device *phys)
EXPORT_SYMBOL(rmi_unregister_physical_device);
-/*
- * RMI Function devices and their handlers
- */
+/* Function specific stuff */
static void rmi_release_function(struct device *dev)
{
struct rmi_function *fn = to_rmi_function(dev);
-
kfree(fn);
}
-/* Device type for RMI Function devices */
struct device_type rmi_function_type = {
.name = "rmi_function",
.release = rmi_release_function,
@@ -244,35 +182,12 @@ static void rmi_function_teardown_debugfs(struct rmi_function *fn)
#endif
-int rmi_register_function(struct rmi_function *fn)
+static int rmi_function_match(struct device *dev, struct device_driver *drv)
{
- struct rmi_device *rmi_dev = fn->rmi_dev;
- int error;
-
- dev_set_name(&fn->dev, "%s.fn%02x",
- dev_name(&rmi_dev->dev), fn->fd.function_number);
-
- fn->dev.parent = &rmi_dev->dev;
- fn->dev.type = &rmi_function_type;
- fn->dev.bus = &rmi_bus_type;
-
- error = device_register(&fn->dev);
- if (error) {
- dev_err(&rmi_dev->dev,
- "Failed device_register function device %s\n",
- dev_name(&fn->dev));
- }
-
- dev_dbg(&rmi_dev->dev, "Registered F%02X.\n", fn->fd.function_number);
-
- rmi_function_setup_debugfs(fn);
- return 0;
-}
+ struct rmi_function_handler *handler = to_rmi_function_handler(drv);
+ struct rmi_function *fn = to_rmi_function(dev);
-void rmi_unregister_function(struct rmi_function *fn)
-{
- rmi_function_teardown_debugfs(fn);
- device_unregister(&fn->dev);
+ return fn->fd.function_number == handler->func;
}
static int rmi_function_probe(struct device *dev)
@@ -302,6 +217,38 @@ static int rmi_function_remove(struct device *dev)
return 0;
}
+int rmi_register_function(struct rmi_function *fn)
+{
+ struct rmi_device *rmi_dev = fn->rmi_dev;
+ int error;
+
+ dev_set_name(&fn->dev, "%s.fn%02x",
+ dev_name(&rmi_dev->dev), fn->fd.function_number);
+
+ fn->dev.parent = &rmi_dev->dev;
+ fn->dev.type = &rmi_function_type;
+ fn->dev.bus = &rmi_bus_type;
+
+ error = device_register(&fn->dev);
+ if (error) {
+ dev_err(&rmi_dev->dev,
+ "Failed device_register function device %s\n",
+ dev_name(&fn->dev));
+ return error;
+ }
+
+ dev_dbg(&rmi_dev->dev, "Registered F%02X.\n", fn->fd.function_number);
+
+ rmi_function_setup_debugfs(fn);
+ return 0;
+}
+
+void rmi_unregister_function(struct rmi_function *fn)
+{
+ rmi_function_teardown_debugfs(fn);
+ device_unregister(&fn->dev);
+}
+
/**
* rmi_register_function_handler - register a handler for an RMI function
* @handler: RMI handler that should be registered.
@@ -334,7 +281,7 @@ int __rmi_register_function_handler(struct rmi_function_handler *handler,
return 0;
}
-EXPORT_SYMBOL(__rmi_register_function_handler);
+EXPORT_SYMBOL_GPL(__rmi_register_function_handler);
/**
* rmi_unregister_function_handler - unregister given RMI function handler
@@ -347,11 +294,55 @@ void rmi_unregister_function_handler(struct rmi_function_handler *handler)
{
driver_unregister(&handler->driver);
}
-EXPORT_SYMBOL(rmi_unregister_function_handler);
+EXPORT_SYMBOL_GPL(rmi_unregister_function_handler);
-/*
- * Bus registration and tear-down
- */
+/* Bus specific stuff */
+
+static int rmi_bus_match(struct device *dev, struct device_driver *drv)
+{
+ bool physical = rmi_is_physical_device(dev);
+
+ /* First see if types are not compatible */
+ if (physical != rmi_is_physical_driver(drv))
+ return 0;
+
+ return physical || rmi_function_match(dev, drv);
+}
+
+struct bus_type rmi_bus_type = {
+ .match = rmi_bus_match,
+ .name = "rmi",
+};
+
+#ifdef CONFIG_RMI4_DEBUG
+
+static struct dentry *rmi_debugfs_root;
+
+static void rmi_bus_setup_debugfs(void)
+{
+ rmi_debugfs_root = debugfs_create_dir(rmi_bus_type.name, NULL);
+ if (!rmi_debugfs_root)
+ pr_err("%s: Failed to create debugfs root\n",
+ __func__);
+}
+
+static void rmi_bus_teardown_debugfs(void)
+{
+ if (rmi_debugfs_root)
+ debugfs_remove_recursive(rmi_debugfs_root);
+}
+
+#else
+
+static void rmi_bus_setup_debugfs(void)
+{
+}
+
+static void rmi_bus_teardown_debugfs(void)
+{
+}
+
+#endif
static int __init rmi_bus_init(void)
{
^ permalink raw reply related
* [PATCH V2] input synaptics-rmi4: Fix ms calculation in poll interval
From: Christopher Heiny @ 2013-12-06 0:13 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Linux Input, Christopher Heiny, Andrew Duggan, Vincent Huang,
Vivian Ly, Daniel Rosenberg, Jean Delvare, Joerie de Gram,
Linus Walleij, Benjamin Tissoires
[Previous patch re-used an old template for the subject line. Sorry about that]
This patch implements changes to the synaptics-rmi4 branch of
Dmitry's input tree. The base for the patch is commit
8ca01dc61a42b6f7bcba052a8c084000f7057a34.
Fix computation of poll interval milliseconds.
Signed-off-by: Christopher Heiny <cheiny@synaptics.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Linus Walleij <linus.walleij@stericsson.com>
Cc: Joerie de Gram <j.de.gram@gmail.com>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
drivers/input/rmi4/rmi_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
index 9af297e..dffbfa0 100644
--- a/drivers/input/rmi4/rmi_driver.c
+++ b/drivers/input/rmi4/rmi_driver.c
@@ -934,7 +934,7 @@ static int rmi_driver_probe(struct device *dev)
} else
data->poll_interval = ktime_set(0,
(pdata->poll_interval_ms ? pdata->poll_interval_ms :
- DEFAULT_POLL_INTERVAL_MS) * 1000);
+ DEFAULT_POLL_INTERVAL_MS) * 1000 * 1000);
if (data->f01_container->dev.driver) {
/* Driver already bound, so enable ATTN now. */
^ permalink raw reply related
* [PATCH] input synaptics-rmi4: Remove sysfs & debugfs stuff
From: Christopher Heiny @ 2013-12-05 23:24 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Linux Input, Christopher Heiny, Andrew Duggan, Vincent Huang,
Vivian Ly, Daniel Rosenberg, Jean Delvare, Joerie de Gram,
Linus Walleij, Benjamin Tissoires
This patch implements changes to the synaptics-rmi4 branch of
Dmitry's input tree. The base for the patch is commit
8ca01dc61a42b6f7bcba052a8c084000f7057a34.
Fix computation of poll interval milliseconds.
Signed-off-by: Christopher Heiny <cheiny@synaptics.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Linus Walleij <linus.walleij@stericsson.com>
Cc: Joerie de Gram <j.de.gram@gmail.com>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
---
drivers/input/rmi4/rmi_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
index 9af297e..dffbfa0 100644
--- a/drivers/input/rmi4/rmi_driver.c
+++ b/drivers/input/rmi4/rmi_driver.c
@@ -934,7 +934,7 @@ static int rmi_driver_probe(struct device *dev)
} else
data->poll_interval = ktime_set(0,
(pdata->poll_interval_ms ? pdata->poll_interval_ms :
- DEFAULT_POLL_INTERVAL_MS) * 1000);
+ DEFAULT_POLL_INTERVAL_MS) * 1000 * 1000);
if (data->f01_container->dev.driver) {
/* Driver already bound, so enable ATTN now. */
^ permalink raw reply related
* [PATCH 1/2] Input: tsc2005: add DT support
From: Sebastian Reichel @ 2013-12-05 23:09 UTC (permalink / raw)
To: Sebastian Reichel, Dmitry Torokhov, Dmitry Torokhov, linux-input
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, Grant Likely, devicetree, linux-omap,
linux-kernel, Sebastian Reichel
In-Reply-To: <1386284979-9680-1-git-send-email-sre@debian.org>
This adds DT support to the tsc2005 touchscreen
driver.
Signed-off-by: Sebastian Reichel <sre@debian.org>
---
drivers/input/touchscreen/tsc2005.c | 95 ++++++++++++++++++++++++++++++-------
1 file changed, 78 insertions(+), 17 deletions(-)
diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c
index 7a6ff52..b50986b 100644
--- a/drivers/input/touchscreen/tsc2005.c
+++ b/drivers/input/touchscreen/tsc2005.c
@@ -28,6 +28,8 @@
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/pm.h>
+#include <linux/of.h>
+#include <linux/of_gpio.h>
#include <linux/spi/spi.h>
#include <linux/spi/tsc2005.h>
@@ -100,6 +102,11 @@
TSC2005_CFR2_AVG_7)
#define MAX_12BIT 0xfff
+#define TSC2005_DEF_X_FUZZ 4
+#define TSC2005_DEF_Y_FUZZ 8
+#define TSC2005_DEF_P_FUZZ 2
+#define TSC2005_DEF_RESISTOR 280
+
#define TSC2005_SPI_MAX_SPEED_HZ 10000000
#define TSC2005_PENUP_TIME_MS 40
@@ -143,6 +150,7 @@ struct tsc2005 {
bool pen_down;
+ int reset_gpio;
void (*set_reset)(bool enable);
};
@@ -337,6 +345,14 @@ static void tsc2005_stop_scan(struct tsc2005 *ts)
tsc2005_cmd(ts, TSC2005_CMD_STOP);
}
+static void tsc2005_set_reset(struct tsc2005 *ts, bool enable)
+{
+ if (ts->reset_gpio >= 0)
+ gpio_set_value(ts->reset_gpio, enable);
+ else if (ts->set_reset)
+ ts->set_reset(enable);
+}
+
/* must be called with ts->mutex held */
static void __tsc2005_disable(struct tsc2005 *ts)
{
@@ -355,7 +371,7 @@ static void __tsc2005_enable(struct tsc2005 *ts)
{
tsc2005_start_scan(ts);
- if (ts->esd_timeout && ts->set_reset) {
+ if (ts->esd_timeout && (ts->set_reset || ts->reset_gpio)) {
ts->last_valid_interrupt = jiffies;
schedule_delayed_work(&ts->esd_work,
round_jiffies_relative(
@@ -414,9 +430,9 @@ static ssize_t tsc2005_selftest_show(struct device *dev,
}
/* hardware reset */
- ts->set_reset(false);
+ tsc2005_set_reset(ts, false);
usleep_range(100, 500); /* only 10us required */
- ts->set_reset(true);
+ tsc2005_set_reset(ts, true);
if (!success)
goto out;
@@ -459,7 +475,7 @@ static umode_t tsc2005_attr_is_visible(struct kobject *kobj,
umode_t mode = attr->mode;
if (attr == &dev_attr_selftest.attr) {
- if (!ts->set_reset)
+ if (!ts->set_reset && !ts->reset_gpio)
mode = 0;
}
@@ -509,9 +525,9 @@ static void tsc2005_esd_work(struct work_struct *work)
tsc2005_update_pen_state(ts, 0, 0, 0);
- ts->set_reset(false);
+ tsc2005_set_reset(ts, false);
usleep_range(100, 500); /* only 10us required */
- ts->set_reset(true);
+ tsc2005_set_reset(ts, true);
enable_irq(ts->spi->irq);
tsc2005_start_scan(ts);
@@ -572,29 +588,53 @@ static void tsc2005_setup_spi_xfer(struct tsc2005 *ts)
static int tsc2005_probe(struct spi_device *spi)
{
const struct tsc2005_platform_data *pdata = spi->dev.platform_data;
+ struct device_node *np = spi->dev.of_node;
struct tsc2005 *ts;
struct input_dev *input_dev;
unsigned int max_x, max_y, max_p;
unsigned int fudge_x, fudge_y, fudge_p;
+ unsigned int esd_timeout, x_plate_ohm;
int error;
- if (!pdata) {
+ if (!np && !pdata) {
dev_err(&spi->dev, "no platform data\n");
return -ENODEV;
}
- fudge_x = pdata->ts_x_fudge ? : 4;
- fudge_y = pdata->ts_y_fudge ? : 8;
- fudge_p = pdata->ts_pressure_fudge ? : 2;
- max_x = pdata->ts_x_max ? : MAX_12BIT;
- max_y = pdata->ts_y_max ? : MAX_12BIT;
- max_p = pdata->ts_pressure_max ? : MAX_12BIT;
-
if (spi->irq <= 0) {
dev_err(&spi->dev, "no irq\n");
return -ENODEV;
}
+ if (pdata) {
+ fudge_x = pdata->ts_x_fudge ? : TSC2005_DEF_X_FUZZ;
+ fudge_y = pdata->ts_y_fudge ? : TSC2005_DEF_Y_FUZZ;
+ fudge_p = pdata->ts_pressure_fudge ? : TSC2005_DEF_P_FUZZ;
+ max_x = pdata->ts_x_max ? : MAX_12BIT;
+ max_y = pdata->ts_y_max ? : MAX_12BIT;
+ max_p = pdata->ts_pressure_max ? : MAX_12BIT;
+ x_plate_ohm = pdata->ts_x_plate_ohm ? : TSC2005_DEF_RESISTOR;
+ esd_timeout = pdata->esd_timeout_ms;
+ } else {
+ fudge_x = TSC2005_DEF_X_FUZZ;
+ of_property_read_u32(np, "ti,fuzz-x", &fudge_x);
+ fudge_y = TSC2005_DEF_Y_FUZZ;
+ of_property_read_u32(np, "ti,fuzz-y", &fudge_y);
+ fudge_p = TSC2005_DEF_P_FUZZ;
+ of_property_read_u32(np, "ti,fuzz-pressure", &fudge_p);
+ max_x = MAX_12BIT;
+ of_property_read_u32(np, "ti,max-x", &max_x);
+ max_y = MAX_12BIT;
+ of_property_read_u32(np, "ti,max-y", &max_y);
+ max_p = MAX_12BIT;
+ of_property_read_u32(np, "ti,max-pressure", &max_p);
+ x_plate_ohm = TSC2005_DEF_RESISTOR;
+ of_property_read_u32(np, "ti,x-plate-resistance", &x_plate_ohm);
+ esd_timeout = 0;
+ of_property_read_u32(np, "ti,esd-recovery-timeout-ms",
+ &esd_timeout);
+ }
+
spi->mode = SPI_MODE_0;
spi->bits_per_word = 8;
if (!spi->max_speed_hz)
@@ -612,9 +652,30 @@ static int tsc2005_probe(struct spi_device *spi)
ts->spi = spi;
ts->idev = input_dev;
- ts->x_plate_ohm = pdata->ts_x_plate_ohm ? : 280;
- ts->esd_timeout = pdata->esd_timeout_ms;
- ts->set_reset = pdata->set_reset;
+ ts->x_plate_ohm = x_plate_ohm;
+ ts->esd_timeout = esd_timeout;
+
+ if (np) {
+ ts->reset_gpio = of_get_named_gpio(np, "reset-gpio", 0);
+ if (ts->reset_gpio == -EPROBE_DEFER)
+ return ts->reset_gpio;
+ if (ts->reset_gpio < 0) {
+ dev_err(&spi->dev, "error acquiring reset gpio: %d\n",
+ ts->reset_gpio);
+ return ts->reset_gpio;
+ }
+
+ error = devm_gpio_request_one(&spi->dev, ts->reset_gpio, 0,
+ "reset-gpio");
+ if (error) {
+ dev_err(&spi->dev, "error requesting reset gpio: %d\n",
+ error);
+ return error;
+ }
+ } else {
+ ts->reset_gpio = -1;
+ ts->set_reset = pdata->set_reset;
+ }
mutex_init(&ts->mutex);
--
1.8.4.3
^ permalink raw reply related
* [PATCH 0/2] tsc2005 DT binding
From: Sebastian Reichel @ 2013-12-05 23:09 UTC (permalink / raw)
To: Sebastian Reichel, Dmitry Torokhov, Dmitry Torokhov, linux-input
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, Grant Likely, devicetree, linux-omap,
linux-kernel, Sebastian Reichel
Hi,
This adds device tree support for the tsc2005 touchscreen
controller, which is currently only used by the Nokia N900
board.
The patch does not update the reset pin handling for platform
data based probe to avoid merge conflicts (Tony will remove
the Nokia N900 boardcode in 3.14). The platform data based
probe can be removed once the N900 boardcode is gone.
-- Sebastian
Sebastian Reichel (2):
Input: tsc2005: add DT support
Documentation: dt: Document TSC2005 DT binding
.../bindings/input/touchscreen/tsc2005.txt | 49 +++++++++++
drivers/input/touchscreen/tsc2005.c | 95 ++++++++++++++++++----
2 files changed, 127 insertions(+), 17 deletions(-)
create mode 100644 Documentation/devicetree/bindings/input/touchscreen/tsc2005.txt
--
1.8.4.3
^ permalink raw reply
* [PATCH 2/2] Documentation: dt: Document TSC2005 DT binding
From: Sebastian Reichel @ 2013-12-05 23:09 UTC (permalink / raw)
To: Sebastian Reichel, Dmitry Torokhov, Dmitry Torokhov, linux-input
Cc: Rob Herring, Pawel Moll, Mark Rutland, Stephen Warren,
Ian Campbell, Rob Landley, Grant Likely, devicetree, linux-omap,
linux-kernel, Sebastian Reichel
In-Reply-To: <1386284979-9680-1-git-send-email-sre@debian.org>
Add devicetree binding documentation for TSC2005 touchscreen.
Signed-off-by: Sebastian Reichel <sre@debian.org>
---
.../bindings/input/touchscreen/tsc2005.txt | 49 ++++++++++++++++++++++
1 file changed, 49 insertions(+)
create mode 100644 Documentation/devicetree/bindings/input/touchscreen/tsc2005.txt
diff --git a/Documentation/devicetree/bindings/input/touchscreen/tsc2005.txt b/Documentation/devicetree/bindings/input/touchscreen/tsc2005.txt
new file mode 100644
index 0000000..4e7df0b
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/tsc2005.txt
@@ -0,0 +1,49 @@
+* TSC2005 Touchscreen
+
+Required properties:
+ - compatible : "ti,tsc2005"
+ - reg : SPI device address
+ - spi-max-frequency : Maximal SPI speed
+ - interrupts : IRQ specifier
+ - reset-gpio : GPIO specifier
+
+Optional properties:
+ - ti,fuzz-x : integer, X noise value of the touchscreen
+ (defaults to 4)
+ - ti,fuzz-y : integer, Y noise value of the touchscreen
+ (defaults to 8)
+ - ti,fuzz-pressure : integer, pressure noise value of the touchscreen
+ (defaults to 2)
+ - ti,max-x : integer, maximum reported x value
+ (defaults to 4096)
+ - ti,max-y : integer, maximum reported y value
+ (defaults to 4096)
+ - ti,max-pressure : integer, maximum reported pressure
+ (defaults to 4096)
+ - ti,x-plate-resistance : integer, resistance of the touchscreen's X plates
+ in ohm (defaults to 280)
+ - ti,esd-recovery-timeout-ms : integer, if the touchscreen does not respond after
+ the configured time (in milli seconds), the driver
+ will reset it. This is disabled by default.
+
+Example:
+
+&mcspi1 {
+ tsc2005@0 {
+ compatible = "ti,tsc2005";
+ spi-max-frequency = <6000000>;
+ reg = <0>;
+ reset-gpio = <&gpio4 8 GPIO_ACTIVE_HIGH>; /* 104 */
+ interrupt-parent = <&gpio4>;
+ interrupts = <4 IRQ_TYPE_NONE>; /* gpio line 100 */
+
+ ti,fuzz-x = <4>;
+ ti,fuzz-y = <7>;
+ ti,fuzz-pressure = <2>;
+ ti,max-x = <4096>;
+ ti,max-y = <4096>;
+ ti,max-pressure = <2048>;
+ ti,x-plate-resistance = <280>;
+ ti,esd-recovery-timeout-ms = <8000>;
+ };
+}
--
1.8.4.3
^ permalink raw reply related
* Re: [PATCH] input synaptics-rmi4: Fix camel case in comments.
From: Dmitry Torokhov @ 2013-12-05 21:02 UTC (permalink / raw)
To: Christopher Heiny
Cc: Linux Input, Andrew Duggan, Vincent Huang, Vivian Ly,
Daniel Rosenberg
In-Reply-To: <1384377325-29380-1-git-send-email-cheiny@synaptics.com>
On Wed, Nov 13, 2013 at 01:15:25PM -0800, Christopher Heiny wrote:
> Trivial change to make variable names in a comment match those in the code.
>
> Signed-off-by: Christopher Heiny <cheiny@synaptics.com>
Applied, thank you.
--
Dmitry
^ permalink raw reply
* Re: [PATCH] input synaptics-rmi4: Remove sysfs & debugfs stuff
From: Dmitry Torokhov @ 2013-12-05 21:01 UTC (permalink / raw)
To: Christopher Heiny
Cc: Linux Input, Andrew Duggan, Vincent Huang, Vivian Ly,
Daniel Rosenberg, Jean Delvare, Joerie de Gram, Linus Walleij,
Benjamin Tissoires
In-Reply-To: <1386031940-20829-1-git-send-email-cheiny@synaptics.com>
On Mon, Dec 02, 2013 at 04:52:20PM -0800, Christopher Heiny wrote:
> This patch implements changes to the synaptics-rmi4 branch of
> Dmitry's input tree. The base for the patchset is Dmitry's commit
> 4a695a01fba9bf467b3b52e124ccee6cef73b323 from 2013-01-31.
>
> Removed all of the sysfs and most of the debugfs support from the driver core
> and function drivers. The code is still horribly broken (as previously
> advertised) but should now be easier to work with. A few lines are reformatted
> for line-length issues.
>
> Signed-off-by: Christopher Heiny <cheiny@synaptics.com>
Applied, thank you.
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: Jean Delvare <khali@linux-fr.org>
> Cc: Linus Walleij <linus.walleij@stericsson.com>
> Cc: Joerie de Gram <j.de.gram@gmail.com>
> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
>
> ---
> drivers/input/rmi4/rmi_bus.h | 11 -
> drivers/input/rmi4/rmi_driver.c | 175 +--------
> drivers/input/rmi4/rmi_f01.c | 787 +---------------------------------------
> drivers/input/rmi4/rmi_f11.c | 183 ----------
> drivers/input/rmi4/rmi_i2c.c | 6 +-
> 5 files changed, 9 insertions(+), 1153 deletions(-)
>
> diff --git a/drivers/input/rmi4/rmi_bus.h b/drivers/input/rmi4/rmi_bus.h
> index 33e8f1b..e2a3dc6 100644
> --- a/drivers/input/rmi4/rmi_bus.h
> +++ b/drivers/input/rmi4/rmi_bus.h
> @@ -22,17 +22,6 @@
> #include <linux/debugfs.h>
> #include <linux/rmi.h>
>
> -
> -/* Permissions for sysfs attributes. Since the permissions policy will change
> - * on a global basis in the future, rather than edit all sysfs attrs everywhere
> - * in the driver (and risk screwing that up in the process), we use this handy
> - * set of #defines. That way when we change the policy for sysfs permissions,
> - * we only need to change them here.
> - */
> -#define RMI_RO_ATTR S_IRUGO
> -#define RMI_RW_ATTR (S_IRUGO | S_IWUGO)
> -#define RMI_WO_ATTR S_IWUGO
> -
> struct rmi_device;
>
> /**
> diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
> index 5cf7b33..132cd52 100644
> --- a/drivers/input/rmi4/rmi_driver.c
> +++ b/drivers/input/rmi4/rmi_driver.c
> @@ -4,9 +4,10 @@
> *
> * This driver provides the core support for a single RMI4-based device.
> *
> - * The RMI4 specification can be found here:
> + * The RMI4 specification can be found here (URL split for line length):
> *
> - * http://www.synaptics.com/sites/default/files/511-000136-01-Rev-E-RMI4%20Intrfacing%20Guide.pdf
> + * http://www.synaptics.com/sites/default/files/
> + * 511-000136-01-Rev-E-RMI4%20Intrfacing%20Guide.pdf
> *
> * This program is free software; you can redistribute it and/or modify it
> * under the terms of the GNU General Public License version 2 as published by
> @@ -42,48 +43,6 @@
>
> #define IRQ_DEBUG(data) (IS_ENABLED(CONFIG_RMI4_DEBUG) && data->irq_debug)
>
> -#ifdef CONFIG_RMI4_DEBUG
> -static void rmi_driver_setup_debugfs(struct rmi_device *rmi_dev)
> -{
> - struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev);
> - struct rmi_phys_info *info = &rmi_dev->phys->info;
> -
> - if (!rmi_dev->debugfs_root)
> - return;
> -
> - if (!debugfs_create_u32_array("transport_stats", RMI_RO_ATTR,
> - rmi_dev->debugfs_root,
> - (u32 *)&info->tx_count, 6))
> - dev_warn(&rmi_dev->dev,
> - "Failed to create debugfs transport_stats\n");
> -
> - if (!debugfs_create_bool("irq_debug", RMI_RW_ATTR,
> - rmi_dev->debugfs_root,
> - &data->irq_debug))
> - dev_warn(&rmi_dev->dev, "Failed to create debugfs irq_debug\n");
> -
> - if (!debugfs_create_u32("attn_count", RMI_RO_ATTR,
> - rmi_dev->debugfs_root,
> - &data->attn_count))
> - dev_warn(&rmi_dev->dev,
> - "Failed to create debugfs attn_count\n");
> -}
> -
> -static void rmi_driver_teardown_debugfs(struct rmi_device *rmi_dev)
> -{
> - debugfs_remove_recursive(rmi_dev->debugfs_root);
> -}
> -
> -#else
> -static inline void rmi_driver_setup_debugfs(struct rmi_device *rmi_dev)
> -{
> -}
> -
> -static inline rmi_driver_teardown_debugfs(struct rmi_device *rmi_dev)
> -{
> -}
> -#endif
> -
> static irqreturn_t rmi_irq_thread(int irq, void *p)
> {
> struct rmi_phys_device *phys = p;
> @@ -217,122 +176,6 @@ static int enable_sensor(struct rmi_device *rmi_dev)
> return retval;
> }
>
> -/* sysfs show and store fns for driver attributes */
> -
> -static ssize_t rmi_driver_bsr_show(struct device *dev,
> - struct device_attribute *attr, char *buf)
> -{
> - struct rmi_device *rmi_dev;
> - struct rmi_driver_data *data;
> - rmi_dev = to_rmi_device(dev);
> - data = dev_get_drvdata(&rmi_dev->dev);
> -
> - return snprintf(buf, PAGE_SIZE, "%u\n", data->bsr);
> -}
> -
> -static ssize_t rmi_driver_bsr_store(struct device *dev,
> - struct device_attribute *attr,
> - const char *buf, size_t count)
> -{
> - int retval;
> - unsigned long val;
> - struct rmi_device *rmi_dev;
> - struct rmi_driver_data *data;
> -
> - rmi_dev = to_rmi_device(dev);
> - data = dev_get_drvdata(&rmi_dev->dev);
> -
> - /* need to convert the string data to an actual value */
> - retval = strict_strtoul(buf, 10, &val);
> - if (retval < 0 || val > 255) {
> - dev_err(dev, "Invalid value '%s' written to BSR.\n", buf);
> - return -EINVAL;
> - }
> -
> - retval = rmi_write(rmi_dev, BSR_LOCATION, (u8)val);
> - if (retval < 0) {
> - dev_err(dev, "%s : failed to write bsr %lu to %#06x\n",
> - __func__, val, BSR_LOCATION);
> - return retval;
> - }
> -
> - data->bsr = val;
> -
> - return count;
> -}
> -
> -static DEVICE_ATTR(bsr, RMI_RW_ATTR, rmi_driver_bsr_show, rmi_driver_bsr_store);
> -
> -static ssize_t rmi_driver_enabled_show(struct device *dev,
> - struct device_attribute *attr, char *buf)
> -{
> - struct rmi_device *rmi_dev = to_rmi_device(dev);
> - struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev);
> -
> - return snprintf(buf, PAGE_SIZE, "%u\n", data->enabled);
> -}
> -
> -static ssize_t rmi_driver_enabled_store(struct device *dev,
> - struct device_attribute *attr,
> - const char *buf, size_t count)
> -{
> - struct rmi_device *rmi_dev = to_rmi_device(dev);
> - int retval;
> - int new_value;
> -
> - if (sysfs_streq(buf, "0"))
> - new_value = false;
> - else if (sysfs_streq(buf, "1"))
> - new_value = true;
> - else
> - return -EINVAL;
> -
> - if (new_value) {
> - retval = enable_sensor(rmi_dev);
> - if (retval) {
> - dev_err(dev, "Failed to enable sensor, code=%d.\n",
> - retval);
> - return -EIO;
> - }
> - } else {
> - disable_sensor(rmi_dev);
> - }
> -
> - return count;
> -}
> -
> -/** This sysfs attribute is deprecated, and will be removed in a future release.
> - */
> -static DEVICE_ATTR(enabled, RMI_RW_ATTR,
> - rmi_driver_enabled_show, rmi_driver_enabled_store);
> -
> -static umode_t rmi_driver_attr_visible(struct kobject *kobj,
> - struct attribute *attr, int n)
> -{
> - struct device *dev = kobj_to_dev(kobj);
> - struct rmi_device *rmi_dev = to_rmi_device(dev);
> - struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev);
> - umode_t mode = attr->mode;
> -
> - if (attr == &dev_attr_bsr.attr) {
> - if (!data->pdt_props.has_bsr)
> - mode = 0;
> - }
> -
> - return mode;
> -}
> -
> -static struct attribute *rmi_driver_attrs[] = {
> - &dev_attr_bsr.attr,
> - &dev_attr_enabled.attr,
> - NULL
> -};
> -
> -static struct attribute_group rmi_driver_attr_group = {
> - .is_visible = rmi_driver_attr_visible,
> - .attrs = rmi_driver_attrs,
> -};
> -
> static void rmi_free_function_list(struct rmi_device *rmi_dev)
> {
> struct rmi_function *fn, *tmp;
> @@ -718,7 +561,8 @@ static int reset_and_reflash(struct rmi_device *rmi_dev)
> bool has_f01 = false;
> int i;
> int retval;
> - const struct rmi_device_platform_data *pdata = to_rmi_platform_data(rmi_dev);
> + const struct rmi_device_platform_data *pdata =
> + to_rmi_platform_data(rmi_dev);
>
> dev_dbg(dev, "Initial reset.\n");
>
> @@ -941,7 +785,6 @@ static int rmi_driver_remove(struct device *dev)
> struct rmi_device *rmi_dev = to_rmi_device(dev);
>
> rmi_driver_teardown_debugfs(rmi_dev);
> - sysfs_remove_group(&dev->kobj, &rmi_driver_attr_group);
>
> disable_sensor(rmi_dev);
> rmi_free_function_list(rmi_dev);
> @@ -1079,14 +922,6 @@ static int rmi_driver_probe(struct device *dev)
> mutex_init(&data->suspend_mutex);
> }
>
> - retval = sysfs_create_group(&dev->kobj, &rmi_driver_attr_group);
> - if (retval < 0) {
> - dev_err(dev, "%s: Failed to create sysfs group\n", __func__);
> - goto err_free_data;
> - }
> -
> - rmi_driver_setup_debugfs(rmi_dev);
> -
> if (pdata->attn_gpio) {
> data->irq = gpio_to_irq(pdata->attn_gpio);
> if (pdata->level_triggered) {
> diff --git a/drivers/input/rmi4/rmi_f01.c b/drivers/input/rmi4/rmi_f01.c
> index fe26869..840a8d0 100644
> --- a/drivers/input/rmi4/rmi_f01.c
> +++ b/drivers/input/rmi4/rmi_f01.c
> @@ -8,7 +8,6 @@
> */
>
> #include <linux/kernel.h>
> -#include <linux/debugfs.h>
> #include <linux/kconfig.h>
> #include <linux/rmi.h>
> #include <linux/slab.h>
> @@ -143,780 +142,6 @@ struct f01_data {
> bool suspended;
> bool old_nosleep;
> #endif
> -
> -#ifdef CONFIG_RMI4_DEBUG
> - struct dentry *debugfs_interrupt_enable;
> -#endif
> -};
> -
> -#ifdef CONFIG_RMI4_DEBUG
> -struct f01_debugfs_data {
> - bool done;
> - struct rmi_function *fn;
> -};
> -
> -static int f01_debug_open(struct inode *inodep, struct file *filp)
> -{
> - struct f01_debugfs_data *data;
> - struct rmi_function *fn = inodep->i_private;
> -
> - data = kzalloc(sizeof(struct f01_debugfs_data), GFP_KERNEL);
> - if (!data)
> - return -ENOMEM;
> -
> - data->fn = fn;
> - filp->private_data = data;
> - return 0;
> -}
> -
> -static int f01_debug_release(struct inode *inodep, struct file *filp)
> -{
> - kfree(filp->private_data);
> - return 0;
> -}
> -
> -static ssize_t interrupt_enable_read(struct file *filp, char __user *buffer,
> - size_t size, loff_t *offset) {
> - int i;
> - int len;
> - int total_len = 0;
> - char local_buf[size]; // FIXME!!!! XXX arbitrary size array on stack
> - char *current_buf = local_buf;
> - struct f01_debugfs_data *data = filp->private_data;
> - struct f01_data *f01 = data->fn->data;
> -
> - if (data->done)
> - return 0;
> -
> - data->done = 1;
> -
> - /* loop through each irq value and copy its
> - * string representation into buf */
> - for (i = 0; i < f01->irq_count; i++) {
> - int irq_reg;
> - int irq_shift;
> - int interrupt_enable;
> -
> - irq_reg = i / 8;
> - irq_shift = i % 8;
> - interrupt_enable =
> - ((f01->device_control.interrupt_enable[irq_reg]
> - >> irq_shift) & 0x01);
> -
> - /* get next irq value and write it to buf */
> - len = snprintf(current_buf, size - total_len,
> - "%u ", interrupt_enable);
> - /* bump up ptr to next location in buf if the
> - * snprintf was valid. Otherwise issue an error
> - * and return. */
> - if (len > 0) {
> - current_buf += len;
> - total_len += len;
> - } else {
> - dev_err(&data->fn->dev, "Failed to build interrupt_enable buffer, code = %d.\n",
> - len);
> - return snprintf(local_buf, size, "unknown\n");
> - }
> - }
> - len = snprintf(current_buf, size - total_len, "\n");
> - if (len > 0)
> - total_len += len;
> - else
> - dev_warn(&data->fn->dev, "%s: Failed to append carriage return.\n",
> - __func__);
> -
> - if (copy_to_user(buffer, local_buf, total_len))
> - return -EFAULT;
> -
> - return total_len;
> -}
> -
> -static ssize_t interrupt_enable_write(struct file *filp,
> - const char __user *buffer, size_t size, loff_t *offset) {
> - int retval;
> - char buf[size];
> - char *local_buf = buf;
> - int i;
> - int irq_count = 0;
> - int irq_reg = 0;
> - struct f01_debugfs_data *data = filp->private_data;
> - struct f01_data *f01 = data->fn->data;
> -
> - retval = copy_from_user(buf, buffer, size);
> - if (retval)
> - return -EFAULT;
> -
> - for (i = 0; i < f01->irq_count && *local_buf != 0;
> - i++, local_buf += 2) {
> - int irq_shift;
> - int interrupt_enable;
> - int result;
> -
> - irq_reg = i / 8;
> - irq_shift = i % 8;
> -
> - /* get next interrupt mapping value and store and bump up to
> - * point to next item in local_buf */
> - result = sscanf(local_buf, "%u", &interrupt_enable);
> - if ((result != 1) ||
> - (interrupt_enable != 0 && interrupt_enable != 1)) {
> - dev_err(&data->fn->dev, "Interrupt enable[%d] is not a valid value 0x%x.\n",
> - i, interrupt_enable);
> - return -EINVAL;
> - }
> - if (interrupt_enable == 0) {
> - f01->device_control.interrupt_enable[irq_reg] &=
> - (1 << irq_shift) ^ 0xFF;
> - } else
> - f01->device_control.interrupt_enable[irq_reg] |=
> - (1 << irq_shift);
> - irq_count++;
> - }
> -
> - /* Make sure the irq count matches */
> - if (irq_count != f01->irq_count) {
> - dev_err(&data->fn->dev, "Interrupt enable count of %d doesn't match device count of %d.\n",
> - irq_count, f01->irq_count);
> - return -EINVAL;
> - }
> -
> - /* write back to the control register */
> - retval = rmi_write_block(data->fn->rmi_dev, f01->interrupt_enable_addr,
> - f01->device_control.interrupt_enable,
> - f01->num_of_irq_regs);
> - if (retval < 0) {
> - dev_err(&data->fn->dev, "Could not write interrupt_enable mask to %#06x\n",
> - f01->interrupt_enable_addr);
> - return retval;
> - }
> -
> - return size;
> -}
> -
> -static const struct file_operations interrupt_enable_fops = {
> - .owner = THIS_MODULE,
> - .open = f01_debug_open,
> - .release = f01_debug_release,
> - .read = interrupt_enable_read,
> - .write = interrupt_enable_write,
> -};
> -
> -static int setup_debugfs(struct rmi_function *fn)
> -{
> - struct f01_data *data = fn->data;
> -
> - if (!fn->debugfs_root)
> - return -ENODEV;
> -
> - data->debugfs_interrupt_enable = debugfs_create_file("interrupt_enable",
> - RMI_RW_ATTR, fn->debugfs_root, fn, &interrupt_enable_fops);
> - if (!data->debugfs_interrupt_enable)
> - dev_warn(&fn->dev,
> - "Failed to create debugfs interrupt_enable.\n");
> -
> - return 0;
> -}
> -
> -static void teardown_debugfs(struct f01_data *f01)
> -{
> - if (f01->debugfs_interrupt_enable)
> - debugfs_remove(f01->debugfs_interrupt_enable);
> -}
> -
> -#else
> -
> -static inline int setup_debugfs(struct rmi_function *fn)
> -{
> - return 0;
> -}
> -
> -static inline void teardown_debugfs(struct f01_data *f01)
> -{
> -}
> -
> -#endif
> -
> -static ssize_t rmi_fn_01_productinfo_show(struct device *dev,
> - struct device_attribute *attr,
> - char *buf)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> -
> - return snprintf(buf, PAGE_SIZE, "0x%04x\n",
> - data->properties.productinfo);
> -}
> -
> -static ssize_t rmi_fn_01_productid_show(struct device *dev,
> - struct device_attribute *attr,
> - char *buf)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> -
> - return snprintf(buf, PAGE_SIZE, "%s\n", data->properties.product_id);
> -}
> -
> -static ssize_t rmi_fn_01_manufacturer_show(struct device *dev,
> - struct device_attribute *attr,
> - char *buf)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> -
> - return snprintf(buf, PAGE_SIZE, "0x%02x\n",
> - data->properties.manufacturer_id);
> -}
> -
> -static ssize_t rmi_fn_01_datecode_show(struct device *dev,
> - struct device_attribute *attr,
> - char *buf)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> -
> - return snprintf(buf, PAGE_SIZE, "%s\n", data->properties.dom);
> -}
> -
> -static ssize_t rmi_fn_01_reset_store(struct device *dev,
> - struct device_attribute *attr,
> - const char *buf, size_t count)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - unsigned int reset;
> - int error;
> -
> - if (sscanf(buf, "%u", &reset) != 1)
> - return -EINVAL;
> - if (reset < 0 || reset > 1)
> - return -EINVAL;
> -
> - /* Per spec, 0 has no effect, so we skip it entirely. */
> - if (reset) {
> - /* Command register always reads as 0, so just use a local. */
> - u8 command = RMI_F01_CMD_DEVICE_RESET;
> -
> - error = rmi_write_block(fn->rmi_dev, fn->fd.command_base_addr,
> - &command, sizeof(command));
> - if (error < 0) {
> - dev_err(dev, "Failed to issue reset command, code = %d.",
> - error);
> - return error;
> - }
> - }
> -
> - return count;
> -}
> -
> -static ssize_t rmi_fn_01_sleepmode_show(struct device *dev,
> - struct device_attribute *attr,
> - char *buf)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> - unsigned int value = data->device_control.ctrl0 &
> - RMI_F01_CTRL0_SLEEP_MODE_MASK;
> -
> - return snprintf(buf, PAGE_SIZE, "%d\n", value);
> -}
> -
> -static ssize_t rmi_fn_01_sleepmode_store(struct device *dev,
> - struct device_attribute *attr,
> - const char *buf, size_t count)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> - unsigned long new_value;
> - int retval;
> -
> - retval = strict_strtoul(buf, 10, &new_value);
> - if (retval < 0 || !RMI_IS_VALID_SLEEPMODE(new_value)) {
> - dev_err(dev, "%s: Invalid sleep mode %s.", __func__, buf);
> - return -EINVAL;
> - }
> -
> - retval = mutex_lock_interruptible(&data->control_mutex);
> - if (retval)
> - return retval;
> -
> - dev_dbg(dev, "Setting sleep mode to %ld.", new_value);
> -
> - data->device_control.ctrl0 &= ~RMI_F01_CTRL0_SLEEP_MODE_MASK;
> - data->device_control.ctrl0 |= new_value;
> -
> - retval = rmi_write_block(fn->rmi_dev, fn->fd.control_base_addr,
> - &data->device_control.ctrl0,
> - sizeof(data->device_control.ctrl0));
> - if (retval >= 0)
> - retval = count;
> - else
> - dev_err(dev, "Failed to write sleep mode, code %d.\n", retval);
> -
> - mutex_unlock(&data->control_mutex);
> - return retval;
> -}
> -
> -static ssize_t rmi_fn_01_nosleep_show(struct device *dev,
> - struct device_attribute *attr, char *buf)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> - unsigned int value = !!(data->device_control.ctrl0 &
> - RMI_F01_CRTL0_NOSLEEP_BIT);
> -
> - return snprintf(buf, PAGE_SIZE, "%d\n", value);
> -}
> -
> -static ssize_t rmi_fn_01_nosleep_store(struct device *dev,
> - struct device_attribute *attr,
> - const char *buf, size_t count)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> - unsigned long new_value;
> - int retval;
> -
> - retval = strict_strtoul(buf, 10, &new_value);
> - if (retval < 0 || new_value > 1) {
> - dev_err(dev, "%s: Invalid nosleep bit %s.", __func__, buf);
> - return -EINVAL;
> - }
> -
> - retval = mutex_lock_interruptible(&data->control_mutex);
> - if (retval)
> - return retval;
> -
> - if (new_value)
> - data->device_control.ctrl0 |= RMI_F01_CRTL0_NOSLEEP_BIT;
> - else
> - data->device_control.ctrl0 &= ~RMI_F01_CRTL0_NOSLEEP_BIT;
> -
> - retval = rmi_write_block(fn->rmi_dev, fn->fd.control_base_addr,
> - &data->device_control.ctrl0,
> - sizeof(data->device_control.ctrl0));
> - if (retval >= 0)
> - retval = count;
> - else
> - dev_err(dev, "Failed to write nosleep bit.\n");
> -
> - mutex_unlock(&data->control_mutex);
> - return retval;
> -}
> -
> -static ssize_t rmi_fn_01_chargerinput_show(struct device *dev,
> - struct device_attribute *attr, char *buf)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> - unsigned int value = !!(data->device_control.ctrl0 &
> - RMI_F01_CRTL0_CHARGER_BIT);
> -
> - return snprintf(buf, PAGE_SIZE, "%d\n", value);
> -}
> -
> -static ssize_t rmi_fn_01_chargerinput_store(struct device *dev,
> - struct device_attribute *attr,
> - const char *buf, size_t count)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> - unsigned long new_value;
> - int retval;
> -
> - retval = strict_strtoul(buf, 10, &new_value);
> - if (retval < 0 || new_value > 1) {
> - dev_err(dev, "%s: Invalid chargerinput bit %s.", __func__, buf);
> - return -EINVAL;
> - }
> -
> - retval = mutex_lock_interruptible(&data->control_mutex);
> - if (retval)
> - return retval;
> -
> - if (new_value)
> - data->device_control.ctrl0 |= RMI_F01_CRTL0_CHARGER_BIT;
> - else
> - data->device_control.ctrl0 &= ~RMI_F01_CRTL0_CHARGER_BIT;
> -
> - retval = rmi_write_block(fn->rmi_dev, fn->fd.control_base_addr,
> - &data->device_control.ctrl0,
> - sizeof(data->device_control.ctrl0));
> - if (retval >= 0)
> - retval = count;
> - else
> - dev_err(dev, "Failed to write chargerinput bit.\n");
> -
> - mutex_unlock(&data->control_mutex);
> - return retval;
> -}
> -
> -static ssize_t rmi_fn_01_reportrate_show(struct device *dev,
> - struct device_attribute *attr, char *buf)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> - int value = !!(data->device_control.ctrl0 &
> - RMI_F01_CRTL0_REPORTRATE_BIT);
> -
> - return snprintf(buf, PAGE_SIZE, "%d\n", value);
> -}
> -
> -static ssize_t rmi_fn_01_reportrate_store(struct device *dev,
> - struct device_attribute *attr,
> - const char *buf, size_t count)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> - unsigned long new_value;
> - int retval;
> -
> - retval = strict_strtoul(buf, 10, &new_value);
> - if (retval < 0 || new_value > 1) {
> - dev_err(dev, "%s: Invalid reportrate bit %s.", __func__, buf);
> - return -EINVAL;
> - }
> -
> - retval = mutex_lock_interruptible(&data->control_mutex);
> - if (retval)
> - return retval;
> -
> - if (new_value)
> - data->device_control.ctrl0 |= RMI_F01_CRTL0_REPORTRATE_BIT;
> - else
> - data->device_control.ctrl0 &= ~RMI_F01_CRTL0_REPORTRATE_BIT;
> -
> - retval = rmi_write_block(fn->rmi_dev, fn->fd.control_base_addr,
> - &data->device_control.ctrl0,
> - sizeof(data->device_control.ctrl0));
> - if (retval >= 0)
> - retval = count;
> - else
> - dev_err(dev, "Failed to write reportrate bit.\n");
> -
> - mutex_unlock(&data->control_mutex);
> - return retval;
> -}
> -
> -static ssize_t rmi_fn_01_interrupt_enable_show(struct device *dev,
> - struct device_attribute *attr, char *buf)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> - int i, len, total_len = 0;
> - char *current_buf = buf;
> -
> - /* loop through each irq value and copy its
> - * string representation into buf */
> - for (i = 0; i < data->irq_count; i++) {
> - int irq_reg;
> - int irq_shift;
> - int interrupt_enable;
> -
> - irq_reg = i / 8;
> - irq_shift = i % 8;
> - interrupt_enable =
> - ((data->device_control.interrupt_enable[irq_reg]
> - >> irq_shift) & 0x01);
> -
> - /* get next irq value and write it to buf */
> - len = snprintf(current_buf, PAGE_SIZE - total_len,
> - "%u ", interrupt_enable);
> - /* bump up ptr to next location in buf if the
> - * snprintf was valid. Otherwise issue an error
> - * and return. */
> - if (len > 0) {
> - current_buf += len;
> - total_len += len;
> - } else {
> - dev_err(dev, "Failed to build interrupt_enable buffer, code = %d.\n",
> - len);
> - return snprintf(buf, PAGE_SIZE, "unknown\n");
> - }
> - }
> - len = snprintf(current_buf, PAGE_SIZE - total_len, "\n");
> - if (len > 0)
> - total_len += len;
> - else
> - dev_warn(dev, "%s: Failed to append carriage return.\n",
> - __func__);
> - return total_len;
> -
> -}
> -
> -static ssize_t rmi_fn_01_doze_interval_show(struct device *dev,
> - struct device_attribute *attr, char *buf)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> -
> - return snprintf(buf, PAGE_SIZE, "%d\n",
> - data->device_control.doze_interval);
> -
> -}
> -
> -static ssize_t rmi_fn_01_doze_interval_store(struct device *dev,
> - struct device_attribute *attr,
> - const char *buf, size_t count)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> - unsigned long new_value;
> - int retval;
> - u16 ctrl_base_addr;
> -
> - retval = strict_strtoul(buf, 10, &new_value);
> - if (retval < 0 || new_value > 255) {
> - dev_err(dev, "%s: Invalid doze interval %s.", __func__, buf);
> - return -EINVAL;
> - }
> -
> - retval = mutex_lock_interruptible(&data->control_mutex);
> - if (retval)
> - return retval;
> -
> - data->device_control.doze_interval = new_value;
> - ctrl_base_addr = fn->fd.control_base_addr + sizeof(u8) +
> - (sizeof(u8)*(data->num_of_irq_regs));
> - dev_dbg(dev, "doze_interval store address %x, value %d",
> - ctrl_base_addr, data->device_control.doze_interval);
> -
> - retval = rmi_write_block(fn->rmi_dev, data->doze_interval_addr,
> - &data->device_control.doze_interval,
> - sizeof(u8));
> - if (retval >= 0)
> - retval = count;
> - else
> - dev_err(dev, "Failed to write doze interval.\n");
> -
> - mutex_unlock(&data->control_mutex);
> - return retval;
> -}
> -
> -static ssize_t rmi_fn_01_wakeup_threshold_show(struct device *dev,
> - struct device_attribute *attr,
> - char *buf)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> -
> - return snprintf(buf, PAGE_SIZE, "%d\n",
> - data->device_control.wakeup_threshold);
> -}
> -
> -static ssize_t rmi_fn_01_wakeup_threshold_store(struct device *dev,
> - struct device_attribute *attr,
> - const char *buf, size_t count)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> - unsigned long new_value;
> - int retval;
> -
> - retval = strict_strtoul(buf, 10, &new_value);
> - if (retval < 0 || new_value > 255) {
> - dev_err(dev, "%s: Invalid wakeup threshold %s.", __func__, buf);
> - return -EINVAL;
> - }
> -
> - retval = mutex_lock_interruptible(&data->control_mutex);
> - if (retval)
> - return retval;
> -
> - data->device_control.doze_interval = new_value;
> - retval = rmi_write_block(fn->rmi_dev, data->wakeup_threshold_addr,
> - &data->device_control.wakeup_threshold,
> - sizeof(u8));
> - if (retval >= 0)
> - retval = count;
> - else
> - dev_err(dev, "Failed to write wakeup threshold.\n");
> -
> - mutex_unlock(&data->control_mutex);
> - return retval;
> -}
> -
> -static ssize_t rmi_fn_01_doze_holdoff_show(struct device *dev,
> - struct device_attribute *attr,
> - char *buf)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> -
> - return snprintf(buf, PAGE_SIZE, "%d\n",
> - data->device_control.doze_holdoff);
> -
> -}
> -
> -static ssize_t rmi_fn_01_doze_holdoff_store(struct device *dev,
> - struct device_attribute *attr,
> - const char *buf, size_t count)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> - unsigned long new_value;
> - int retval;
> -
> - retval = strict_strtoul(buf, 10, &new_value);
> - if (retval < 0 || new_value > 255) {
> - dev_err(dev, "%s: Invalid doze holdoff %s.", __func__, buf);
> - return -EINVAL;
> - }
> -
> - retval = mutex_lock_interruptible(&data->control_mutex);
> - if (retval)
> - return retval;
> -
> - data->device_control.doze_interval = new_value;
> - retval = rmi_write_block(fn->rmi_dev, data->doze_holdoff_addr,
> - &data->device_control.doze_holdoff,
> - sizeof(u8));
> - if (retval >= 0)
> - retval = count;
> - else
> - dev_err(dev, "Failed to write doze holdoff.\n");
> -
> - mutex_unlock(&data->control_mutex);
> - return retval;
> -}
> -
> -static ssize_t rmi_fn_01_configured_show(struct device *dev,
> - struct device_attribute *attr, char *buf)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> - unsigned int value = !!(data->device_control.ctrl0 &
> - RMI_F01_CRTL0_CONFIGURED_BIT);
> -
> - return snprintf(buf, PAGE_SIZE, "%d\n", value);
> -}
> -
> -static ssize_t rmi_fn_01_unconfigured_show(struct device *dev,
> - struct device_attribute *attr, char *buf)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> -
> - return snprintf(buf, PAGE_SIZE, "%d\n",
> - RMI_F01_STATUS_UNCONFIGURED(data->device_status));
> -}
> -
> -static ssize_t rmi_fn_01_flashprog_show(struct device *dev,
> - struct device_attribute *attr, char *buf)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> -
> - return snprintf(buf, PAGE_SIZE, "%d\n",
> - RMI_F01_STATUS_BOOTLOADER(data->device_status));
> -}
> -
> -static ssize_t rmi_fn_01_statuscode_show(struct device *dev,
> - struct device_attribute *attr, char *buf)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> -
> - return snprintf(buf, PAGE_SIZE, "0x%02x\n",
> - RMI_F01_STATUS_CODE(data->device_status));
> -}
> -
> -#define RMI_F01_ATTR(_name) \
> - DEVICE_ATTR(_name, RMI_RW_ATTR, \
> - rmi_fn_01_##_name##_show, \
> - rmi_fn_01_##_name##_store)
> -
> -#define RMI_F01_RO_ATTR(_name) \
> - DEVICE_ATTR(_name, RMI_RO_ATTR, \
> - rmi_fn_01_##_name##_show, \
> - NULL)
> -
> -#define RMI_F01_WO_ATTR(_name) \
> - DEVICE_ATTR(_name, RMI_RO_ATTR, \
> - NULL, \
> - rmi_fn_01_##_name##_store)
> -
> -
> -static RMI_F01_RO_ATTR(productinfo);
> -static RMI_F01_RO_ATTR(productid);
> -static RMI_F01_RO_ATTR(manufacturer);
> -static RMI_F01_RO_ATTR(datecode);
> -
> -/* Control register access */
> -static RMI_F01_ATTR(sleepmode);
> -static RMI_F01_ATTR(nosleep);
> -static RMI_F01_ATTR(chargerinput);
> -static RMI_F01_ATTR(reportrate);
> -
> -/*
> - * We don't want arbitrary callers changing the interrupt enable mask,
> - * so it's read only.
> - */
> -static RMI_F01_RO_ATTR(interrupt_enable);
> -static RMI_F01_ATTR(doze_interval);
> -static RMI_F01_ATTR(wakeup_threshold);
> -static RMI_F01_ATTR(doze_holdoff);
> -
> -/*
> - * We make 'configured' RO, since the driver uses that to look for
> - * resets. We don't want someone faking us out by changing that
> - * bit.
> - */
> -static RMI_F01_RO_ATTR(configured);
> -
> -/* Command register access. */
> -static RMI_F01_WO_ATTR(reset);
> -
> -/* Status register access. */
> -static RMI_F01_RO_ATTR(unconfigured);
> -static RMI_F01_RO_ATTR(flashprog);
> -static RMI_F01_RO_ATTR(statuscode);
> -
> -static struct attribute *rmi_fn_01_attrs[] = {
> - &dev_attr_productinfo.attr,
> - &dev_attr_productid.attr,
> - &dev_attr_manufacturer.attr,
> - &dev_attr_datecode.attr,
> - &dev_attr_sleepmode.attr,
> - &dev_attr_nosleep.attr,
> - &dev_attr_chargerinput.attr,
> - &dev_attr_reportrate.attr,
> - &dev_attr_interrupt_enable.attr,
> - &dev_attr_doze_interval.attr,
> - &dev_attr_wakeup_threshold.attr,
> - &dev_attr_doze_holdoff.attr,
> - &dev_attr_configured.attr,
> - &dev_attr_reset.attr,
> - &dev_attr_unconfigured.attr,
> - &dev_attr_flashprog.attr,
> - &dev_attr_statuscode.attr,
> - NULL
> -};
> -
> -static umode_t rmi_fn_01_attr_visible(struct kobject *kobj,
> - struct attribute *attr, int n)
> -{
> - struct device *dev = kobj_to_dev(kobj);
> - struct rmi_function *fn = to_rmi_function(dev);
> - struct f01_data *data = fn->data;
> - umode_t mode = attr->mode;
> -
> - if (attr == &dev_attr_doze_interval.attr) {
> - if (!data->properties.has_lts)
> - mode = 0;
> - } else if (attr == &dev_attr_wakeup_threshold.attr) {
> - if (!data->properties.has_adjustable_doze)
> - mode = 0;
> - } else if (attr == &dev_attr_doze_holdoff.attr) {
> - if (!data->properties.has_adjustable_doze_holdoff)
> - mode = 0;
> - }
> -
> - return mode;
> -}
> -
> -static struct attribute_group rmi_fn_01_attr_group = {
> - .is_visible = rmi_fn_01_attr_visible,
> - .attrs = rmi_fn_01_attrs,
> };
>
> static int rmi_f01_alloc_memory(struct rmi_function *fn,
> @@ -1148,11 +373,6 @@ static int rmi_f01_initialize(struct rmi_function *fn)
> goto error_exit;
> }
>
> - error = setup_debugfs(fn);
> - if (error)
> - dev_warn(&fn->dev, "Failed to setup debugfs, error: %d.\n",
> - error);
> -
> return 0;
>
> error_exit:
> @@ -1228,17 +448,12 @@ static int rmi_f01_probe(struct rmi_function *fn)
> if (error)
> return error;
>
> - error = sysfs_create_group(&fn->dev.kobj, &rmi_fn_01_attr_group);
> - if (error)
> - return error;
> -
> return 0;
> }
>
> static void rmi_f01_remove(struct rmi_function *fn)
> {
> - teardown_debugfs(fn->data);
> - sysfs_remove_group(&fn->dev.kobj, &rmi_fn_01_attr_group);
> + /* Placeholder for now. */
> }
>
> #ifdef CONFIG_PM_SLEEP
> diff --git a/drivers/input/rmi4/rmi_f11.c b/drivers/input/rmi4/rmi_f11.c
> index 017c8ff..8984054 100644
> --- a/drivers/input/rmi4/rmi_f11.c
> +++ b/drivers/input/rmi4/rmi_f11.c
> @@ -10,7 +10,6 @@
> #define FUNCTION_DATA f11_data
>
> #include <linux/kernel.h>
> -#include <linux/debugfs.h>
> #include <linux/delay.h>
> #include <linux/device.h>
> #include <linux/input.h>
> @@ -822,177 +821,6 @@ enum finger_state_values {
> F11_RESERVED = 0x03
> };
>
> -static ssize_t rmi_f11_rezero_store(struct device *dev,
> - struct device_attribute *attr,
> - const char *buf, size_t count)
> -{
> - struct rmi_function *fn = to_rmi_function(dev);
> - unsigned int rezero;
> - int error;
> -
> - error = kstrtouint(buf, 0, &rezero);
> - if (error)
> - return error;
> -
> - if (rezero > 1)
> - return -ERANGE;
> -
> - /* Per spec, 0 has no effect, so we skip it entirely. */
> - if (rezero) {
> - /* Command register always reads as 0, so just use a local. */
> - struct f11_2d_commands commands = {
> - .rezero = true,
> - };
> -
> - error = rmi_write_block(fn->rmi_dev, fn->fd.command_base_addr,
> - &commands, sizeof(commands));
> - if (error < 0) {
> - dev_err(dev,
> - "%s: failed to issue rezero command, error = %d.",
> - __func__, error);
> - return error;
> - }
> - }
> -
> - return count;
> -}
> -
> -static DEVICE_ATTR(rezero, RMI_WO_ATTR, NULL, rmi_f11_rezero_store);
> -
> -static struct attribute *rmi_f11_attrs[] = {
> - &dev_attr_rezero.attr,
> - NULL
> -};
> -
> -static struct attribute_group rmi_f11_attr_group = {
> - .attrs = rmi_f11_attrs,
> -};
> -
> -#ifdef CONFIG_RMI4_DEBUG
> -static void rmi_f11_setup_sensor_debugfs(struct f11_2d_sensor *sensor)
> -{
> - struct rmi_function *fn = sensor->fn;
> - struct dentry *sensor_root;
> - char dirname[sizeof("sensorNNN")];
> -
> - if (!fn->debugfs_root)
> - return;
> -
> - snprintf(dirname, sizeof(dirname), "input%3u", sensor->sensor_index);
> - sensor_root = debugfs_create_dir(dirname, fn->debugfs_root);
> - if (!sensor_root) {
> - dev_warn(&fn->dev,
> - "Failed to create debugfs directory %s for sensor %d\n",
> - dirname, sensor->sensor_index);
> - return;
> - }
> -
> - if (!debugfs_create_bool("type_a", RMI_RW_ATTR, sensor_root,
> - &sensor->type_a))
> - dev_warn(&fn->dev,
> - "Failed to create debugfs type_a for sensor %d.\n",
> - sensor->sensor_index);
> -
> - if (!debugfs_create_u16("max_x", RMI_RW_ATTR, sensor_root,
> - &sensor->max_x))
> - dev_warn(&fn->dev,
> - "Failed to create debugfs max_x for sensor %d.\n",
> - sensor->sensor_index);
> -
> - if (!debugfs_create_u16("max_xy", RMI_RW_ATTR, sensor_root,
> - &sensor->max_y))
> - dev_warn(&fn->dev,
> - "Failed to create debugfs max_y for sensor %d.\n",
> - sensor->sensor_index);
> -
> - if (!debugfs_create_bool("flip_x", RMI_RW_ATTR, sensor_root,
> - &sensor->axis_align.flip_x))
> - dev_warn(&fn->dev,
> - "Failed to create debugfs flip_x for sensor %d.\n",
> - sensor->sensor_index);
> -
> - if (!debugfs_create_bool("flip_y", RMI_RW_ATTR, sensor_root,
> - &sensor->axis_align.flip_y))
> - dev_warn(&fn->dev,
> - "Failed to create debugfs flip_y for sensor %d.\n",
> - sensor->sensor_index);
> -
> - if (!debugfs_create_u16("clip_x_low", RMI_RW_ATTR, sensor_root,
> - &sensor->axis_align.clip_x_low))
> - dev_warn(&fn->dev,
> - "Failed to create debugfs clip_x_low for sensor %d.\n",
> - sensor->sensor_index);
> -
> - if (!debugfs_create_u16("clip_x_high", RMI_RW_ATTR, sensor_root,
> - &sensor->axis_align.clip_x_high))
> - dev_warn(&fn->dev,
> - "Failed to create debugfs clip_x_high for sensor %d.\n",
> - sensor->sensor_index);
> -
> - if (!debugfs_create_u16("clip_y_low", RMI_RW_ATTR, sensor_root,
> - &sensor->axis_align.clip_y_low))
> - dev_warn(&fn->dev,
> - "Failed to create debugfs clip_y_low for sensor %d.\n",
> - sensor->sensor_index);
> -
> - if (!debugfs_create_u16("clip_y_high", RMI_RW_ATTR, sensor_root,
> - &sensor->axis_align.clip_y_high))
> - dev_warn(&fn->dev,
> - "Failed to create debugfs clip_y_high for sensor %d.\n",
> - sensor->sensor_index);
> -
> - if (!debugfs_create_u8("delta_x_threshold", RMI_RW_ATTR, sensor_root,
> - &sensor->axis_align.delta_x_threshold))
> - dev_warn(&fn->dev,
> - "Failed to create debugfs delta_x_threshold for sensor %d.\n",
> - sensor->sensor_index);
> -
> - if (!debugfs_create_u8("delta_y_threshold", RMI_RW_ATTR, sensor_root,
> - &sensor->axis_align.delta_y_threshold))
> - dev_warn(&fn->dev,
> - "Failed to create debugfs delta_y_threshold for sensor %d.\n",
> - sensor->sensor_index);
> -
> - if (!debugfs_create_u16("offset_x", RMI_RW_ATTR, sensor_root,
> - &sensor->axis_align.offset_x))
> - dev_warn(&fn->dev,
> - "Failed to create debugfs offset_x for sensor %d.\n",
> - sensor->sensor_index);
> -
> - if (!debugfs_create_u16("offset_x", RMI_RW_ATTR, sensor_root,
> - &sensor->axis_align.offset_x))
> - dev_warn(&fn->dev,
> - "Failed to create debugfs offset_y for sensor %d.\n",
> - sensor->sensor_index);
> -
> - if (!debugfs_create_bool("swap", RMI_RW_ATTR, sensor_root,
> - &sensor->axis_align.swap_axes))
> - dev_warn(&fn->dev,
> - "Failed to create debugfs swap for sensor %d.\n",
> - sensor->sensor_index);
> -}
> -
> -static void rmi_f11_setup_debugfs(struct rmi_function *fn)
> -{
> - struct f11_data *f11 = fn->data;
> -
> - if (fn->debugfs_root)
> - if (!debugfs_create_u16("rezero_wait", RMI_RW_ATTR,
> - fn->debugfs_root,
> - &f11->rezero_wait_ms))
> - dev_warn(&fn->dev,
> - "Failed to create debugfs rezero_wait.\n");
> -}
> -#else
> -static inline void rmi_f11_setup_sensor_debugfs(struct f11_2d_sensor *sensor)
> -{
> -}
> -static inline void rmi_f11_setup_debugfs(struct rmi_function *fn)
> -{
> -}
> -#endif
> -/* End adding debugfs */
> -
> /** F11_INACCURATE state is overloaded to indicate pen present. */
> #define F11_PEN F11_INACCURATE
>
> @@ -1886,12 +1714,8 @@ static int rmi_f11_initialize(struct rmi_function *fn)
> dev_warn(&fn->dev, "Failed to write to delta_y_threshold %d. Code: %d.\n",
> i, rc);
> }
> -
> - rmi_f11_setup_sensor_debugfs(sensor);
> }
>
> - rmi_f11_setup_debugfs(fn);
> -
> mutex_init(&f11->dev_controls_mutex);
> return 0;
> }
> @@ -2112,18 +1936,11 @@ static int rmi_f11_probe(struct rmi_function *fn)
> if (error)
> return error;
>
> - error = sysfs_create_group(&fn->dev.kobj, &rmi_f11_attr_group);
> - if (error)
> - return error;
> -
> return 0;
> }
>
> static void rmi_f11_remove(struct rmi_function *fn)
> {
> - debugfs_remove_recursive(fn->debugfs_root);
> - sysfs_remove_group(&fn->dev.kobj, &rmi_f11_attr_group);
> -
> rmi_f11_free_devices(fn);
> }
>
> diff --git a/drivers/input/rmi4/rmi_i2c.c b/drivers/input/rmi4/rmi_i2c.c
> index f3bef04..62351c4 100644
> --- a/drivers/input/rmi4/rmi_i2c.c
> +++ b/drivers/input/rmi4/rmi_i2c.c
> @@ -8,7 +8,6 @@
> */
>
> #include <linux/kernel.h>
> -#include <linux/debugfs.h>
> #include <linux/delay.h>
> #include <linux/i2c.h>
> #include <linux/interrupt.h>
> @@ -61,8 +60,9 @@ static int setup_debugfs(struct rmi_device *rmi_dev, struct rmi_i2c_data *data)
> if (!rmi_dev->debugfs_root)
> return -ENODEV;
>
> - data->debugfs_comms = debugfs_create_bool("comms_debug", RMI_RW_ATTR,
> - rmi_dev->debugfs_root, &data->comms_debug);
> + data->debugfs_comms = debugfs_create_bool("comms_debug",
> + (S_IRUGO | S_IWUGO), rmi_dev->debugfs_root,
> + &data->comms_debug);
> if (!data->debugfs_comms || IS_ERR(data->debugfs_comms)) {
> dev_warn(&rmi_dev->dev,
> "Failed to create debugfs comms_debug.\n");
--
Dmitry
^ permalink raw reply
* Re: [PATCHv2] drivers/input/mouse: add support for newer elantech touchpads (released ca. August 2013);
From: Dmitry Torokhov @ 2013-12-05 20:41 UTC (permalink / raw)
To: Matt Walker; +Cc: backports, linux-input, linux-kernel
In-Reply-To: <CA+X2d=AHdivGF+s_uOC2ns5okoOdZHX1kEg4iuB32zUkBjsszg@mail.gmail.com>
On Wed, Dec 04, 2013 at 12:57:15PM -0500, Matt Walker wrote:
> From: Matt Walker <matt.g.d.walker@gmail.com>
>
> Added detection for newer Elantech touchpads, so that kernel doesn't
> fall-back to default PS/2 driver. Supports touchpads released after
> ~August 2013. Fixes bug:
> https://lists.launchpad.net/kernel-packages/msg18481.html
>
> Signed-off by: Matt Walker <matt.g.d.walker@gmail.com> on an Acer
> Aspire S7-392-6302
Applied, thank you.
>
> ----
>
> Thanks to Hauke for the reference on how to submit a patch properly.
> Thanks to Dmitry for correction to Signed-off line.
>
> Diff Output:
>
> --- linux-3.13-rc1/drivers/input/
> mouse/elantech.c.orig 2013-12-03
> 12:14:52.829173656 -0500
> +++ linux-3.13-rc1/drivers/input/mouse/elantech.c 2013-12-03
> 12:15:11.833173880 -0500
> @@ -1313,6 +1313,7 @@ static int elantech_set_properties(struc
> break;
> case 6:
> case 7:
> + case 8:
> etd->hw_version = 4;
> break;
> default:
--
Dmitry
^ permalink raw reply
* [PATCH] HID: hid-sensor-hub: Fix kernel warning and failure
From: Srinivas Pandruvada @ 2013-12-05 19:56 UTC (permalink / raw)
To: jkosina; +Cc: linux-input, Srinivas Pandruvada
Fix kernel warning and failure to register sensor hub devices with MFD.
Now many devices has in-built sensor hubs. So by default this HID hub,
is properly parsed and register individual sensors as platform device
using MFD framework. But if a second sensor hub is attached via USB,
which has same sensors, it will result in kernel warning and failure
to register MFD cell as the platform device sysfs file name will be
same as created by in-built sensor hubs. This patch uses MFD cell id
to genarate unique platform device name. In this way there will never
be duplicate sysfs file names.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
drivers/hid/hid-sensor-hub.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index a184e19..4cead68 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -22,6 +22,7 @@
#include <linux/slab.h>
#include <linux/mfd/core.h>
#include <linux/list.h>
+#include <linux/idr.h>
#include <linux/hid-sensor-ids.h>
#include <linux/hid-sensor-hub.h>
#include "hid-ids.h"
@@ -80,6 +81,8 @@ struct hid_sensor_hub_callbacks_list {
void *priv;
};
+static DEFINE_IDR(hid_sensor_hub_idr);
+
static struct hid_report *sensor_hub_report(int id, struct hid_device *hdev,
int dir)
{
@@ -512,6 +515,7 @@ static int sensor_hub_probe(struct hid_device *hdev,
struct hid_report_enum *report_enum;
struct hid_field *field;
int dev_cnt;
+ int cell_id;
sd = devm_kzalloc(&hdev->dev, sizeof(*sd), GFP_KERNEL);
if (!sd) {
@@ -565,6 +569,11 @@ static int sensor_hub_probe(struct hid_device *hdev,
field = report->field[0];
if (report->maxfield && field &&
field->physical) {
+ cell_id = idr_alloc(&hid_sensor_hub_idr,
+ NULL, 0, 0,
+ GFP_KERNEL);
+ if (cell_id < 0)
+ goto err_free_names;
name = kasprintf(GFP_KERNEL, "HID-SENSOR-%x",
field->physical);
if (name == NULL) {
@@ -573,6 +582,8 @@ static int sensor_hub_probe(struct hid_device *hdev,
goto err_free_names;
}
sd->hid_sensor_hub_client_devs[
+ sd->hid_sensor_client_cnt].id = cell_id;
+ sd->hid_sensor_hub_client_devs[
sd->hid_sensor_client_cnt].name = name;
sd->hid_sensor_hub_client_devs[
sd->hid_sensor_client_cnt].platform_data =
@@ -592,8 +603,11 @@ static int sensor_hub_probe(struct hid_device *hdev,
return ret;
err_free_names:
- for (i = 0; i < sd->hid_sensor_client_cnt ; ++i)
+ for (i = 0; i < sd->hid_sensor_client_cnt; ++i) {
kfree(sd->hid_sensor_hub_client_devs[i].name);
+ idr_remove(&hid_sensor_hub_idr,
+ sd->hid_sensor_hub_client_devs[i].id);
+ }
kfree(sd->hid_sensor_hub_client_devs);
err_stop_hw:
hid_hw_stop(hdev);
@@ -615,8 +629,11 @@ static void sensor_hub_remove(struct hid_device *hdev)
complete(&data->pending.ready);
spin_unlock_irqrestore(&data->lock, flags);
mfd_remove_devices(&hdev->dev);
- for (i = 0; i < data->hid_sensor_client_cnt ; ++i)
+ for (i = 0; i < data->hid_sensor_client_cnt; ++i) {
kfree(data->hid_sensor_hub_client_devs[i].name);
+ idr_remove(&hid_sensor_hub_idr,
+ data->hid_sensor_hub_client_devs[i].id);
+ }
kfree(data->hid_sensor_hub_client_devs);
hid_set_drvdata(hdev, NULL);
mutex_destroy(&data->mutex);
--
1.8.1.2
^ permalink raw reply related
* Re: 3.12.x looses serial mouse over hibernate + resume
From: Rafael J. Wysocki @ 2013-12-05 0:41 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Peter Hurley, linux-kernel, Greg KH, linux-input, linux-serial,
Shuah Khan, Manuel Krause
In-Reply-To: <20131204171626.GD8838@core.coreip.homeip.net>
On 12/4/2013 6:16 PM, Dmitry Torokhov wrote:
> On Mon, Dec 02, 2013 at 09:40:20PM +0100, Manuel Krause wrote:
>> On 2013-12-02 20:07, Dmitry Torokhov wrote:
>>> Thank you Manuel, but IO think the patch is not complete as we need to
>>> re-enable PNP devices after we make a snapshot to make sure they are
>>> working and can handle saving the data. Coudl you please try the patch
>>> below?
>>>
>> PNP: fix restoring devices after hibernation
>>
>> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>>
>> On returning from hibernation 'restore; callback is called, not
>> 'resume'.
>> This fixes breakage introduced by commit
>> eaf140b60ec961252083ab8adaf67aef29a362dd
>>
>> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>> ---
>> drivers/pnp/driver.c | 12 +++++++++++-
>> 1 file changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
>> index a39ee38..2bd5c5f 100644
>> --- a/drivers/pnp/driver.c
>> +++ b/drivers/pnp/driver.c
>> @@ -197,6 +197,11 @@ static int pnp_bus_freeze(struct device *dev)
>> return __pnp_bus_suspend(dev, PMSG_FREEZE);
>> }
>>
>> +static int pnp_bus_poweroff(struct device *dev)
>> +{
>> + return __pnp_bus_suspend(dev, PMSG_HIBERNATE);
>> +}
>> +
>> static int pnp_bus_resume(struct device *dev)
>> {
>> struct pnp_dev *pnp_dev = to_pnp_dev(dev);
>> @@ -234,9 +239,14 @@ static int pnp_bus_resume(struct device *dev)
>> }
>>
>> static const struct dev_pm_ops pnp_bus_dev_pm_ops = {
>> + /* Suspend callbacks */
>> .suspend = pnp_bus_suspend,
>> - .freeze = pnp_bus_freeze,
>> .resume = pnp_bus_resume,
>> + /* Hibernate callbacks */
>> + .freeze = pnp_bus_freeze,
>> + .thaw = pnp_bus_resume,
>> + .poweroff = pnp_bus_poweroff,
>> + .restore = pnp_bus_resume,
>> };
>>
>> struct bus_type pnp_bus_type = {
>>
>> ALSO, YES, this second patch version does cure the issue, on here,
>> too.
> Rafael,
>
> Will you please take this patch in? It would also make sense to add it
> to stable I think.
Well, it conveniently hasn't been sent to linux-pm.
OK, I'll try to find it in the linux-kernel archives.
Thanks,
Rafael
^ permalink raw reply
* Re: 3.12.x looses serial mouse over hibernate + resume
From: Manuel Krause @ 2013-12-04 20:33 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Rafael J. Wysocki, Peter Hurley, linux-kernel, Greg KH,
linux-input, linux-serial, Shuah Khan
In-Reply-To: <20131204171626.GD8838@core.coreip.homeip.net>
On 2013-12-04 18:16, Dmitry Torokhov wrote:
> On Mon, Dec 02, 2013 at 09:40:20PM +0100, Manuel Krause wrote:
>> On 2013-12-02 20:07, Dmitry Torokhov wrote:
>>>
>>> Thank you Manuel, but IO think the patch is not complete as we need to
>>> re-enable PNP devices after we make a snapshot to make sure they are
>>> working and can handle saving the data. Coudl you please try the patch
>>> below?
>>>
>>
>> PNP: fix restoring devices after hibernation
>>
>> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>>
>> On returning from hibernation 'restore; callback is called, not
>> 'resume'.
>> This fixes breakage introduced by commit
>> eaf140b60ec961252083ab8adaf67aef29a362dd
>>
>> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>> ---
>> drivers/pnp/driver.c | 12 +++++++++++-
>> 1 file changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
>> index a39ee38..2bd5c5f 100644
>> --- a/drivers/pnp/driver.c
>> +++ b/drivers/pnp/driver.c
>> @@ -197,6 +197,11 @@ static int pnp_bus_freeze(struct device *dev)
>> return __pnp_bus_suspend(dev, PMSG_FREEZE);
>> }
>>
>> +static int pnp_bus_poweroff(struct device *dev)
>> +{
>> + return __pnp_bus_suspend(dev, PMSG_HIBERNATE);
>> +}
>> +
>> static int pnp_bus_resume(struct device *dev)
>> {
>> struct pnp_dev *pnp_dev = to_pnp_dev(dev);
>> @@ -234,9 +239,14 @@ static int pnp_bus_resume(struct device *dev)
>> }
>>
>> static const struct dev_pm_ops pnp_bus_dev_pm_ops = {
>> + /* Suspend callbacks */
>> .suspend = pnp_bus_suspend,
>> - .freeze = pnp_bus_freeze,
>> .resume = pnp_bus_resume,
>> + /* Hibernate callbacks */
>> + .freeze = pnp_bus_freeze,
>> + .thaw = pnp_bus_resume,
>> + .poweroff = pnp_bus_poweroff,
>> + .restore = pnp_bus_resume,
>> };
>>
>> struct bus_type pnp_bus_type = {
>>
>> ALSO, YES, this second patch version does cure the issue, on here,
>> too.
>
> Rafael,
>
> Will you please take this patch in? It would also make sense to add it
> to stable I think.
>
> Thanks.
>
This patch works very well for many following hibernate/resume
cyles, now, since the patch is applied. And it doesn't show any
side-effects for me.
Thank you for "taking it in".
Best regards, Manuel Krause
^ permalink raw reply
* Re: [PATCH] Input: define KEY_WWAN for Wireless WAN
From: Rafał Miłecki @ 2013-12-04 18:00 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, Jiri Kosina, Hauke Mehrtens
In-Reply-To: <20131204171029.GC8838@core.coreip.homeip.net>
2013/12/4 Dmitry Torokhov <dmitry.torokhov@gmail.com>:
> Hi Rafal,
>
> On Thu, Nov 28, 2013 at 07:42:53PM +0100, Rafał Miłecki wrote:
>> Some devices with support for mobile networks may have buttons for
>> enabling/disabling such connection. An example can be Linksys router
>> 54G3G.
>> We already have KEY_BLUETOOTH, KEY_WLAN and KEY_UWB so it makes sense
>> to add KEY_WWAN as well.
>
> Isn't WiMAX an implementation of WWAN? Maybe instead of adding a new
> keycode we should use KEY_WIMAX code and alias KEY_WIMAX to KEY_WWAN to
> preserve ABI?
I didn't think about it but if WiMAX is indeed kind of WWAN, it makes
a perfect sense to me!
--
Rafał
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCHv2] drivers/input/mouse: add support for newer elantech touchpads (released ca. August 2013);
From: Matt Walker @ 2013-12-04 17:57 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: backports-u79uwXL29TY76Z2rM5mHXA,
linux-input-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 947 bytes --]
From: Matt Walker <matt.g.d.walker-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Added detection for newer Elantech touchpads, so that kernel doesn't
fall-back to default PS/2 driver. Supports touchpads released after
~August 2013. Fixes bug:
https://lists.launchpad.net/kernel-packages/msg18481.html
Signed-off by: Matt Walker <matt.g.d.walker-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> on an Acer
Aspire S7-392-6302
----
Thanks to Hauke for the reference on how to submit a patch properly.
Thanks to Dmitry for correction to Signed-off line.
Diff Output:
--- linux-3.13-rc1/drivers/input/
mouse/elantech.c.orig 2013-12-03
12:14:52.829173656 -0500
+++ linux-3.13-rc1/drivers/input/mouse/elantech.c 2013-12-03
12:15:11.833173880 -0500
@@ -1313,6 +1313,7 @@ static int elantech_set_properties(struc
break;
case 6:
case 7:
+ case 8:
etd->hw_version = 4;
break;
default:
[-- Attachment #2: patch --]
[-- Type: application/octet-stream, Size: 332 bytes --]
--- linux-3.13-rc1/drivers/input/mouse/elantech.c.orig 2013-12-03 12:14:52.829173656 -0500
+++ linux-3.13-rc1/drivers/input/mouse/elantech.c 2013-12-03 12:15:11.833173880 -0500
@@ -1313,6 +1313,7 @@ static int elantech_set_properties(struc
break;
case 6:
case 7:
+ case 8:
etd->hw_version = 4;
break;
default:
^ permalink raw reply
* Re: [PATCH] drivers/input/mouse: add support for newer elantech touchpads (released ca. August 2013);
From: Dmitry Torokhov @ 2013-12-04 17:18 UTC (permalink / raw)
To: Matt Walker; +Cc: Hauke Mehrtens, backports, linux-input, linux-kernel
In-Reply-To: <CA+X2d=Ar93dXujLt8xNeh9tNmEX9HU+VgVSqWsdGtKLvk=Rdyg@mail.gmail.com>
On Tue, Dec 03, 2013 at 12:42:34PM -0500, Matt Walker wrote:
> From: Matt Walker <matt.g.d.walker@gmail.com>
>
> Added detection for newer Elantech touchpads, so that kernel doesn't
> fall-back to default PS/2 driver. Supports touchpads released after
> ~August 2013. Fixes bug:
> https://lists.launchpad.net/kernel-packages/msg18481.html
>
> Tested-by: Matt Walker <matt.g.d.walker@gmail.com> on an Acer Aspire S7-392-6302
That should be "Signed-off-by: ...". Could you please add your sign off
and resend so I can apply?
Thanks.
--
Dmitry
^ permalink raw reply
* Re: 3.12.x looses serial mouse over hibernate + resume
From: Dmitry Torokhov @ 2013-12-04 17:16 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Peter Hurley, linux-kernel, Greg KH, linux-input, linux-serial,
Shuah Khan, Manuel Krause
In-Reply-To: <529CF034.1060505@netscape.net>
On Mon, Dec 02, 2013 at 09:40:20PM +0100, Manuel Krause wrote:
> On 2013-12-02 20:07, Dmitry Torokhov wrote:
> >
> >Thank you Manuel, but IO think the patch is not complete as we need to
> >re-enable PNP devices after we make a snapshot to make sure they are
> >working and can handle saving the data. Coudl you please try the patch
> >below?
> >
>
> PNP: fix restoring devices after hibernation
>
> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>
> On returning from hibernation 'restore; callback is called, not
> 'resume'.
> This fixes breakage introduced by commit
> eaf140b60ec961252083ab8adaf67aef29a362dd
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> drivers/pnp/driver.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
> index a39ee38..2bd5c5f 100644
> --- a/drivers/pnp/driver.c
> +++ b/drivers/pnp/driver.c
> @@ -197,6 +197,11 @@ static int pnp_bus_freeze(struct device *dev)
> return __pnp_bus_suspend(dev, PMSG_FREEZE);
> }
>
> +static int pnp_bus_poweroff(struct device *dev)
> +{
> + return __pnp_bus_suspend(dev, PMSG_HIBERNATE);
> +}
> +
> static int pnp_bus_resume(struct device *dev)
> {
> struct pnp_dev *pnp_dev = to_pnp_dev(dev);
> @@ -234,9 +239,14 @@ static int pnp_bus_resume(struct device *dev)
> }
>
> static const struct dev_pm_ops pnp_bus_dev_pm_ops = {
> + /* Suspend callbacks */
> .suspend = pnp_bus_suspend,
> - .freeze = pnp_bus_freeze,
> .resume = pnp_bus_resume,
> + /* Hibernate callbacks */
> + .freeze = pnp_bus_freeze,
> + .thaw = pnp_bus_resume,
> + .poweroff = pnp_bus_poweroff,
> + .restore = pnp_bus_resume,
> };
>
> struct bus_type pnp_bus_type = {
>
> ALSO, YES, this second patch version does cure the issue, on here,
> too.
Rafael,
Will you please take this patch in? It would also make sense to add it
to stable I think.
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH] Input: define KEY_WWAN for Wireless WAN
From: Dmitry Torokhov @ 2013-12-04 17:10 UTC (permalink / raw)
To: Rafał Miłecki; +Cc: linux-input, Jiri Kosina, Hauke Mehrtens
In-Reply-To: <1385664173-18879-1-git-send-email-zajec5@gmail.com>
Hi Rafal,
On Thu, Nov 28, 2013 at 07:42:53PM +0100, Rafał Miłecki wrote:
> Some devices with support for mobile networks may have buttons for
> enabling/disabling such connection. An example can be Linksys router
> 54G3G.
> We already have KEY_BLUETOOTH, KEY_WLAN and KEY_UWB so it makes sense
> to add KEY_WWAN as well.
Isn't WiMAX an implementation of WWAN? Maybe instead of adding a new
keycode we should use KEY_WIMAX code and alias KEY_WIMAX to KEY_WWAN to
preserve ABI?
Thanks.
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] xen/pvhvm: If xen_platform_pci=0 is set don't blow up.
From: Dmitry Torokhov @ 2013-12-04 17:08 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk
Cc: stefano.stabellini, ian.campbell, xen-devel, linux-kernel,
boris.ostrovsky, david.vrabel, leosilva, ashley, peterhuewe, mail,
tpmdd, tpmdd, bhelgaas, plagnioj, tomi.valkeinen, tpmdd-devel,
linux-input, netdev, linux-pci, linux-fbdev
In-Reply-To: <20131204164802.GG391@pegasus.dumpdata.com>
On Wed, Dec 04, 2013 at 11:48:03AM -0500, Konrad Rzeszutek Wilk wrote:
> > > which is hardly nice. This patch fixes this by having each
> > > PV driver check for:
> > > - if running in PV, then it is fine to execute (as that is their
> > > native environment).
> > > - if running in HVM, check if user wanted 'xen_emul_unplug=never',
> > > in which case bail out and don't load PV drivers.
> > > - if running in HVM, and if PCI device 5853:0001 (xen_platform_pci)
> > > does not exist, then bail out and not load PV drivers.
> > >
> > > P.S.
> > > Ian Campbell suggested getting rid of 'xen_platform_pci_unplug'
> > > but unfortunatly the xen-blkfront driver is using it, so we
> > > cannot do it.
> > >
> > > Reported-by: Sander Eikelenboom <linux@eikelenboom.it
> > > Reported-by: Anthony PERARD <anthony.perard@citrix.com>
> > > Reported-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
> >
> > For input:
> >
> > Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>
> Thank you. I need to do some extra changes to the other subsystems but
> for the fb/kbd itshould be still throught the same function as this
> patch has exposed. I will repost it and include your Ack if you are OK
> with that?
Sure.
--
Dmitry
^ permalink raw reply
* Re: [PATCH] xen/pvhvm: If xen_platform_pci=0 is set don't blow up.
From: Konrad Rzeszutek Wilk @ 2013-12-04 16:48 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: stefano.stabellini, ian.campbell, xen-devel, linux-kernel,
boris.ostrovsky, david.vrabel, leosilva, ashley, peterhuewe, mail,
tpmdd, tpmdd, bhelgaas, plagnioj, tomi.valkeinen, tpmdd-devel,
linux-input, netdev, linux-pci, linux-fbdev
In-Reply-To: <20131204164218.GA8838@core.coreip.homeip.net>
> > which is hardly nice. This patch fixes this by having each
> > PV driver check for:
> > - if running in PV, then it is fine to execute (as that is their
> > native environment).
> > - if running in HVM, check if user wanted 'xen_emul_unplug=never',
> > in which case bail out and don't load PV drivers.
> > - if running in HVM, and if PCI device 5853:0001 (xen_platform_pci)
> > does not exist, then bail out and not load PV drivers.
> >
> > P.S.
> > Ian Campbell suggested getting rid of 'xen_platform_pci_unplug'
> > but unfortunatly the xen-blkfront driver is using it, so we
> > cannot do it.
> >
> > Reported-by: Sander Eikelenboom <linux@eikelenboom.it
> > Reported-by: Anthony PERARD <anthony.perard@citrix.com>
> > Reported-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
>
> For input:
>
> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Thank you. I need to do some extra changes to the other subsystems but
for the fb/kbd itshould be still throught the same function as this
patch has exposed. I will repost it and include your Ack if you are OK
with that?
>
> ...
>
> > +#if defined(CONFIG_XEN_PVHVM)
> > +extern bool xen_has_pv_devices(void);
> > +#else
> > +static inline bool xen_has_pv_devices(void)
> > +{
> > +#if defined(CONFIG_XEN)
> > + return true;
> > +#else
> > + return false;
> > +#endif
>
> return IS_ENABLED(CONFIG_XEN);
>
> ?
Oh, awesome! Thanks!
^ permalink raw reply
* Re: [PATCH] xen/pvhvm: If xen_platform_pci=0 is set don't blow up.
From: Dmitry Torokhov @ 2013-12-04 16:42 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk
Cc: stefano.stabellini, ian.campbell, xen-devel, linux-kernel,
boris.ostrovsky, david.vrabel, leosilva, ashley, peterhuewe, mail,
tpmdd, tpmdd, bhelgaas, plagnioj, tomi.valkeinen, tpmdd-devel,
linux-input, netdev, linux-pci, linux-fbdev
In-Reply-To: <1386105246-14337-1-git-send-email-konrad.wilk@oracle.com>
Hi Konrad,
On Tue, Dec 03, 2013 at 04:14:06PM -0500, Konrad Rzeszutek Wilk wrote:
> The user has the option of disabling the platform driver:
> 00:02.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)
>
> which is used to unplug the emulated drivers (IDE, Realtek 8169, etc)
> and allow the PV drivers to take over. If the user wishes
> to disable that they can set:
>
> xen_platform_pci=0
> (in the guest config file)
>
> or
> xen_emul_unplug=never
> (on the Linux command line)
>
> except it does not work properly. The PV drivers still try to
> load and since the Xen platform driver is not run - and it
> has not initialized the grant tables, most of the PV drivers
> stumble upon:
>
> input: Xen Virtual Keyboard as /devices/virtual/input/input5
> input: Xen Virtual Pointer as /devices/virtual/input/input6M
> ------------[ cut here ]------------
> kernel BUG at /home/konrad/ssd/konrad/linux/drivers/xen/grant-table.c:1206!
> invalid opcode: 0000 [#1] SMP
> Modules linked in: xen_kbdfront(+) xenfs xen_privcmd
> CPU: 6 PID: 1389 Comm: modprobe Not tainted 3.13.0-rc1upstream-00021-ga6c892b-dirty #1
> Hardware name: Xen HVM domU, BIOS 4.4-unstable 11/26/2013
> RIP: 0010:[<ffffffff813ddc40>] [<ffffffff813ddc40>] get_free_entries+0x2e0/0x300
> Call Trace:
> [<ffffffff8150d9a3>] ? evdev_connect+0x1e3/0x240
> [<ffffffff813ddd0e>] gnttab_grant_foreign_access+0x2e/0x70
> [<ffffffffa0010081>] xenkbd_connect_backend+0x41/0x290 [xen_kbdfront]
> [<ffffffffa0010a12>] xenkbd_probe+0x2f2/0x324 [xen_kbdfront]
> [<ffffffff813e5757>] xenbus_dev_probe+0x77/0x130
> [<ffffffff813e7217>] xenbus_frontend_dev_probe+0x47/0x50
> [<ffffffff8145e9a9>] driver_probe_device+0x89/0x230
> [<ffffffff8145ebeb>] __driver_attach+0x9b/0xa0
> [<ffffffff8145eb50>] ? driver_probe_device+0x230/0x230
> [<ffffffff8145eb50>] ? driver_probe_device+0x230/0x230
> [<ffffffff8145cf1c>] bus_for_each_dev+0x8c/0xb0
> [<ffffffff8145e7d9>] driver_attach+0x19/0x20
> [<ffffffff8145e260>] bus_add_driver+0x1a0/0x220
> [<ffffffff8145f1ff>] driver_register+0x5f/0xf0
> [<ffffffff813e55c5>] xenbus_register_driver_common+0x15/0x20
> [<ffffffff813e76b3>] xenbus_register_frontend+0x23/0x40
> [<ffffffffa0015000>] ? 0xffffffffa0014fff
> [<ffffffffa001502b>] xenkbd_init+0x2b/0x1000 [xen_kbdfront]
> [<ffffffff81002049>] do_one_initcall+0x49/0x170
>
> .. snip..
>
> which is hardly nice. This patch fixes this by having each
> PV driver check for:
> - if running in PV, then it is fine to execute (as that is their
> native environment).
> - if running in HVM, check if user wanted 'xen_emul_unplug=never',
> in which case bail out and don't load PV drivers.
> - if running in HVM, and if PCI device 5853:0001 (xen_platform_pci)
> does not exist, then bail out and not load PV drivers.
>
> P.S.
> Ian Campbell suggested getting rid of 'xen_platform_pci_unplug'
> but unfortunatly the xen-blkfront driver is using it, so we
> cannot do it.
>
> Reported-by: Sander Eikelenboom <linux@eikelenboom.it
> Reported-by: Anthony PERARD <anthony.perard@citrix.com>
> Reported-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
For input:
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
...
> +#if defined(CONFIG_XEN_PVHVM)
> +extern bool xen_has_pv_devices(void);
> +#else
> +static inline bool xen_has_pv_devices(void)
> +{
> +#if defined(CONFIG_XEN)
> + return true;
> +#else
> + return false;
> +#endif
return IS_ENABLED(CONFIG_XEN);
?
Thanks.
--
Dmitry
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox