From: Jonathan Cameron <jic23@kernel.org>
To: Bastien Nocera <hadess@hadess.net>,
linux-iio@vger.kernel.org,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Daniel Baluta <daniel.baluta@intel.com>
Subject: Re: [PATCH v3] iio:kxcjk-1013: Add support for SMO8500 device
Date: Wed, 05 Nov 2014 14:38:41 +0000 [thread overview]
Message-ID: <545A3671.2010102@kernel.org> (raw)
In-Reply-To: <1415056822.4506.24.camel@hadess.net>
On 03/11/14 23:20, 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, 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.
>
> Signed-off-by: Bastien Nocera <hadess@hadess.net>
Looks fine to me, but I'd ideally like an ack / review from Srinivas as it's his
driver... (and/or Daniel)
>
> ---
>
> Changes from v1:
> - Rebase after driver changes
> - Stop checking for IRQ when not supported
>
> Changes from v2:
> - Fixed the space before the opening bracket
> - Added Sob line
> - Add version to the patch subject line ;)
>
> ---
> 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..3e966c2 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},
> {}
> };
>
>
next prev parent reply other threads:[~2014-11-05 14:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-03 23:20 [PATCH v3] iio:kxcjk-1013: Add support for SMO8500 device Bastien Nocera
2014-11-05 14:38 ` Jonathan Cameron [this message]
2014-11-05 15:22 ` Daniel Baluta
2014-11-05 15:28 ` Bastien Nocera
2014-11-05 15:46 ` Daniel Baluta
2014-11-05 15:47 ` Bastien Nocera
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=545A3671.2010102@kernel.org \
--to=jic23@kernel.org \
--cc=daniel.baluta@intel.com \
--cc=hadess@hadess.net \
--cc=linux-iio@vger.kernel.org \
--cc=srinivas.pandruvada@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox