Re: [PATCH v3 2/3] stih-cec: add HPD notifier support

2017-02-27 Thread Rob Herring
On Fri, Feb 17, 2017 at 11:46:51AM +0100, Benjamin Gaignard wrote:
> By using the HPD notifier framework there is no longer any reason
> to manually set the physical address. This was the one blocking
> issue that prevented this driver from going out of staging, so do
> this move as well.
> 
> Update the bindings documentation the new hdmi phandle.

Should be a separate commit, but it's fine unless you do another spin.

> 
> Signed-off-by: Benjamin Gaignard 
> Signed-off-by: Hans Verkuil 
> CC: devicet...@vger.kernel.org
> 
> version 3:
> - change hdmi phandle from "st,hdmi-handle" to "hdmi-handle"
> ---
>  .../devicetree/bindings/media/stih-cec.txt |   2 +

Acked-by: Rob Herring 

>  drivers/media/platform/Kconfig |  10 +
>  drivers/media/platform/Makefile|   1 +
>  drivers/media/platform/sti/cec/Makefile|   1 +
>  drivers/media/platform/sti/cec/stih-cec.c  | 404 
> +
>  drivers/staging/media/Kconfig  |   2 -
>  drivers/staging/media/Makefile |   1 -
>  drivers/staging/media/st-cec/Kconfig   |   8 -
>  drivers/staging/media/st-cec/Makefile  |   1 -
>  drivers/staging/media/st-cec/TODO  |   7 -
>  drivers/staging/media/st-cec/stih-cec.c| 379 ---
>  11 files changed, 418 insertions(+), 398 deletions(-)
>  create mode 100644 drivers/media/platform/sti/cec/Makefile
>  create mode 100644 drivers/media/platform/sti/cec/stih-cec.c
>  delete mode 100644 drivers/staging/media/st-cec/Kconfig
>  delete mode 100644 drivers/staging/media/st-cec/Makefile
>  delete mode 100644 drivers/staging/media/st-cec/TODO
>  delete mode 100644 drivers/staging/media/st-cec/stih-cec.c
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v3 2/3] stih-cec: add HPD notifier support

2017-02-17 Thread Benjamin Gaignard
By using the HPD notifier framework there is no longer any reason
to manually set the physical address. This was the one blocking
issue that prevented this driver from going out of staging, so do
this move as well.

Update the bindings documentation the new hdmi phandle.

Signed-off-by: Benjamin Gaignard 
Signed-off-by: Hans Verkuil 
CC: devicet...@vger.kernel.org

version 3:
- change hdmi phandle from "st,hdmi-handle" to "hdmi-handle"
---
 .../devicetree/bindings/media/stih-cec.txt |   2 +
 drivers/media/platform/Kconfig |  10 +
 drivers/media/platform/Makefile|   1 +
 drivers/media/platform/sti/cec/Makefile|   1 +
 drivers/media/platform/sti/cec/stih-cec.c  | 404 +
 drivers/staging/media/Kconfig  |   2 -
 drivers/staging/media/Makefile |   1 -
 drivers/staging/media/st-cec/Kconfig   |   8 -
 drivers/staging/media/st-cec/Makefile  |   1 -
 drivers/staging/media/st-cec/TODO  |   7 -
 drivers/staging/media/st-cec/stih-cec.c| 379 ---
 11 files changed, 418 insertions(+), 398 deletions(-)
 create mode 100644 drivers/media/platform/sti/cec/Makefile
 create mode 100644 drivers/media/platform/sti/cec/stih-cec.c
 delete mode 100644 drivers/staging/media/st-cec/Kconfig
 delete mode 100644 drivers/staging/media/st-cec/Makefile
 delete mode 100644 drivers/staging/media/st-cec/TODO
 delete mode 100644 drivers/staging/media/st-cec/stih-cec.c

diff --git a/Documentation/devicetree/bindings/media/stih-cec.txt 
b/Documentation/devicetree/bindings/media/stih-cec.txt
index 71c4b2f..1f7da58 100644
--- a/Documentation/devicetree/bindings/media/stih-cec.txt
+++ b/Documentation/devicetree/bindings/media/stih-cec.txt
@@ -9,6 +9,7 @@ Required properties:
  - pinctrl-names: Contains only one value - "default"
  - pinctrl-0: Specifies the pin control groups used for CEC hardware.
  - resets: Reference to a reset controller
+ - hdmi-handle: Phandle to the HDMI controller
 
 Example for STIH407:
 
@@ -22,4 +23,5 @@ sti-cec@094a087c {
pinctrl-names = "default";
pinctrl-0 = <_cec0_default>;
resets = < STIH407_LPM_SOFTRESET>;
+   hdmi-handle = <>;
 };
diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 9920726..46db8a3 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -422,6 +422,16 @@ config VIDEO_SAMSUNG_S5P_CEC
  CEC bus is present in the HDMI connector and enables communication
  between compatible devices.
 
+config VIDEO_STI_HDMI_CEC
+   tristate "STMicroelectronics STiH4xx HDMI CEC driver"
+   depends on VIDEO_DEV && MEDIA_CEC_SUPPORT && (ARCH_STI || COMPILE_TEST)
+   select HPD_NOTIFIER
+   ---help---
+ This is a driver for STIH4xx HDMI CEC interface. It uses the
+ generic CEC framework interface.
+ CEC bus is present in the HDMI connector and enables communication
+ between compatible devices.
+
 endif #V4L_CEC_DRIVERS
 
 menuconfig V4L_TEST_DRIVERS
diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
index ad3bf22..01b689c 100644
--- a/drivers/media/platform/Makefile
+++ b/drivers/media/platform/Makefile
@@ -39,6 +39,7 @@ obj-$(CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC)+= exynos-gsc/
 obj-$(CONFIG_VIDEO_STI_BDISP)  += sti/bdisp/
 obj-$(CONFIG_VIDEO_STI_HVA)+= sti/hva/
 obj-$(CONFIG_DVB_C8SECTPFE)+= sti/c8sectpfe/
+obj-$(CONFIG_VIDEO_STI_HDMI_CEC)   += sti/cec/
 
 obj-$(CONFIG_BLACKFIN)  += blackfin/
 
diff --git a/drivers/media/platform/sti/cec/Makefile 
b/drivers/media/platform/sti/cec/Makefile
new file mode 100644
index 000..f07905e
--- /dev/null
+++ b/drivers/media/platform/sti/cec/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_VIDEO_STI_HDMI_CEC) += stih-cec.o
diff --git a/drivers/media/platform/sti/cec/stih-cec.c 
b/drivers/media/platform/sti/cec/stih-cec.c
new file mode 100644
index 000..4242dad
--- /dev/null
+++ b/drivers/media/platform/sti/cec/stih-cec.c
@@ -0,0 +1,404 @@
+/*
+ * STIH4xx CEC driver
+ * Copyright (C) STMicroelectronic SA 2016
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#define CEC_NAME   "stih-cec"
+
+/* CEC registers  */
+#define CEC_CLK_DIV   0x0
+#define CEC_CTRL  0x4
+#define CEC_IRQ_CTRL  0x8
+#define CEC_STATUS0xC
+#define CEC_EXT_STATUS0x10
+#define CEC_TX_CTRL   0x14
+#define CEC_FREE_TIME_THRESH  0x18
+#define CEC_BIT_TOUT_THRESH