iio: accel: mxc4005: Reset chip on probe() and resume()
authorHans de Goede <hdegoede@redhat.com>
Tue, 26 Mar 2024 11:37:00 +0000 (12:37 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 28 Mar 2024 13:05:46 +0000 (13:05 +0000)
commit6b8cffdc4a31e4a72f75ecd1bc13fbf0dafee390
treeaaa6e01e58df78983fed0a99a41f0e7fef228d75
parent57a1592784d622ecee0b71940c65429173996b33
iio: accel: mxc4005: Reset chip on probe() and resume()

On some designs the chip is not properly reset when powered up at boot or
after a suspend/resume cycle.

Use the sw-reset feature to ensure that the chip is in a clean state
after probe() / resume() and in the case of resume() restore the settings
(scale, trigger-enabled).

Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218578
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240326113700.56725-3-hdegoede@redhat.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/mxc4005.c