Thread (3 messages) 3 messages, 2 authors, 2013-11-27

Re: [PATCH] input: Add support for MMA7455L/MMA7456L 3-Axis Accelerometer

From: Alexander Shiyan <hidden>
Date: 2013-11-27 07:22:38
Also in: linux-devicetree

Hello.
On Fri, Nov 22, 2013 at 07:53:35PM +0400, Alexander Shiyan wrote:
quoted
This patch adds support for Freescale MMA7455L/MMA7456L 3-Axis
Accelerometer connected to I2C bus. Driver can be loaded ether
with or without DT support. The basic parameters of the driver
can be changed through sysfs.
The driver looks sane but I am hesitant with the sysfs interface. For a
while I asked accelerometer guys to standardize on sysfs attributes
applicable to all input-related 3-axis accelerometers, but I have not
seen a concrete proposal thus far.

If you remove sysfs portions I can merge it as pure input driver now.
Without sysfs we can not tune device parameters, so only my default
values will be used, ​​that may not be suitable for other users.
What are the alternatives? procfs and ioctl. Not sure it's better ...

...
quoted
diff --git a/drivers/input/misc/mma745xl.c b/drivers/input/misc/mma745xl.c
...
quoted
+static int mma745xl_probe(struct i2c_client *client,
+			  const struct i2c_device_id *id)
+{
...
quoted
+	input_set_drvdata(input, priv);
+	dev_set_drvdata(&client->dev, input);
	i2c_set_clientdata()
Device also can be used through SPI.
If anyone will make support for this, we can just put the initialization in a
single function, leaving only the regmap initialization related to bus.
Using dev_set_drvdata is more generic here. Not think so?
Thanks.

---
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help