Skip to contentSkip to conversation

iio:kxcjk-1013: Add support for SMO8500 device

PATCH In review Bastien Nocera 3 participants 10 messages Sep 9, 2014 – Sep 25, 2014 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio:kxcjk-1013: Add support for SMO8500 device

The Onda v975w tablet contains an accelerometer that's advertised over ACPI as SMO8500. This device is however a KXCJ9 accelerometer as can be seen in the Windows driver's INF file.

---

I tested the patch, and it works correctly in my testing. However, there's no GPIO pin for the "data ready" interrupt, and this throws an error that looks fatal in the logs (could this be downgraded?), and the name of the device doesn't match the hid-sensor-hub ones, making it hard for user-space to discover them.
(https://github.com/hadess/iio-sensor-proxy is my attempt at something
that integrates with user-space and the IIO sensors)

It will also conflict with Daniel's patch here:
http://www.spinics.net/lists/linux-iio/msg14438.html

Cheers

---
 drivers/iio/accel/kxcjk-1013.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/accel/kxcjk-1013.c +2 -0
index 7941cf2..dea5732 100644
@@ -736,12 +736,14 @@ static SIMPLE_DEV_PM_OPS(kxcjk1013_pm_ops, kxcjk1013_suspend, kxcjk1013_resume);
 
 static const struct acpi_device_id kx_acpi_match[] = {
 	{"KXCJ1013", 0},
+	{"SMO8500", 0},
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, kx_acpi_match);
 
 static const struct i2c_device_id kxcjk1013_id[] = {
 	{"kxcjk1013", 0},
+	{"SMO8500", 0},
 	{}
 };
 
Signature · 1 line
2.1.0
#1 lore raw

Hi Bastien,

Quoted 7 lines · Bastien Nocera

The Onda v975w tablet contains an accelerometer that's advertised over ACPI as SMO8500. This device is however a KXCJ9 accelerometer as can be seen in the Windows driver's INF file.

---

Quoted 8 lines

I tested the patch, and it works correctly in my testing. However, there's no GPIO pin for the "data ready" interrupt, and this throws an error that looks fatal in the logs (could this be downgraded?), and the name of the device doesn't match the hid-sensor-hub ones, making it hard for user-space to discover them.
(https://github.com/hadess/iio-sensor-proxy is my attempt at something
that integrates with user-space and the IIO sensors)

How does your ACPI .dsl file looks like?

Quoted 2 lines

It will also conflict with Daniel's patch here:
http://www.spinics.net/lists/linux-iio/msg14438.html

It shouldn't. The patch is already in togreg branch of Jonathan's tree [1]. Anyhow,
it will conflict with this one [2].

thanks,
Daniel.

[1] https://git.kernel.org/cgit/linux/kernel/git/jic23/iio.git/commit/?h=togreg&id=ca801795b17b13a105b5209cf451abac3a6529ff
[2] https://lkml.org/lkml/2014/9/3/71

#2 lore raw

Hey Daniel,

Quoted 19 lines · Daniel Baluta

Hi Bastien,

Quoted 7 lines · Bastien Nocera

The Onda v975w tablet contains an accelerometer that's advertised over ACPI as SMO8500. This device is however a KXCJ9 accelerometer as can be seen in the Windows driver's INF file.

---

Quoted 8 lines

I tested the patch, and it works correctly in my testing. However, there's no GPIO pin for the "data ready" interrupt, and this throws an error that looks fatal in the logs (could this be downgraded?), and the name of the device doesn't match the hid-sensor-hub ones, making it hard for user-space to discover them.
(https://github.com/hadess/iio-sensor-proxy is my attempt at something
that integrates with user-space and the IIO sensors)

Quoted 1 line

How does your ACPI .dsl file looks like?

I uploaded it to the kernel bugzilla for another bug, it's at:
https://bugzilla.kernel.org/attachment.cgi?id=149331

Quoted 5 lines
Quoted 2 lines

It will also conflict with Daniel's patch here:
http://www.spinics.net/lists/linux-iio/msg14438.html

It shouldn't. The patch is already in togreg branch of Jonathan's tree [1].

I used the upstream linus kernel, which I probably shouldn't have done, but hey, IIO was just one of the several class of devices that needs work on this tablet ;)

Quoted 2 lines

Anyhow,
it will conflict with this one [2].

Right. I'm fine to rebase it if it looks correct otherwise.

Cheers

#3 lore raw
In reply to Daniel Baluta
Quoted 19 lines · Daniel Baluta

Hi Bastien,

Quoted 7 lines · Bastien Nocera

The Onda v975w tablet contains an accelerometer that's advertised over ACPI as SMO8500. This device is however a KXCJ9 accelerometer as can be seen in the Windows driver's INF file.

---

Quoted 8 lines

I tested the patch, and it works correctly in my testing. However, there's no GPIO pin for the "data ready" interrupt, and this throws an error that looks fatal in the logs (could this be downgraded?), and the name of the device doesn't match the hid-sensor-hub ones, making it hard for user-space to discover them.
(https://github.com/hadess/iio-sensor-proxy is my attempt at something
that integrates with user-space and the IIO sensors)

Quoted 8 lines

How does your ACPI .dsl file looks like?

Quoted 2 lines

It will also conflict with Daniel's patch here:
http://www.spinics.net/lists/linux-iio/msg14438.html

It shouldn't. The patch is already in togreg branch of Jonathan's tree [1]. Anyhow,
it will conflict with this one [2].

Do you want me to rebase the patch on a particular tree? Do you need any particular changes done in my commit message or patch to get this merged?

Cheers

#4 lore raw
Quoted 9 lines · Bastien Nocera
Quoted 8 lines · Daniel Baluta

Hi Bastien,

Quoted 5 lines · Bastien Nocera

The Onda v975w tablet contains an accelerometer that's advertised over ACPI as SMO8500. This device is however a KXCJ9 accelerometer as can be seen in the Windows driver's INF file.
---

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

I tested the patch, and it works correctly in my testing. However, there's no GPIO pin for the "data ready" interrupt, and this throws an error that looks fatal in the logs (could this be downgraded?), and the name of the device doesn't match the hid-sensor-hub ones, making it hard for user-space to discover them.
(https://github.com/hadess/iio-sensor-proxy is my attempt at something
that integrates with user-space and the IIO sensors)

How did you test it? There is no GpioInt associated with your device in the the .dsl file. What kind of error do you see in the logs?

Quoted 11 lines
Quoted 7 lines

How does your ACPI .dsl file looks like?

Quoted 2 lines

It will also conflict with Daniel's patch here:
http://www.spinics.net/lists/linux-iio/msg14438.html

It shouldn't. The patch is already in togreg branch of Jonathan's tree [1]. Anyhow,
it will conflict with this one [2].

Do you want me to rebase the patch on a particular tree? Do you need any particular changes done in my commit message or patch to get this merged?

I would suggest you wait until Jonathan merges this patch [1] in togreg branch [2]. Then rebase your patch on togreg branch and get feedback from Jonathan and Srinivas.

thanks,
Daniel.

[1] http://www.spinics.net/lists/linux-iio/msg14655.html
[2] https://git.kernel.org/cgit/linux/kernel/git/jic23/iio.git/log/?h=togreg

#5 lore raw
Quoted 18 lines · Daniel Baluta
Quoted 9 lines · Bastien Nocera
Quoted 8 lines · Daniel Baluta

Hi Bastien,

Quoted 5 lines · Bastien Nocera

The Onda v975w tablet contains an accelerometer that's advertised over ACPI as SMO8500. This device is however a KXCJ9 accelerometer as can be seen in the Windows driver's INF file.
---

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

I tested the patch, and it works correctly in my testing. However, there's no GPIO pin for the "data ready" interrupt, and this throws an error that looks fatal in the logs (could this be downgraded?), and the name of the device doesn't match the hid-sensor-hub ones, making it hard for user-space to discover them.
(https://github.com/hadess/iio-sensor-proxy is my attempt at something
that integrates with user-space and the IIO sensors)

Quoted 1 line

How did you test it?

Cat on the /sys files for each of the axis. I can see the values of x/y/z changing depending on the position of the device.

Quoted 2 lines

There is no GpioInt associated with your device in
the the .dsl file.

I know, that's because the GPIO (according to the driver) is only used to know when there's more data to be read. We just have to poll instead...

Quoted 1 line

What kind of error do you see in the logs?

The "acpi gpio get index failed" error when it fails to find a GPIO pin for the "data ready" interrupt. Except that it works just fine without such an interrupt.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

How does your ACPI .dsl file looks like?

Quoted 2 lines

It will also conflict with Daniel's patch here:
http://www.spinics.net/lists/linux-iio/msg14438.html

It shouldn't. The patch is already in togreg branch of Jonathan's tree [1]. Anyhow,
it will conflict with this one [2].

Quoted 8 lines
Quoted 4 lines

Do you want me to rebase the patch on a particular tree? Do you need any particular changes done in my commit message or patch to get this merged?

I would suggest you wait until Jonathan merges this patch [1] in togreg branch [2].
Then rebase your patch on togreg branch and get feedback from Jonathan and Srinivas.

OK, I'll have to monitor those.

Cheers

maintainer
#6 lore raw
Quoted 31 lines · Bastien Nocera
Quoted 18 lines · Daniel Baluta
Quoted 9 lines · Bastien Nocera
Quoted 8 lines · Daniel Baluta

Hi Bastien,

Quoted 5 lines · Bastien Nocera

The Onda v975w tablet contains an accelerometer that's advertised over ACPI as SMO8500. This device is however a KXCJ9 accelerometer as can be seen in the Windows driver's INF file.
---

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

I tested the patch, and it works correctly in my testing. However, there's no GPIO pin for the "data ready" interrupt, and this throws an error that looks fatal in the logs (could this be downgraded?), and the name of the device doesn't match the hid-sensor-hub ones, making it hard for user-space to discover them.
(https://github.com/hadess/iio-sensor-proxy is my attempt at something
that integrates with user-space and the IIO sensors)

Quoted 1 line

How did you test it?

Cat on the /sys files for each of the axis. I can see the values of x/y/z changing depending on the position of the device.

Quoted 2 lines

There is no GpioInt associated with your device in
the the .dsl file.

I know, that's because the GPIO (according to the driver) is only used to know when there's more data to be read. We just have to poll instead...

Quoted 21 lines
Quoted 1 line

What kind of error do you see in the logs?

The "acpi gpio get index failed" error when it fails to find a GPIO pin for the "data ready" interrupt. Except that it works just fine without such an interrupt.

Quoted 15 lines
Quoted 11 lines
Quoted 7 lines

How does your ACPI .dsl file looks like?

Quoted 2 lines

It will also conflict with Daniel's patch here:
http://www.spinics.net/lists/linux-iio/msg14438.html

It shouldn't. The patch is already in togreg branch of Jonathan's tree [1]. Anyhow,
it will conflict with this one [2].

Do you want me to rebase the patch on a particular tree? Do you need any particular changes done in my commit message or patch to get this merged?

I would suggest you wait until Jonathan merges this patch [1] in togreg branch [2].
Then rebase your patch on togreg branch and get feedback from Jonathan and Srinivas.

I've applied the patch [1] to my local copy and pushed out as testing. Once the autobuilders come back to me in an hour or so, I'll push it out as the togreg branch. I'm planning a pull request to Greg tonight at which point it will head for linux-next.

Quoted 10 lines

OK, I'll have to monitor those.

Cheers

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
Quoted 49 lines · Jonathan Cameron
Quoted 48 lines · Bastien Nocera
Quoted 18 lines · Daniel Baluta
Quoted 9 lines · Bastien Nocera
Quoted 8 lines · Daniel Baluta

Hi Bastien,

Quoted 5 lines · Bastien Nocera

The Onda v975w tablet contains an accelerometer that's advertised over ACPI as SMO8500. This device is however a KXCJ9 accelerometer as can be seen in the Windows driver's INF file.
---

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

I tested the patch, and it works correctly in my testing. However, there's no GPIO pin for the "data ready" interrupt, and this throws an error that looks fatal in the logs (could this be downgraded?), and the name of the device doesn't match the hid-sensor-hub ones, making it hard for user-space to discover them.
(https://github.com/hadess/iio-sensor-proxy is my attempt at something
that integrates with user-space and the IIO sensors)

Quoted 1 line

How did you test it?

Cat on the /sys files for each of the axis. I can see the values of x/y/z changing depending on the position of the device.

Quoted 2 lines

There is no GpioInt associated with your device in
the the .dsl file.

I know, that's because the GPIO (according to the driver) is only used to know when there's more data to be read. We just have to poll instead...

Quoted 1 line

What kind of error do you see in the logs?

The "acpi gpio get index failed" error when it fails to find a GPIO pin for the "data ready" interrupt. Except that it works just fine without such an interrupt.

Quoted 11 lines
Quoted 11 lines
Quoted 7 lines

How does your ACPI .dsl file looks like?

Quoted 2 lines

It will also conflict with Daniel's patch here:
http://www.spinics.net/lists/linux-iio/msg14438.html

It shouldn't. The patch is already in togreg branch of Jonathan's tree [1]. Anyhow,
it will conflict with this one [2].

Do you want me to rebase the patch on a particular tree? Do you need any particular changes done in my commit message or patch to get this merged?

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

I would suggest you wait until Jonathan merges this patch [1] in togreg branch [2].
Then rebase your patch on togreg branch and get feedback from Jonathan and Srinivas.

I've applied the patch [1] to my local copy and pushed out as testing. Once the autobuilders come back to me in an hour or so, I'll push it out as the togreg branch. I'm planning a pull request to Greg tonight at which point it will head for linux-next.

Could you point me to the tree and branch that I should be rebasing my patch on?

Cheers

maintainer
#8 lore raw
Quoted 73 lines · Bastien Nocera
Quoted 7 lines · Jonathan Cameron
Quoted 6 lines · Bastien Nocera
Quoted 5 lines · Daniel Baluta
Quoted 4 lines · Bastien Nocera
Quoted 3 lines · Daniel Baluta

Hi Bastien,

On Tue, Sep 9, 2014 at 8:19 PM, Bastien Nocera

Quoted 1 line · <[email protected]> wrote:
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

The Onda v975w tablet contains an accelerometer that's

advertised over

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

ACPI as SMO8500. This device is however a KXCJ9 accelerometer

as

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

can be seen in the Windows driver's INF file.
---

I tested the patch, and it works correctly in my testing.

However,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

there's no GPIO pin for the "data ready" interrupt, and this

throws an

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

error that looks fatal in the logs (could this be downgraded?),

and

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

the name of the device doesn't match the hid-sensor-hub ones,

making it

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

hard for user-space to discover them.
(https://github.com/hadess/iio-sensor-proxy is my attempt at

something

Quoted 11 lines
Quoted 11 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

that integrates with user-space and the IIO sensors)

How did you test it?

Cat on the /sys files for each of the axis. I can see the values of x/y/z changing depending on the position of the device.

Quoted 2 lines

There is no GpioInt associated with your device in
the the .dsl file.

I know, that's because the GPIO (according to the driver) is only

used

Quoted 6 lines
Quoted 6 lines

to know when there's more data to be read. We just have to poll instead...

Quoted 1 line

What kind of error do you see in the logs?

The "acpi gpio get index failed" error when it fails to find a GPIO

pin

Quoted 1 line
Quoted 1 line

for the "data ready" interrupt. Except that it works just fine

without

Quoted 7 lines
Quoted 7 lines

such an interrupt.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

How does your ACPI .dsl file looks like?

Quoted 2 lines

It will also conflict with Daniel's patch here:
http://www.spinics.net/lists/linux-iio/msg14438.html

It shouldn't. The patch is already in togreg branch of

Jonathan's tree

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

[1]. Anyhow,
it will conflict with this one [2].

Do you want me to rebase the patch on a particular tree? Do you

need any

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

particular changes done in my commit message or patch to get this merged?

I would suggest you wait until Jonathan merges this patch [1] in

togreg

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

branch [2].
Then rebase your patch on togreg branch and get feedback from

Jonathan

Quoted 2 lines
Quoted 1 line
Quoted 1 line

and Srinivas.

I've applied the patch [1] to my local copy and pushed out as

testing.

Quoted 1 line

Once the autobuilders come back to me in an hour or so, I'll push it

out as

Quoted 8 lines
Quoted 1 line

the togreg branch. I'm planning a pull request to Greg tonight at

which point

Quoted 1 line

it will head for linux-next.

Could you point me to the tree and branch that I should be rebasing my patch on?

https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg

Or
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-next

Which is our upstream...

J

Quoted 6 lines

Cheers

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 1 line
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
maintainer
#9 lore raw
In reply to Bastien Nocera
Quoted 11 lines · Bastien Nocera

The Onda v975w tablet contains an accelerometer that's advertised over ACPI as SMO8500. This device is however a KXCJ9 accelerometer as can be seen in the Windows driver's INF file.

---

I tested the patch, and it works correctly in my testing. However, there's no GPIO pin for the "data ready" interrupt, and this throws an error that looks fatal in the logs (could this be downgraded?), and the name of the device doesn't match the hid-sensor-hub ones, making it hard for user-space to discover them.

Change the driver to use the i2c device id supplied name instead of hard coding it. This is normal in multi part supporting drivers. We should probably encourage this even in single part supporting drivers to cut down on churn when more parts are almost inevitably added later!

Quoted 31 lines

(https://github.com/hadess/iio-sensor-proxy is my attempt at something
that integrates with user-space and the IIO sensors)

It will also conflict with Daniel's patch here:
http://www.spinics.net/lists/linux-iio/msg14438.html

Cheers

---
 drivers/iio/accel/kxcjk-1013.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/accel/kxcjk-1013.c +2 -0
index 7941cf2..dea5732 100644
@@ -736,12 +736,14 @@ static SIMPLE_DEV_PM_OPS(kxcjk1013_pm_ops, kxcjk1013_suspend, kxcjk1013_resume);
 
 static const struct acpi_device_id kx_acpi_match[] = {
 	{"KXCJ1013", 0},
+	{"SMO8500", 0},
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, kx_acpi_match);
 
 static const struct i2c_device_id kxcjk1013_id[] = {
 	{"kxcjk1013", 0},
+	{"SMO8500", 0},
 	{}
 };