summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Green <andy.green@linaro.org>2015-06-28 15:28:05 +0800
committerAndy Green <andy.green@linaro.org>2015-06-28 15:28:21 +0800
commitd1d053e653a6c9e835149060c235f61317c30971 (patch)
tree0fc6c9b59151eafecbb08bc97980f6c6e2540cff
parentbe921534a664e6ba7e220c03be7085fbebd94968 (diff)
mmp dsi pxa1928 dt control of dsi mux
Signed-off-by: Andy Green <andy.green@linaro.org>
-rw-r--r--arch/arm64/boot/dts/pxa1928-helium.dts2
-rw-r--r--drivers/video/mmp/hw/mmp_dsi.c21
2 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm64/boot/dts/pxa1928-helium.dts b/arch/arm64/boot/dts/pxa1928-helium.dts
index 8ed2dc018c26..d4454df4096a 100644
--- a/arch/arm64/boot/dts/pxa1928-helium.dts
+++ b/arch/arm64/boot/dts/pxa1928-helium.dts
@@ -87,6 +87,8 @@
marvell,burst-mode = <0>;
marvell,hbp-en;
dsi_avdd-supply = <&buck3>;
+ /* uncomment this for DSI -> HS connector */
+ // sel-gpios = <&gpio 132 0>;
status = "okay";
};
diff --git a/drivers/video/mmp/hw/mmp_dsi.c b/drivers/video/mmp/hw/mmp_dsi.c
index 85118bfa725a..518a4bbd7380 100644
--- a/drivers/video/mmp/hw/mmp_dsi.c
+++ b/drivers/video/mmp/hw/mmp_dsi.c
@@ -37,6 +37,8 @@
#include <linux/slab.h>
#include <linux/regulator/consumer.h>
#include <video/mipi_display.h>
+#include <linux/of_gpio.h>
+
#include "mmp_ctrl.h"
#include "mmp_dsi.h"
@@ -1209,9 +1211,28 @@ static int mmp_dsi_probe_dt(struct platform_device *pdev, struct mmp_dsi *dsi)
struct device_node *np = pdev->dev.of_node;
u32 tmp;
int ret;
+ int gpio;
if(!np)
return -EINVAL;
+
+ gpio = of_get_named_gpio(np, "sel-gpios", 0);
+ if (!gpio_is_valid(gpio)) {
+ dev_info(&pdev->dev, "sel gpio get error %d\n", gpio);
+ } else {
+
+ dev_err(&pdev->dev, "gpio %d\n", gpio);
+
+ ret = gpio_request(gpio, NULL);
+ if (ret) {
+ dev_err(&pdev->dev, "gpio req fail %d\n", ret);
+
+ } else {
+ gpio_direction_output(gpio, 1);
+ gpio_free(gpio);
+ }
+ }
+
ret = of_property_read_string(np, "marvell,phy-name", &dsi->name);
if (ret < 0)
goto out;