All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio:kxcjk-1013: Add support for SMO8500 device
@ 2014-09-09 17:19 Bastien Nocera
  2014-09-09 18:53 ` Daniel Baluta
  2014-09-14 14:05 ` Jonathan Cameron
  0 siblings, 2 replies; 11+ messages in thread
From: Bastien Nocera @ 2014-09-09 17:19 UTC (permalink / raw)
  To: linux-iio; +Cc: Daniel Baluta

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(+)

diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c
index 7941cf2..dea5732 100644
--- a/drivers/iio/accel/kxcjk-1013.c
+++ b/drivers/iio/accel/kxcjk-1013.c
@@ -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},
 	{}
 };
 
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] iio:kxcjk-1013: Add support for SMO8500 device
  2014-09-09 17:19 [PATCH] iio:kxcjk-1013: Add support for SMO8500 device Bastien Nocera
@ 2014-09-09 18:53 ` Daniel Baluta
  2014-09-09 18:58   ` Bastien Nocera
  2014-09-11 18:18   ` Bastien Nocera
  2014-09-14 14:05 ` Jonathan Cameron
  1 sibling, 2 replies; 11+ messages in thread
From: Daniel Baluta @ 2014-09-09 18:53 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: linux-iio, Daniel Baluta, Jonathan Cameron

Hi Bastien,

On Tue, Sep 9, 2014 at 8:19 PM, Bastien Nocera <hadess@hadess.net> wrote:
> 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)
>

How does your ACPI .dsl file looks like?

> 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] iio:kxcjk-1013: Add support for SMO8500 device
  2014-09-09 18:53 ` Daniel Baluta
@ 2014-09-09 18:58   ` Bastien Nocera
  2014-09-11 18:18   ` Bastien Nocera
  1 sibling, 0 replies; 11+ messages in thread
From: Bastien Nocera @ 2014-09-09 18:58 UTC (permalink / raw)
  To: Daniel Baluta; +Cc: linux-iio, Jonathan Cameron

Hey Daniel,

On Tue, 2014-09-09 at 21:53 +0300, Daniel Baluta wrote:
> Hi Bastien,
> 
> On Tue, Sep 9, 2014 at 8:19 PM, Bastien Nocera <hadess@hadess.net> wrote:
> > 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)
> >
> 
> 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

> > 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 ;)

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

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

Cheers

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] iio:kxcjk-1013: Add support for SMO8500 device
  2014-09-09 18:53 ` Daniel Baluta
  2014-09-09 18:58   ` Bastien Nocera
@ 2014-09-11 18:18   ` Bastien Nocera
  2014-09-12 12:24     ` Daniel Baluta
  1 sibling, 1 reply; 11+ messages in thread
From: Bastien Nocera @ 2014-09-11 18:18 UTC (permalink / raw)
  To: Daniel Baluta; +Cc: linux-iio, Jonathan Cameron

On Tue, 2014-09-09 at 21:53 +0300, Daniel Baluta wrote:
> Hi Bastien,
> 
> On Tue, Sep 9, 2014 at 8:19 PM, Bastien Nocera <hadess@hadess.net> wrote:
> > 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)
> >
> 
> How does your ACPI .dsl file looks like?
> 
> > 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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] iio:kxcjk-1013: Add support for SMO8500 device
  2014-09-12 12:24     ` Daniel Baluta
@ 2014-09-12 12:24       ` Bastien Nocera
  2014-09-14 14:11         ` Jonathan Cameron
  0 siblings, 1 reply; 11+ messages in thread
From: Bastien Nocera @ 2014-09-12 12:24 UTC (permalink / raw)
  To: Daniel Baluta; +Cc: linux-iio, Jonathan Cameron, srinivas.pandruvada

On Fri, 2014-09-12 at 15:24 +0300, Daniel Baluta wrote:
> On 09/11/2014 09:18 PM, Bastien Nocera wrote:
> > On Tue, 2014-09-09 at 21:53 +0300, Daniel Baluta wrote:
> >> Hi Bastien,
> >>
> >> On Tue, Sep 9, 2014 at 8:19 PM, Bastien Nocera <hadess@hadess.net> wrote:
> >>> 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)
> >>>
> 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.

>  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...

> 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.

> >> How does your ACPI .dsl file looks like?
> >>
> >>> 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.

OK, I'll have to monitor those.

Cheers


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] iio:kxcjk-1013: Add support for SMO8500 device
  2014-09-11 18:18   ` Bastien Nocera
@ 2014-09-12 12:24     ` Daniel Baluta
  2014-09-12 12:24       ` Bastien Nocera
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Baluta @ 2014-09-12 12:24 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: linux-iio, Jonathan Cameron, srinivas.pandruvada


On 09/11/2014 09:18 PM, Bastien Nocera wrote:
> On Tue, 2014-09-09 at 21:53 +0300, Daniel Baluta wrote:
>> Hi Bastien,
>>
>> On Tue, Sep 9, 2014 at 8:19 PM, Bastien Nocera <hadess@hadess.net> wrote:
>>> 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)
>>>
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?
>> How does your ACPI .dsl file looks like?
>>
>>> 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] iio:kxcjk-1013: Add support for SMO8500 device
  2014-09-09 17:19 [PATCH] iio:kxcjk-1013: Add support for SMO8500 device Bastien Nocera
  2014-09-09 18:53 ` Daniel Baluta
@ 2014-09-14 14:05 ` Jonathan Cameron
  1 sibling, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2014-09-14 14:05 UTC (permalink / raw)
  To: Bastien Nocera, linux-iio; +Cc: Daniel Baluta

On 09/09/14 18:19, Bastien Nocera wrote:
> 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!

> (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(+)
> 
> diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c
> index 7941cf2..dea5732 100644
> --- a/drivers/iio/accel/kxcjk-1013.c
> +++ b/drivers/iio/accel/kxcjk-1013.c
> @@ -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},
>  	{}
>  };
>  
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] iio:kxcjk-1013: Add support for SMO8500 device
  2014-09-12 12:24       ` Bastien Nocera
@ 2014-09-14 14:11         ` Jonathan Cameron
  2014-09-25  8:49           ` Bastien Nocera
  0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Cameron @ 2014-09-14 14:11 UTC (permalink / raw)
  To: Bastien Nocera, Daniel Baluta; +Cc: linux-iio, srinivas.pandruvada

On 12/09/14 13:24, Bastien Nocera wrote:
> On Fri, 2014-09-12 at 15:24 +0300, Daniel Baluta wrote:
>> On 09/11/2014 09:18 PM, Bastien Nocera wrote:
>>> On Tue, 2014-09-09 at 21:53 +0300, Daniel Baluta wrote:
>>>> Hi Bastien,
>>>>
>>>> On Tue, Sep 9, 2014 at 8:19 PM, Bastien Nocera <hadess@hadess.net> wrote:
>>>>> 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)
>>>>>
>> 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.
> 
>>  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...
> 
>> 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.
> 
>>>> How does your ACPI .dsl file looks like?
>>>>
>>>>> 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.
> 
> 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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] iio:kxcjk-1013: Add support for SMO8500 device
  2014-09-14 14:11         ` Jonathan Cameron
@ 2014-09-25  8:49           ` Bastien Nocera
  2014-09-25 12:47             ` Jonathan Cameron
  0 siblings, 1 reply; 11+ messages in thread
From: Bastien Nocera @ 2014-09-25  8:49 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Daniel Baluta, linux-iio, srinivas.pandruvada

On Sun, 2014-09-14 at 15:11 +0100, Jonathan Cameron wrote:
> On 12/09/14 13:24, Bastien Nocera wrote:
> > On Fri, 2014-09-12 at 15:24 +0300, Daniel Baluta wrote:
> >> On 09/11/2014 09:18 PM, Bastien Nocera wrote:
> >>> On Tue, 2014-09-09 at 21:53 +0300, Daniel Baluta wrote:
> >>>> Hi Bastien,
> >>>>
> >>>> On Tue, Sep 9, 2014 at 8:19 PM, Bastien Nocera <hadess@hadess.net> wrote:
> >>>>> 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)
> >>>>>
> >> 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.
> > 
> >>  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...
> > 
> >> 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.
> > 
> >>>> How does your ACPI .dsl file looks like?
> >>>>
> >>>>> 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.

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

Cheers

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] iio:kxcjk-1013: Add support for SMO8500 device
  2014-09-25  8:49           ` Bastien Nocera
@ 2014-09-25 12:47             ` Jonathan Cameron
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2014-09-25 12:47 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: Daniel Baluta, linux-iio, srinivas.pandruvada



On September 25, 2014 9:49:56 AM GMT+01:00, Bastien Nocera <hadess@hadess.net> wrote:
>On Sun, 2014-09-14 at 15:11 +0100, Jonathan Cameron wrote:
>> On 12/09/14 13:24, Bastien Nocera wrote:
>> > On Fri, 2014-09-12 at 15:24 +0300, Daniel Baluta wrote:
>> >> On 09/11/2014 09:18 PM, Bastien Nocera wrote:
>> >>> On Tue, 2014-09-09 at 21:53 +0300, Daniel Baluta wrote:
>> >>>> Hi Bastien,
>> >>>>
>> >>>> On Tue, Sep 9, 2014 at 8:19 PM, Bastien Nocera
><hadess@hadess.net> wrote:
>> >>>>> 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)
>> >>>>>
>> >> 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.
>> > 
>> >>  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...
>> > 
>> >> 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.
>> > 
>> >>>> How does your ACPI .dsl file looks like?
>> >>>>
>> >>>>> 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.
>
>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
>Cheers
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] iio:kxcjk-1013: Add support for SMO8500 device
@ 2014-11-03 23:07 Bastien Nocera
  0 siblings, 0 replies; 11+ messages in thread
From: Bastien Nocera @ 2014-11-03 23:07 UTC (permalink / raw)
  To: linux-iio; +Cc: jic23

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, and from the etching on
the chipset ("KXCJ9 41566 0414").

This patch also removes the attempt to get the IRQ for the "data ready"
signal, as it does not seem to be supported by this device on this
platform.
---
 drivers/iio/accel/kxcjk-1013.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c
index 98909a9..3b07e5f 100644
--- a/drivers/iio/accel/kxcjk-1013.c
+++ b/drivers/iio/accel/kxcjk-1013.c
@@ -108,6 +108,7 @@ struct kxcjk1013_data {
 	bool motion_trigger_on;
 	int64_t timestamp;
 	enum kx_chipset chipset;
+	bool is_smo8500_device;
 };
 
 enum kxcjk1013_axis {
@@ -1129,12 +1130,15 @@ static irqreturn_t kxcjk1013_data_rdy_trig_poll(int irq, void *private)
 }
 
 static const char *kxcjk1013_match_acpi_device(struct device *dev,
-					       enum kx_chipset *chipset)
+					       enum kx_chipset *chipset,
+					       bool *is_smo8500_device)
 {
 	const struct acpi_device_id *id;
 	id = acpi_match_device(dev->driver->acpi_match_table, dev);
 	if (!id)
 		return NULL;
+	if (strcmp (id->id, "SMO8500") == 0)
+		*is_smo8500_device = true;
 	*chipset = (enum kx_chipset)id->driver_data;
 
 	return dev_name(dev);
@@ -1149,6 +1153,8 @@ static int kxcjk1013_gpio_probe(struct i2c_client *client,
 
 	if (!client)
 		return -EINVAL;
+	if (data->is_smo8500_device)
+		return -ENOTSUPP;
 
 	dev = &client->dev;
 
@@ -1198,7 +1204,8 @@ static int kxcjk1013_probe(struct i2c_client *client,
 		name = id->name;
 	} else if (ACPI_HANDLE(&client->dev)) {
 		name = kxcjk1013_match_acpi_device(&client->dev,
-						   &data->chipset);
+						   &data->chipset,
+						   &data->is_smo8500_device);
 	} else
 		return -ENODEV;
 
@@ -1397,6 +1404,7 @@ static const struct acpi_device_id kx_acpi_match[] = {
 	{"KXCJ1013", KXCJK1013},
 	{"KXCJ1008", KXCJ91008},
 	{"KXTJ1009", KXTJ21009},
+	{"SMO8500",  KXCJK1013},
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, kx_acpi_match);
@@ -1405,6 +1413,7 @@ static const struct i2c_device_id kxcjk1013_id[] = {
 	{"kxcjk1013", KXCJK1013},
 	{"kxcj91008", KXCJ91008},
 	{"kxtj21009", KXTJ21009},
+	{"SMO8500",   KXCJK1013},
 	{}
 };
 
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-11-03 23:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-09 17:19 [PATCH] iio:kxcjk-1013: Add support for SMO8500 device Bastien Nocera
2014-09-09 18:53 ` Daniel Baluta
2014-09-09 18:58   ` Bastien Nocera
2014-09-11 18:18   ` Bastien Nocera
2014-09-12 12:24     ` Daniel Baluta
2014-09-12 12:24       ` Bastien Nocera
2014-09-14 14:11         ` Jonathan Cameron
2014-09-25  8:49           ` Bastien Nocera
2014-09-25 12:47             ` Jonathan Cameron
2014-09-14 14:05 ` Jonathan Cameron
2014-11-03 23:07 Bastien Nocera

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.