Re: [PATCHv2 4/4] s5p-cec: add hpd-notifier support, move out of staging

2017-01-23 Thread Hans Verkuil
On 01/04/2017 09:44 AM, Andrzej Hajda wrote:
> On 03.01.2017 09:11, Hans Verkuil wrote:
>> On 01/03/2017 09:00 AM, Andrzej Hajda wrote:
>>> Is there a reason to split registration into two steps?
>>> Wouldn't be better to integrate hpd_notifier_get into
>>> cec_register_hpd_notifier.
>> One problem is that hpd_notifier_get can fail, whereas 
>> cec_register_hpd_notifier can't.
>> And I rather not have to register a CEC device only to unregister it again 
>> if the
>> hpd_notifier_get would fail.
> 
> hpd_notifier_get can fail only due to lack of memory for about 150 bytes
> so if it happens whole system will probably fail anyway :)
> 
> 
>>
>> Another reason is that this keeps the responsibility of the hpd_notifier 
>> life-time
>> handling in the driver instead of hiding it in the CEC framework, which is 
>> IMHO
>> unexpected.
> 
> Notifier is used only by CEC framework, so IMHO it would be desirable to
> put CEC specific things into CEC framework.

The CEC framework is just the first that needs it. But especially audio drivers 
also
want to use it. It was designed to help out both subsystems since both need the 
EDID/ELD.

Regards,

Hans

> Drivers duty is just to find notifier device.
> Leaving it as is will just put little more burden on drivers, so this is
> not big deal, do as you wish :)
> 
> Regards
> Andrzej
> 
>>
>> I think I want to keep this as-is, at least for now.
>>
>> Regards,
>>
>>  Hans
>>
>>
>>
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv2 4/4] s5p-cec: add hpd-notifier support, move out of staging

2017-01-04 Thread Andrzej Hajda
On 03.01.2017 09:11, Hans Verkuil wrote:
> On 01/03/2017 09:00 AM, Andrzej Hajda wrote:
>> Is there a reason to split registration into two steps?
>> Wouldn't be better to integrate hpd_notifier_get into
>> cec_register_hpd_notifier.
> One problem is that hpd_notifier_get can fail, whereas 
> cec_register_hpd_notifier can't.
> And I rather not have to register a CEC device only to unregister it again if 
> the
> hpd_notifier_get would fail.

hpd_notifier_get can fail only due to lack of memory for about 150 bytes
so if it happens whole system will probably fail anyway :)


>
> Another reason is that this keeps the responsibility of the hpd_notifier 
> life-time
> handling in the driver instead of hiding it in the CEC framework, which is 
> IMHO
> unexpected.

Notifier is used only by CEC framework, so IMHO it would be desirable to
put CEC specific things into CEC framework.
Drivers duty is just to find notifier device.
Leaving it as is will just put little more burden on drivers, so this is
not big deal, do as you wish :)

Regards
Andrzej

>
> I think I want to keep this as-is, at least for now.
>
> Regards,
>
>   Hans
>
>
>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv2 4/4] s5p-cec: add hpd-notifier support, move out of staging

2017-01-03 Thread Hans Verkuil
On 01/03/2017 09:00 AM, Andrzej Hajda wrote:
> On 02.01.2017 15:19, Hans Verkuil wrote:
>> From: Hans Verkuil 
>>
>> 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 documenting the new hdmi phandle and
>> update exynos4.dtsi accordingly.
>>
>> Tested with my Odroid U3.
>>
>> Signed-off-by: Hans Verkuil 
>> Tested-by: Marek Szyprowski 
>> ---
>>  .../devicetree/bindings/media/s5p-cec.txt  |  2 ++
>>  arch/arm/boot/dts/exynos4.dtsi |  1 +
>>  drivers/media/platform/Kconfig | 18 +++
>>  drivers/media/platform/Makefile|  1 +
>>  .../media => media/platform}/s5p-cec/Makefile  |  0
>>  .../platform}/s5p-cec/exynos_hdmi_cec.h|  0
>>  .../platform}/s5p-cec/exynos_hdmi_cecctrl.c|  0
>>  .../media => media/platform}/s5p-cec/regs-cec.h|  0
>>  .../media => media/platform}/s5p-cec/s5p_cec.c | 35 
>> ++
>>  .../media => media/platform}/s5p-cec/s5p_cec.h |  3 ++
>>  drivers/staging/media/Kconfig  |  2 --
>>  drivers/staging/media/Makefile |  1 -
>>  drivers/staging/media/s5p-cec/Kconfig  |  9 --
>>  drivers/staging/media/s5p-cec/TODO |  7 -
>>  14 files changed, 55 insertions(+), 24 deletions(-)
>>  rename drivers/{staging/media => media/platform}/s5p-cec/Makefile (100%)
>>  rename drivers/{staging/media => media/platform}/s5p-cec/exynos_hdmi_cec.h 
>> (100%)
>>  rename drivers/{staging/media => 
>> media/platform}/s5p-cec/exynos_hdmi_cecctrl.c (100%)
>>  rename drivers/{staging/media => media/platform}/s5p-cec/regs-cec.h (100%)
>>  rename drivers/{staging/media => media/platform}/s5p-cec/s5p_cec.c (89%)
>>  rename drivers/{staging/media => media/platform}/s5p-cec/s5p_cec.h (97%)
>>  delete mode 100644 drivers/staging/media/s5p-cec/Kconfig
>>  delete mode 100644 drivers/staging/media/s5p-cec/TODO
>>
>> diff --git a/Documentation/devicetree/bindings/media/s5p-cec.txt 
>> b/Documentation/devicetree/bindings/media/s5p-cec.txt
>> index 925ab4d..710fc00 100644
>> --- a/Documentation/devicetree/bindings/media/s5p-cec.txt
>> +++ b/Documentation/devicetree/bindings/media/s5p-cec.txt
>> @@ -15,6 +15,7 @@ Required properties:
>>- clock-names : from common clock binding: must contain "hdmicec",
>>corresponding to entry in the clocks property.
>>- samsung,syscon-phandle - phandle to the PMU system controller
>> +  - samsung,hdmi-phandle - phandle to the HDMI controller
>>  
>>  Example:
>>  
>> @@ -25,6 +26,7 @@ hdmicec: cec@100B {
>>  clocks = < CLK_HDMI_CEC>;
>>  clock-names = "hdmicec";
>>  samsung,syscon-phandle = <_system_controller>;
>> +samsung,hdmi-phandle = <>;
>>  pinctrl-names = "default";
>>  pinctrl-0 = <_cec>;
>>  status = "okay";
>> diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
>> index c64737b..51dfcbb 100644
>> --- a/arch/arm/boot/dts/exynos4.dtsi
>> +++ b/arch/arm/boot/dts/exynos4.dtsi
>> @@ -762,6 +762,7 @@
>>  clocks = < CLK_HDMI_CEC>;
>>  clock-names = "hdmicec";
>>  samsung,syscon-phandle = <_system_controller>;
>> +samsung,hdmi-phandle = <>;
>>  pinctrl-names = "default";
>>  pinctrl-0 = <_cec>;
>>  status = "disabled";
>> diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
>> index d944421..cab1637 100644
>> --- a/drivers/media/platform/Kconfig
>> +++ b/drivers/media/platform/Kconfig
>> @@ -392,6 +392,24 @@ config VIDEO_TI_SC
>>  config VIDEO_TI_CSC
>>  tristate
>>  
>> +menuconfig V4L_CEC_DRIVERS
>> +bool "Platform HDMI CEC drivers"
>> +depends on MEDIA_CEC_SUPPORT
>> +
>> +if V4L_CEC_DRIVERS
>> +
>> +config VIDEO_SAMSUNG_S5P_CEC
>> +   tristate "Samsung S5P CEC driver"
>> +   depends on VIDEO_DEV && MEDIA_CEC_SUPPORT && (PLAT_S5P || 
>> ARCH_EXYNOS || COMPILE_TEST)
>> +   select HPD_NOTIFIERS
>> +   ---help---
>> + This is a driver for Samsung S5P 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
>>  bool "Media test drivers"
>>  depends on MEDIA_CAMERA_SUPPORT
>> diff --git a/drivers/media/platform/Makefile 
>> b/drivers/media/platform/Makefile
>> index 5b3cb27..ad3bf22 100644
>> --- a/drivers/media/platform/Makefile
>> +++ b/drivers/media/platform/Makefile
>> @@ -33,6 +33,7 @@ obj-$(CONFIG_VIDEO_SAMSUNG_S5P_JPEG)   += s5p-jpeg/
>>  obj-$(CONFIG_VIDEO_SAMSUNG_S5P_MFC) += 

Re: [PATCHv2 4/4] s5p-cec: add hpd-notifier support, move out of staging

2017-01-03 Thread Andrzej Hajda
On 02.01.2017 15:19, Hans Verkuil wrote:
> From: Hans Verkuil 
>
> 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 documenting the new hdmi phandle and
> update exynos4.dtsi accordingly.
>
> Tested with my Odroid U3.
>
> Signed-off-by: Hans Verkuil 
> Tested-by: Marek Szyprowski 
> ---
>  .../devicetree/bindings/media/s5p-cec.txt  |  2 ++
>  arch/arm/boot/dts/exynos4.dtsi |  1 +
>  drivers/media/platform/Kconfig | 18 +++
>  drivers/media/platform/Makefile|  1 +
>  .../media => media/platform}/s5p-cec/Makefile  |  0
>  .../platform}/s5p-cec/exynos_hdmi_cec.h|  0
>  .../platform}/s5p-cec/exynos_hdmi_cecctrl.c|  0
>  .../media => media/platform}/s5p-cec/regs-cec.h|  0
>  .../media => media/platform}/s5p-cec/s5p_cec.c | 35 
> ++
>  .../media => media/platform}/s5p-cec/s5p_cec.h |  3 ++
>  drivers/staging/media/Kconfig  |  2 --
>  drivers/staging/media/Makefile |  1 -
>  drivers/staging/media/s5p-cec/Kconfig  |  9 --
>  drivers/staging/media/s5p-cec/TODO |  7 -
>  14 files changed, 55 insertions(+), 24 deletions(-)
>  rename drivers/{staging/media => media/platform}/s5p-cec/Makefile (100%)
>  rename drivers/{staging/media => media/platform}/s5p-cec/exynos_hdmi_cec.h 
> (100%)
>  rename drivers/{staging/media => 
> media/platform}/s5p-cec/exynos_hdmi_cecctrl.c (100%)
>  rename drivers/{staging/media => media/platform}/s5p-cec/regs-cec.h (100%)
>  rename drivers/{staging/media => media/platform}/s5p-cec/s5p_cec.c (89%)
>  rename drivers/{staging/media => media/platform}/s5p-cec/s5p_cec.h (97%)
>  delete mode 100644 drivers/staging/media/s5p-cec/Kconfig
>  delete mode 100644 drivers/staging/media/s5p-cec/TODO
>
> diff --git a/Documentation/devicetree/bindings/media/s5p-cec.txt 
> b/Documentation/devicetree/bindings/media/s5p-cec.txt
> index 925ab4d..710fc00 100644
> --- a/Documentation/devicetree/bindings/media/s5p-cec.txt
> +++ b/Documentation/devicetree/bindings/media/s5p-cec.txt
> @@ -15,6 +15,7 @@ Required properties:
>- clock-names : from common clock binding: must contain "hdmicec",
> corresponding to entry in the clocks property.
>- samsung,syscon-phandle - phandle to the PMU system controller
> +  - samsung,hdmi-phandle - phandle to the HDMI controller
>  
>  Example:
>  
> @@ -25,6 +26,7 @@ hdmicec: cec@100B {
>   clocks = < CLK_HDMI_CEC>;
>   clock-names = "hdmicec";
>   samsung,syscon-phandle = <_system_controller>;
> + samsung,hdmi-phandle = <>;
>   pinctrl-names = "default";
>   pinctrl-0 = <_cec>;
>   status = "okay";
> diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
> index c64737b..51dfcbb 100644
> --- a/arch/arm/boot/dts/exynos4.dtsi
> +++ b/arch/arm/boot/dts/exynos4.dtsi
> @@ -762,6 +762,7 @@
>   clocks = < CLK_HDMI_CEC>;
>   clock-names = "hdmicec";
>   samsung,syscon-phandle = <_system_controller>;
> + samsung,hdmi-phandle = <>;
>   pinctrl-names = "default";
>   pinctrl-0 = <_cec>;
>   status = "disabled";
> diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
> index d944421..cab1637 100644
> --- a/drivers/media/platform/Kconfig
> +++ b/drivers/media/platform/Kconfig
> @@ -392,6 +392,24 @@ config VIDEO_TI_SC
>  config VIDEO_TI_CSC
>   tristate
>  
> +menuconfig V4L_CEC_DRIVERS
> + bool "Platform HDMI CEC drivers"
> + depends on MEDIA_CEC_SUPPORT
> +
> +if V4L_CEC_DRIVERS
> +
> +config VIDEO_SAMSUNG_S5P_CEC
> +   tristate "Samsung S5P CEC driver"
> +   depends on VIDEO_DEV && MEDIA_CEC_SUPPORT && (PLAT_S5P || ARCH_EXYNOS 
> || COMPILE_TEST)
> +   select HPD_NOTIFIERS
> +   ---help---
> + This is a driver for Samsung S5P 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
>   bool "Media test drivers"
>   depends on MEDIA_CAMERA_SUPPORT
> diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
> index 5b3cb27..ad3bf22 100644
> --- a/drivers/media/platform/Makefile
> +++ b/drivers/media/platform/Makefile
> @@ -33,6 +33,7 @@ obj-$(CONFIG_VIDEO_SAMSUNG_S5P_JPEG)+= s5p-jpeg/
>  obj-$(CONFIG_VIDEO_SAMSUNG_S5P_MFC)  += s5p-mfc/
>  
>  obj-$(CONFIG_VIDEO_SAMSUNG_S5P_G2D)  += s5p-g2d/
> +obj-$(CONFIG_VIDEO_SAMSUNG_S5P_CEC)  += s5p-cec/
>  

Re: [PATCHv2 4/4] s5p-cec: add hpd-notifier support, move out of staging

2017-01-02 Thread Krzysztof Kozlowski
On Mon, Jan 02, 2017 at 03:19:07PM +0100, Hans Verkuil wrote:
> From: Hans Verkuil 
> 
> 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 documenting the new hdmi phandle and
> update exynos4.dtsi accordingly.
> 
> Tested with my Odroid U3.
> 
> Signed-off-by: Hans Verkuil 
> Tested-by: Marek Szyprowski 
> ---
>  .../devicetree/bindings/media/s5p-cec.txt  |  2 ++
>  arch/arm/boot/dts/exynos4.dtsi |  1 +
>  drivers/media/platform/Kconfig | 18 +++
>  drivers/media/platform/Makefile|  1 +
>  .../media => media/platform}/s5p-cec/Makefile  |  0
>  .../platform}/s5p-cec/exynos_hdmi_cec.h|  0
>  .../platform}/s5p-cec/exynos_hdmi_cecctrl.c|  0
>  .../media => media/platform}/s5p-cec/regs-cec.h|  0
>  .../media => media/platform}/s5p-cec/s5p_cec.c | 35 
> ++
>  .../media => media/platform}/s5p-cec/s5p_cec.h |  3 ++
>  drivers/staging/media/Kconfig  |  2 --
>  drivers/staging/media/Makefile |  1 -
>  drivers/staging/media/s5p-cec/Kconfig  |  9 --
>  drivers/staging/media/s5p-cec/TODO |  7 -
>  14 files changed, 55 insertions(+), 24 deletions(-)
>  rename drivers/{staging/media => media/platform}/s5p-cec/Makefile (100%)
>  rename drivers/{staging/media => media/platform}/s5p-cec/exynos_hdmi_cec.h 
> (100%)
>  rename drivers/{staging/media => 
> media/platform}/s5p-cec/exynos_hdmi_cecctrl.c (100%)
>  rename drivers/{staging/media => media/platform}/s5p-cec/regs-cec.h (100%)
>  rename drivers/{staging/media => media/platform}/s5p-cec/s5p_cec.c (89%)
>  rename drivers/{staging/media => media/platform}/s5p-cec/s5p_cec.h (97%)
>  delete mode 100644 drivers/staging/media/s5p-cec/Kconfig
>  delete mode 100644 drivers/staging/media/s5p-cec/TODO
> 
> diff --git a/Documentation/devicetree/bindings/media/s5p-cec.txt 
> b/Documentation/devicetree/bindings/media/s5p-cec.txt
> index 925ab4d..710fc00 100644
> --- a/Documentation/devicetree/bindings/media/s5p-cec.txt
> +++ b/Documentation/devicetree/bindings/media/s5p-cec.txt
> @@ -15,6 +15,7 @@ Required properties:
>- clock-names : from common clock binding: must contain "hdmicec",
> corresponding to entry in the clocks property.
>- samsung,syscon-phandle - phandle to the PMU system controller
> +  - samsung,hdmi-phandle - phandle to the HDMI controller
>  
>  Example:
>  
> @@ -25,6 +26,7 @@ hdmicec: cec@100B {
>   clocks = < CLK_HDMI_CEC>;
>   clock-names = "hdmicec";
>   samsung,syscon-phandle = <_system_controller>;
> + samsung,hdmi-phandle = <>;
>   pinctrl-names = "default";
>   pinctrl-0 = <_cec>;
>   status = "okay";
> diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
> index c64737b..51dfcbb 100644
> --- a/arch/arm/boot/dts/exynos4.dtsi
> +++ b/arch/arm/boot/dts/exynos4.dtsi
> @@ -762,6 +762,7 @@
>   clocks = < CLK_HDMI_CEC>;
>   clock-names = "hdmicec";
>   samsung,syscon-phandle = <_system_controller>;
> + samsung,hdmi-phandle = <>;
>   pinctrl-names = "default";
>   pinctrl-0 = <_cec>;
>   status = "disabled";

DTS change has to be a separate patch. It should also go through
arm-soc/samsung-soc tree.

If it is a dependency, then I could provide a tag with it.

Best regards,
Krzysztof

> diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
> index d944421..cab1637 100644
> --- a/drivers/media/platform/Kconfig
> +++ b/drivers/media/platform/Kconfig
> @@ -392,6 +392,24 @@ config VIDEO_TI_SC
>  config VIDEO_TI_CSC
>   tristate
>  
> +menuconfig V4L_CEC_DRIVERS
> + bool "Platform HDMI CEC drivers"
> + depends on MEDIA_CEC_SUPPORT
> +
> +if V4L_CEC_DRIVERS
> +
> +config VIDEO_SAMSUNG_S5P_CEC
> +   tristate "Samsung S5P CEC driver"
> +   depends on VIDEO_DEV && MEDIA_CEC_SUPPORT && (PLAT_S5P || ARCH_EXYNOS 
> || COMPILE_TEST)
> +   select HPD_NOTIFIERS
> +   ---help---
> + This is a driver for Samsung S5P 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
>   bool "Media test drivers"
>   depends on MEDIA_CAMERA_SUPPORT
> diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
> index 5b3cb27..ad3bf22 100644
> --- a/drivers/media/platform/Makefile
> +++ b/drivers/media/platform/Makefile
> @@ -33,6 +33,7 @@ obj-$(CONFIG_VIDEO_SAMSUNG_S5P_JPEG)  

[PATCHv2 4/4] s5p-cec: add hpd-notifier support, move out of staging

2017-01-02 Thread Hans Verkuil
From: Hans Verkuil 

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 documenting the new hdmi phandle and
update exynos4.dtsi accordingly.

Tested with my Odroid U3.

Signed-off-by: Hans Verkuil 
Tested-by: Marek Szyprowski 
---
 .../devicetree/bindings/media/s5p-cec.txt  |  2 ++
 arch/arm/boot/dts/exynos4.dtsi |  1 +
 drivers/media/platform/Kconfig | 18 +++
 drivers/media/platform/Makefile|  1 +
 .../media => media/platform}/s5p-cec/Makefile  |  0
 .../platform}/s5p-cec/exynos_hdmi_cec.h|  0
 .../platform}/s5p-cec/exynos_hdmi_cecctrl.c|  0
 .../media => media/platform}/s5p-cec/regs-cec.h|  0
 .../media => media/platform}/s5p-cec/s5p_cec.c | 35 ++
 .../media => media/platform}/s5p-cec/s5p_cec.h |  3 ++
 drivers/staging/media/Kconfig  |  2 --
 drivers/staging/media/Makefile |  1 -
 drivers/staging/media/s5p-cec/Kconfig  |  9 --
 drivers/staging/media/s5p-cec/TODO |  7 -
 14 files changed, 55 insertions(+), 24 deletions(-)
 rename drivers/{staging/media => media/platform}/s5p-cec/Makefile (100%)
 rename drivers/{staging/media => media/platform}/s5p-cec/exynos_hdmi_cec.h 
(100%)
 rename drivers/{staging/media => media/platform}/s5p-cec/exynos_hdmi_cecctrl.c 
(100%)
 rename drivers/{staging/media => media/platform}/s5p-cec/regs-cec.h (100%)
 rename drivers/{staging/media => media/platform}/s5p-cec/s5p_cec.c (89%)
 rename drivers/{staging/media => media/platform}/s5p-cec/s5p_cec.h (97%)
 delete mode 100644 drivers/staging/media/s5p-cec/Kconfig
 delete mode 100644 drivers/staging/media/s5p-cec/TODO

diff --git a/Documentation/devicetree/bindings/media/s5p-cec.txt 
b/Documentation/devicetree/bindings/media/s5p-cec.txt
index 925ab4d..710fc00 100644
--- a/Documentation/devicetree/bindings/media/s5p-cec.txt
+++ b/Documentation/devicetree/bindings/media/s5p-cec.txt
@@ -15,6 +15,7 @@ Required properties:
   - clock-names : from common clock binding: must contain "hdmicec",
  corresponding to entry in the clocks property.
   - samsung,syscon-phandle - phandle to the PMU system controller
+  - samsung,hdmi-phandle - phandle to the HDMI controller
 
 Example:
 
@@ -25,6 +26,7 @@ hdmicec: cec@100B {
clocks = < CLK_HDMI_CEC>;
clock-names = "hdmicec";
samsung,syscon-phandle = <_system_controller>;
+   samsung,hdmi-phandle = <>;
pinctrl-names = "default";
pinctrl-0 = <_cec>;
status = "okay";
diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index c64737b..51dfcbb 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -762,6 +762,7 @@
clocks = < CLK_HDMI_CEC>;
clock-names = "hdmicec";
samsung,syscon-phandle = <_system_controller>;
+   samsung,hdmi-phandle = <>;
pinctrl-names = "default";
pinctrl-0 = <_cec>;
status = "disabled";
diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index d944421..cab1637 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -392,6 +392,24 @@ config VIDEO_TI_SC
 config VIDEO_TI_CSC
tristate
 
+menuconfig V4L_CEC_DRIVERS
+   bool "Platform HDMI CEC drivers"
+   depends on MEDIA_CEC_SUPPORT
+
+if V4L_CEC_DRIVERS
+
+config VIDEO_SAMSUNG_S5P_CEC
+   tristate "Samsung S5P CEC driver"
+   depends on VIDEO_DEV && MEDIA_CEC_SUPPORT && (PLAT_S5P || ARCH_EXYNOS 
|| COMPILE_TEST)
+   select HPD_NOTIFIERS
+   ---help---
+ This is a driver for Samsung S5P 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
bool "Media test drivers"
depends on MEDIA_CAMERA_SUPPORT
diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
index 5b3cb27..ad3bf22 100644
--- a/drivers/media/platform/Makefile
+++ b/drivers/media/platform/Makefile
@@ -33,6 +33,7 @@ obj-$(CONFIG_VIDEO_SAMSUNG_S5P_JPEG)  += s5p-jpeg/
 obj-$(CONFIG_VIDEO_SAMSUNG_S5P_MFC)+= s5p-mfc/
 
 obj-$(CONFIG_VIDEO_SAMSUNG_S5P_G2D)+= s5p-g2d/
+obj-$(CONFIG_VIDEO_SAMSUNG_S5P_CEC)+= s5p-cec/
 obj-$(CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC) += exynos-gsc/
 
 obj-$(CONFIG_VIDEO_STI_BDISP)  += sti/bdisp/
diff --git a/drivers/staging/media/s5p-cec/Makefile 
b/drivers/media/platform/s5p-cec/Makefile
similarity index 100%
rename from