adv7604 and et8ek8 sensor drivers have mixed up logical and line level
for reset/powerdown signal. They call it a reset signal (it indeed
behaves like that), but drivers assert the reset to operate which is
clearly incorrect and relies on wrong ACTIVE_HIGH flag in the DTS.
People in discussions copy existing poor code and claim they can repeat
same mistake, so add a note to prevent that.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
static void adv76xx_reset(struct adv76xx_state *state)
{
if (state->reset_gpio) {
- /* ADV76XX can be reset by a low reset pulse of minimum 5 ms. */
+ /*
+ * Note: Misinterpretation of reset assertion - do not re-use
+ * this code. The reset pin is using incorrect (for a reset
+ * signal) logical level.
+ *
+ * ADV76XX can be reset by a low reset pulse of minimum 5 ms.
+ */
gpiod_set_value_cansleep(state->reset_gpio, 0);
usleep_range(5000, 10000);
gpiod_set_value_cansleep(state->reset_gpio, 1);
udelay(10); /* I wish this is a good value */
+ /*
+ * Note: Misinterpretation of reset assertion - do not re-use this code.
+ * The reset pin is using incorrect (for a reset signal) logical level.
+ */
gpiod_set_value(sensor->reset, 1);
msleep(5000 * 1000 / sensor->xclk_freq + 1); /* Wait 5000 cycles */