mirror of
https://github.com/torvalds/linux.git
synced 2026-07-30 11:11:26 +02:00
media: mt9m114: Put sensor in reset on power down
Put the sensor back in reset on power down. Putting the sensor in reset reduces power-consumption by putting all the data / ctrl pins in High-Z mode. This helps save power on designs where the regulators may need to stay on while the sensor is powered down. This also ensures that the sensor is properly reset on power up, since now the sensor will see a reset high to low transition after the regulators have been turned on. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
84359d0a5e
commit
d6b6a23bb4
|
|
@ -2228,6 +2228,13 @@ static int mt9m114_power_on(struct mt9m114 *sensor)
|
|||
|
||||
static void mt9m114_power_off(struct mt9m114 *sensor)
|
||||
{
|
||||
unsigned int duration;
|
||||
|
||||
gpiod_set_value(sensor->reset, 1);
|
||||
/* Power off takes 10 clock cycles. Double it to be safe. */
|
||||
duration = DIV_ROUND_UP(2 * 10 * 1000000, clk_get_rate(sensor->clk));
|
||||
fsleep(duration);
|
||||
|
||||
clk_disable_unprepare(sensor->clk);
|
||||
regulator_bulk_disable(ARRAY_SIZE(sensor->supplies), sensor->supplies);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user