[Armadeus-commitlog] armadeus branch, master, updated. armadeus-7.0-27-g71fb15913
Brought to you by:
sszy
|
From: Sébastien S. <ss...@us...> - 2018-11-27 11:11:09
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 71fb1591358b555c0d3a1ed1f41700bfa14393a9 (commit)
from 3a2b6d82d82fc8813f5a834f5b347d416d1e306c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 71fb1591358b555c0d3a1ed1f41700bfa14393a9
Author: Sébastien Szymanski <seb...@ar...>
Date: Tue Nov 27 12:10:01 2018 +0100
[LINUX] 4.9.legacy: adv7180: add reset pin control
-----------------------------------------------------------------------
Summary of changes:
...adeus-media-adv7180-add-reset-pin-control.patch | 76 ++++++++++++++++++++++
1 file changed, 76 insertions(+)
create mode 100644 patches/linux/4.9.mx6_legacy/0812-armadeus-media-adv7180-add-reset-pin-control.patch
diff --git a/patches/linux/4.9.mx6_legacy/0812-armadeus-media-adv7180-add-reset-pin-control.patch b/patches/linux/4.9.mx6_legacy/0812-armadeus-media-adv7180-add-reset-pin-control.patch
new file mode 100644
index 000000000..509260784
--- /dev/null
+++ b/patches/linux/4.9.mx6_legacy/0812-armadeus-media-adv7180-add-reset-pin-control.patch
@@ -0,0 +1,76 @@
+Index: linux-imx_4.9.11_1.0.0_ga/Documentation/devicetree/bindings/media/i2c/adv7180.txt
+===================================================================
+--- linux-imx_4.9.11_1.0.0_ga.orig/Documentation/devicetree/bindings/media/i2c/adv7180.txt
++++ linux-imx_4.9.11_1.0.0_ga/Documentation/devicetree/bindings/media/i2c/adv7180.txt
+@@ -18,6 +18,8 @@ Required Properties :
+ Optional Properties :
+ - powerdown-gpios: reference to the GPIO connected to the powerdown pin,
+ if any.
++- rest-gpios: reference to the GPIO connected to the reset pin,
++ if any.
+
+
+ Example:
+Index: linux-imx_4.9.11_1.0.0_ga/drivers/media/i2c/adv7180.c
+===================================================================
+--- linux-imx_4.9.11_1.0.0_ga.orig/drivers/media/i2c/adv7180.c
++++ linux-imx_4.9.11_1.0.0_ga/drivers/media/i2c/adv7180.c
+@@ -215,6 +215,7 @@ struct adv7180_state {
+ struct mutex mutex; /* mutual excl. when accessing chip */
+ int irq;
+ struct gpio_desc *pwdn_gpio;
++ struct gpio_desc *rstn_gpio;
+ v4l2_std_id curr_norm;
+ bool powered;
+ bool streaming;
+@@ -494,6 +495,19 @@ static void adv7180_set_power_pin(struct
+ }
+ }
+
++static void adv7180_set_reset_pin(struct adv7180_state *state, bool on)
++{
++ if (!state->rstn_gpio)
++ return;
++
++ if (on) {
++ gpiod_set_value_cansleep(state->rstn_gpio, 0);
++ usleep_range(5000, 10000);
++ } else {
++ gpiod_set_value_cansleep(state->rstn_gpio, 1);
++ }
++}
++
+ static int adv7180_set_power(struct adv7180_state *state, bool on)
+ {
+ u8 val;
+@@ -1248,6 +1262,7 @@ static int init_device(struct adv7180_st
+ mutex_lock(&state->mutex);
+
+ adv7180_set_power_pin(state, true);
++ adv7180_set_reset_pin(state, true);
+
+ adv7180_write(state, ADV7180_REG_PWR_MAN, ADV7180_PWR_MAN_RES);
+ usleep_range(5000, 10000);
+@@ -1326,6 +1341,14 @@ static int adv7180_probe(struct i2c_clie
+ return ret;
+ }
+
++ state->rstn_gpio = devm_gpiod_get_optional(&client->dev, "reset",
++ GPIOD_OUT_HIGH);
++ if (IS_ERR(state->rstn_gpio)) {
++ ret = PTR_ERR(state->rstn_gpio);
++ v4l_err(client, "request for reset pin failed: %d\n", ret);
++ return ret;
++ }
++
+ if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2) {
+ state->csi_client = i2c_new_dummy(client->adapter,
+ ADV7180_DEFAULT_CSI_I2C_ADDR);
+@@ -1417,6 +1440,7 @@ static int adv7180_remove(struct i2c_cli
+ if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2)
+ i2c_unregister_device(state->csi_client);
+
++ adv7180_set_reset_pin(state, false);
+ adv7180_set_power_pin(state, false);
+
+ mutex_destroy(&state->mutex);
hooks/post-receive
--
armadeus
|