summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuoniu.Zhou <guoniu.zhou@nxp.com>2018-11-14 13:53:38 +0800
committerBryan O'Donoghue <bryan.odonoghue@linaro.org>2019-05-01 17:43:10 +0100
commit72218162f9cde5672593ff896042eecfb56fea50 (patch)
tree8ea9e623b9c63f2c05b8ad1232f6cc31ebbbb826
parentb5a71cf3c1363fdede96883da579dfa54d0e3b14 (diff)
MLK-20403: max9286: add hardware reset for max9286
Add hardware reset for max9286 before initialization Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com> (cherry picked from commit dfc5061564b7d13d875f46bb883fe2e88a91e475)
-rw-r--r--drivers/media/platform/imx8/max9286.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/media/platform/imx8/max9286.c b/drivers/media/platform/imx8/max9286.c
index 85fc9712c232..1b71c652873a 100644
--- a/drivers/media/platform/imx8/max9286.c
+++ b/drivers/media/platform/imx8/max9286.c
@@ -2470,6 +2470,14 @@ static void max9271_dump_registers(struct sensor_data *max9286_data, int index)
}
#endif
+static void max9286_hw_reset(struct sensor_data *max9286_data)
+{
+ gpio_set_value(max9286_data->pwn_gpio, 0);
+ udelay(200);
+ gpio_set_value(max9286_data->pwn_gpio, 1);
+ msleep(1);
+}
+
static int max9286_hardware_preinit(struct sensor_data *max9286_data)
{
u8 reg;
@@ -3216,6 +3224,8 @@ static int max9286_probe(struct i2c_client *client,
if (retval < 0)
return retval;
+ max9286_hw_reset(max9286_data);
+
clk_prepare_enable(max9286_data->sensor_clk);
max9286_data->i2c_client = client;