From: Shreeya Patel <shreeya.patel@collabora.com>
To: Dmitry Osipenko <dmitry.osipenko@collabora.com>,
jic23@kernel.org, lars@metafoo.de, robh+dt@kernel.org,
Zhigang.Shi@liteon.com, krisman@collabora.com
Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel@collabora.com,
alvaro.soliverez@collabora.com, andy.shevchenko@gmail.com,
digetx@gmail.com, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v6 2/2] iio: light: Add support for ltrf216a sensor
Date: Thu, 7 Jul 2022 04:18:02 +0530 [thread overview]
Message-ID: <f5e0a2a8-f206-e493-df7e-080ddec6a03f@collabora.com> (raw)
In-Reply-To: <60b6965b-7a14-8b7c-c9b9-c463fc0ad88c@collabora.com>
On 07/07/22 02:39, Dmitry Osipenko wrote:
> On 6/15/22 16:51, Shreeya Patel wrote:
>> +static int ltrf216a_probe(struct i2c_client *client)
>> +{
>> + struct ltrf216a_data *data;
>> + struct iio_dev *indio_dev;
>> + int ret;
>> +
>> + indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
>> + if (!indio_dev)
>> + return -ENOMEM;
>> +
>> + data = iio_priv(indio_dev);
>> + i2c_set_clientdata(client, indio_dev);
>> + data->client = client;
>> +
>> + mutex_init(&data->lock);
>> +
>> + indio_dev->info = <rf216a_info;
>> + indio_dev->name = LTRF216A_DRV_NAME;
>> + indio_dev->channels = ltrf216a_channels;
>> + indio_dev->num_channels = ARRAY_SIZE(ltrf216a_channels);
>> + indio_dev->modes = INDIO_DIRECT_MODE;
>> +
>> + /* reset sensor, chip fails to respond to this, so ignore any errors */
>> + ltrf216a_reset(indio_dev);
> Shouldn't SW resetting be done after enabling sensor? Perhaps that's why
> it fails to respond?
We tried to reset the device through i2c-tool to see if that works :-
(root@steamdeck ~)# i2cset -f 0 0x53 0x00 0x10
warning! This program can confuse your i2c bus, cause data loss and worse!
Dangerous! Writing to a serial eeprom on a memory dimm
may render your memory useless and make your system unbootable!
I will write to device file /dev/i2c-0, chip address 0x53,
data address 0x00, data 0x10, mode byte.
Continue? [y/n] y
error: write failed
(1)(b+)(root@steamdeck ~)#
But the problem here is that the light sensor resets itself
instantaneously while the i2c transaction is still in progress.
So it never replies with the proper stop bit that is expected at the end
of a transaction. Hence, we decided to ignore
the error.
Thanks,
Shreeya Patel
>
prev parent reply other threads:[~2022-07-06 22:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-15 13:51 [PATCH v6 0/2] Add LTRF216A Driver Shreeya Patel
2022-06-15 13:51 ` [PATCH v6 1/2] dt-bindings: Document ltrf216a light sensor bindings Shreeya Patel
2022-06-15 17:20 ` Rob Herring
2022-06-19 12:34 ` Jonathan Cameron
2022-06-19 12:57 ` Shreeya Patel
2022-06-15 13:51 ` [PATCH v6 2/2] iio: light: Add support for ltrf216a sensor Shreeya Patel
2022-06-15 16:32 ` Andy Shevchenko
2022-06-19 12:44 ` Jonathan Cameron
2022-07-06 20:52 ` Dmitry Osipenko
2022-07-06 20:52 ` Dmitry Osipenko
2022-07-06 20:59 ` Dmitry Osipenko
2022-07-06 21:00 ` Dmitry Osipenko
2022-07-06 21:09 ` Dmitry Osipenko
2022-07-06 22:48 ` Shreeya Patel [this message]
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=f5e0a2a8-f206-e493-df7e-080ddec6a03f@collabora.com \
--to=shreeya.patel@collabora.com \
--cc=Zhigang.Shi@liteon.com \
--cc=alvaro.soliverez@collabora.com \
--cc=andy.shevchenko@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=digetx@gmail.com \
--cc=dmitry.osipenko@collabora.com \
--cc=jic23@kernel.org \
--cc=kernel@collabora.com \
--cc=krisman@collabora.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=robh+dt@kernel.org \
/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