All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv5 00/11] video/exynos/sti/cec: add CEC notifier & use in drivers
@ 2017-03-29 14:15 ` Hans Verkuil
  0 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 14:15 UTC (permalink / raw)
  To: linux-media
  Cc: Daniel Vetter, Russell King, dri-devel, linux-samsung-soc,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard

From: Hans Verkuil <hans.verkuil@cisco.com>

This patch series adds the CEC physical address notifier code, based on
Russell's code:

https://patchwork.kernel.org/patch/9277043/

It adds support for it to the exynos_hdmi drm driver, adds support for
it to the CEC framework and finally adds support to the s5p-cec driver,
which now can be moved out of staging.

Also included is similar code for the STI platform, contributed by
Benjamin Gaignard.

Tested the exynos code with my Odroid U3 exynos4 devboard.

After discussions with Daniel Vetter and Russell King I have removed
the EDID/ELD/HPD connect/disconnect events from the notifier and now
just use it to report the CEC physical address. This also means that
it is now renamed to CEC notifier instead of HPD notifier and that
it is now in drivers/media. The block_notifier was dropped as well
and instead a simple callback is registered. This means that the
relationship between HDMI and CEC is now 1:1 and no longer 1:n, but
should this be needed in the future, then that can easily be added
back.

Daniel, regarding your suggestions here:

http://www.spinics.net/lists/dri-devel/msg133907.html

this patch series maps to your mail above as follows:

struct cec_pin == struct cec_notifier
cec_(un)register_pin == cec_notifier_get/put
cec_set_address == cec_notifier_set_phys_addr
cec_(un)register_callbacks == cec_notifier_(un)register

Comments are welcome. I'd like to get this in for the 4.12 kernel as
this is a missing piece needed to integrate CEC drivers.

Regards,

	Hans

Changes since v4:
- Dropped EDID/ELD/connect/disconnect support. Instead, just report the
  CEC physical address (and use INVALID when disconnecting).
- Since this is now completely CEC specific, move it to drivers/media
  and rename to cec-notifier.
- Drop block_notifier. Instead just set a callback for the notifier.
- Use 'hdmi-phandle' in the bindings for both exynos and sti. So no
  vendor prefix and 'hdmi-phandle' instead of 'hdmi-handle'.
- Make struct cec_notifier opaque. Add a helper function to get the
  physical address from a cec_notifier struct.
- Provide dummy functions in cec-notifier.h so it can be used when
  CONFIG_MEDIA_CEC_NOTIFIER is undefined.
- Don't select the CEC notifier in the HDMI drivers. It should only
  be enabled by actual CEC drivers.

Changes since v3:
- Added the STI patches
- Split the exynos4 binding patches in one for documentation and one
  for the dts change itself, also use the correct subject and CC to
  the correct mailinglists (I hope  )

Changes since v2:
- Split off the dts changes of the s5p-cec patch into a separate patch
- Renamed HPD_NOTIFIERS to HPD_NOTIFIER to be consistent with the name
  of the source.

Changes since v1:

Renamed HDMI notifier to HPD (hotplug detect) notifier since this code is
not HDMI specific, but is interesting for any video source that has to
deal with hotplug detect and EDID/ELD (HDMI, DVI, VGA, DP, ....).
Only the use with CEC adapters is HDMI specific, but the HPD notifier
is more generic.




Benjamin Gaignard (4):
  sti: hdmi: add CEC notifier support
  stih-cec.txt: document new hdmi phandle
  stih-cec: add CEC notifier support
  arm: sti: update sti-cec for CEC notifier support

Hans Verkuil (7):
  cec-edid: rename cec_get_edid_phys_addr
  media: add CEC notifier support
  cec: integrate CEC notifier support
  exynos_hdmi: add CEC notifier support
  ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi
  s5p-cec.txt: document the HDMI controller phandle
  s5p-cec: add cec-notifier support, move out of staging

 .../devicetree/bindings/media/s5p-cec.txt          |   2 +
 .../devicetree/bindings/media/stih-cec.txt         |   2 +
 MAINTAINERS                                        |   4 +-
 arch/arm/boot/dts/exynos4.dtsi                     |   1 +
 arch/arm/boot/dts/stih407-family.dtsi              |  12 ---
 arch/arm/boot/dts/stih410.dtsi                     |  13 +++
 drivers/gpu/drm/exynos/exynos_hdmi.c               |  20 +++-
 drivers/gpu/drm/sti/sti_hdmi.c                     |  11 ++
 drivers/gpu/drm/sti/sti_hdmi.h                     |   3 +
 drivers/media/Kconfig                              |   3 +
 drivers/media/Makefile                             |   4 +
 drivers/media/cec-edid.c                           |  15 ++-
 drivers/media/cec-notifier.c                       | 116 +++++++++++++++++++++
 drivers/media/cec/cec-core.c                       |  21 ++++
 drivers/media/i2c/adv7511.c                        |   5 +-
 drivers/media/i2c/adv7604.c                        |   3 +-
 drivers/media/i2c/adv7842.c                        |   2 +-
 drivers/media/platform/Kconfig                     |  28 +++++
 drivers/media/platform/Makefile                    |   2 +
 .../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 +
 .../st-cec => media/platform/sti/cec}/Makefile     |   0
 .../st-cec => media/platform/sti/cec}/stih-cec.c   |  31 +++++-
 drivers/media/platform/vivid/vivid-vid-cap.c       |   3 +-
 drivers/staging/media/Kconfig                      |   4 -
 drivers/staging/media/Makefile                     |   2 -
 drivers/staging/media/s5p-cec/Kconfig              |   9 --
 drivers/staging/media/s5p-cec/TODO                 |   7 --
 drivers/staging/media/st-cec/Kconfig               |   8 --
 drivers/staging/media/st-cec/TODO                  |   7 --
 include/media/cec-edid.h                           |  17 ++-
 include/media/cec-notifier.h                       |  93 +++++++++++++++++
 include/media/cec.h                                |   6 ++
 37 files changed, 421 insertions(+), 71 deletions(-)
 create mode 100644 drivers/media/cec-notifier.c
 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%)
 rename drivers/{staging/media/st-cec => media/platform/sti/cec}/Makefile (100%)
 rename drivers/{staging/media/st-cec => media/platform/sti/cec}/stih-cec.c (93%)
 delete mode 100644 drivers/staging/media/s5p-cec/Kconfig
 delete mode 100644 drivers/staging/media/s5p-cec/TODO
 delete mode 100644 drivers/staging/media/st-cec/Kconfig
 delete mode 100644 drivers/staging/media/st-cec/TODO
 create mode 100644 include/media/cec-notifier.h

-- 
2.11.0

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCHv5 00/11] video/exynos/sti/cec: add CEC notifier & use in drivers
@ 2017-03-29 14:15 ` Hans Verkuil
  0 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 14:15 UTC (permalink / raw)
  To: linux-media
  Cc: linux-samsung-soc, Russell King, Krzysztof Kozlowski,
	Javier Martinez Canillas, dri-devel, Daniel Vetter,
	Marek Szyprowski

From: Hans Verkuil <hans.verkuil@cisco.com>

This patch series adds the CEC physical address notifier code, based on
Russell's code:

https://patchwork.kernel.org/patch/9277043/

It adds support for it to the exynos_hdmi drm driver, adds support for
it to the CEC framework and finally adds support to the s5p-cec driver,
which now can be moved out of staging.

Also included is similar code for the STI platform, contributed by
Benjamin Gaignard.

Tested the exynos code with my Odroid U3 exynos4 devboard.

After discussions with Daniel Vetter and Russell King I have removed
the EDID/ELD/HPD connect/disconnect events from the notifier and now
just use it to report the CEC physical address. This also means that
it is now renamed to CEC notifier instead of HPD notifier and that
it is now in drivers/media. The block_notifier was dropped as well
and instead a simple callback is registered. This means that the
relationship between HDMI and CEC is now 1:1 and no longer 1:n, but
should this be needed in the future, then that can easily be added
back.

Daniel, regarding your suggestions here:

http://www.spinics.net/lists/dri-devel/msg133907.html

this patch series maps to your mail above as follows:

struct cec_pin == struct cec_notifier
cec_(un)register_pin == cec_notifier_get/put
cec_set_address == cec_notifier_set_phys_addr
cec_(un)register_callbacks == cec_notifier_(un)register

Comments are welcome. I'd like to get this in for the 4.12 kernel as
this is a missing piece needed to integrate CEC drivers.

Regards,

	Hans

Changes since v4:
- Dropped EDID/ELD/connect/disconnect support. Instead, just report the
  CEC physical address (and use INVALID when disconnecting).
- Since this is now completely CEC specific, move it to drivers/media
  and rename to cec-notifier.
- Drop block_notifier. Instead just set a callback for the notifier.
- Use 'hdmi-phandle' in the bindings for both exynos and sti. So no
  vendor prefix and 'hdmi-phandle' instead of 'hdmi-handle'.
- Make struct cec_notifier opaque. Add a helper function to get the
  physical address from a cec_notifier struct.
- Provide dummy functions in cec-notifier.h so it can be used when
  CONFIG_MEDIA_CEC_NOTIFIER is undefined.
- Don't select the CEC notifier in the HDMI drivers. It should only
  be enabled by actual CEC drivers.

Changes since v3:
- Added the STI patches
- Split the exynos4 binding patches in one for documentation and one
  for the dts change itself, also use the correct subject and CC to
  the correct mailinglists (I hope  )

Changes since v2:
- Split off the dts changes of the s5p-cec patch into a separate patch
- Renamed HPD_NOTIFIERS to HPD_NOTIFIER to be consistent with the name
  of the source.

Changes since v1:

Renamed HDMI notifier to HPD (hotplug detect) notifier since this code is
not HDMI specific, but is interesting for any video source that has to
deal with hotplug detect and EDID/ELD (HDMI, DVI, VGA, DP, ....).
Only the use with CEC adapters is HDMI specific, but the HPD notifier
is more generic.




Benjamin Gaignard (4):
  sti: hdmi: add CEC notifier support
  stih-cec.txt: document new hdmi phandle
  stih-cec: add CEC notifier support
  arm: sti: update sti-cec for CEC notifier support

Hans Verkuil (7):
  cec-edid: rename cec_get_edid_phys_addr
  media: add CEC notifier support
  cec: integrate CEC notifier support
  exynos_hdmi: add CEC notifier support
  ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi
  s5p-cec.txt: document the HDMI controller phandle
  s5p-cec: add cec-notifier support, move out of staging

 .../devicetree/bindings/media/s5p-cec.txt          |   2 +
 .../devicetree/bindings/media/stih-cec.txt         |   2 +
 MAINTAINERS                                        |   4 +-
 arch/arm/boot/dts/exynos4.dtsi                     |   1 +
 arch/arm/boot/dts/stih407-family.dtsi              |  12 ---
 arch/arm/boot/dts/stih410.dtsi                     |  13 +++
 drivers/gpu/drm/exynos/exynos_hdmi.c               |  20 +++-
 drivers/gpu/drm/sti/sti_hdmi.c                     |  11 ++
 drivers/gpu/drm/sti/sti_hdmi.h                     |   3 +
 drivers/media/Kconfig                              |   3 +
 drivers/media/Makefile                             |   4 +
 drivers/media/cec-edid.c                           |  15 ++-
 drivers/media/cec-notifier.c                       | 116 +++++++++++++++++++++
 drivers/media/cec/cec-core.c                       |  21 ++++
 drivers/media/i2c/adv7511.c                        |   5 +-
 drivers/media/i2c/adv7604.c                        |   3 +-
 drivers/media/i2c/adv7842.c                        |   2 +-
 drivers/media/platform/Kconfig                     |  28 +++++
 drivers/media/platform/Makefile                    |   2 +
 .../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 +
 .../st-cec => media/platform/sti/cec}/Makefile     |   0
 .../st-cec => media/platform/sti/cec}/stih-cec.c   |  31 +++++-
 drivers/media/platform/vivid/vivid-vid-cap.c       |   3 +-
 drivers/staging/media/Kconfig                      |   4 -
 drivers/staging/media/Makefile                     |   2 -
 drivers/staging/media/s5p-cec/Kconfig              |   9 --
 drivers/staging/media/s5p-cec/TODO                 |   7 --
 drivers/staging/media/st-cec/Kconfig               |   8 --
 drivers/staging/media/st-cec/TODO                  |   7 --
 include/media/cec-edid.h                           |  17 ++-
 include/media/cec-notifier.h                       |  93 +++++++++++++++++
 include/media/cec.h                                |   6 ++
 37 files changed, 421 insertions(+), 71 deletions(-)
 create mode 100644 drivers/media/cec-notifier.c
 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%)
 rename drivers/{staging/media/st-cec => media/platform/sti/cec}/Makefile (100%)
 rename drivers/{staging/media/st-cec => media/platform/sti/cec}/stih-cec.c (93%)
 delete mode 100644 drivers/staging/media/s5p-cec/Kconfig
 delete mode 100644 drivers/staging/media/s5p-cec/TODO
 delete mode 100644 drivers/staging/media/st-cec/Kconfig
 delete mode 100644 drivers/staging/media/st-cec/TODO
 create mode 100644 include/media/cec-notifier.h

-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCHv5 01/11] cec-edid: rename cec_get_edid_phys_addr
  2017-03-29 14:15 ` Hans Verkuil
  (?)
@ 2017-03-29 14:15 ` Hans Verkuil
  -1 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 14:15 UTC (permalink / raw)
  To: linux-media
  Cc: Daniel Vetter, Russell King, dri-devel, linux-samsung-soc,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

Rename cec_get_edid_phys_addr to cec_get_raw_edid_phys_addr.

Add a new cec_get_edid_phys_addr function that takes a struct edid pointer.

This reflects the fact that some drivers have a struct edid pointer and
others a u8 pointer to the raw edid data.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/cec-edid.c                     | 15 +++++++++++++--
 drivers/media/i2c/adv7511.c                  |  5 ++---
 drivers/media/i2c/adv7604.c                  |  3 ++-
 drivers/media/i2c/adv7842.c                  |  2 +-
 drivers/media/platform/vivid/vivid-vid-cap.c |  3 ++-
 include/media/cec-edid.h                     | 17 ++++++++++++++---
 6 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/drivers/media/cec-edid.c b/drivers/media/cec-edid.c
index 5719b991e340..d7b369f53831 100644
--- a/drivers/media/cec-edid.c
+++ b/drivers/media/cec-edid.c
@@ -21,6 +21,7 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <media/cec-edid.h>
+#include <drm/drm_edid.h>
 
 /*
  * This EDID is expected to be a CEA-861 compliant, which means that there are
@@ -82,8 +83,8 @@ static unsigned int cec_get_edid_spa_location(const u8 *edid, unsigned int size)
 	return 0;
 }
 
-u16 cec_get_edid_phys_addr(const u8 *edid, unsigned int size,
-			   unsigned int *offset)
+u16 cec_get_raw_edid_phys_addr(const u8 *edid, unsigned int size,
+			       unsigned int *offset)
 {
 	unsigned int loc = cec_get_edid_spa_location(edid, size);
 
@@ -93,6 +94,16 @@ u16 cec_get_edid_phys_addr(const u8 *edid, unsigned int size,
 		return CEC_PHYS_ADDR_INVALID;
 	return (edid[loc] << 8) | edid[loc + 1];
 }
+EXPORT_SYMBOL_GPL(cec_get_raw_edid_phys_addr);
+
+u16 cec_get_edid_phys_addr(const struct edid *edid)
+{
+	if (!edid || edid->extensions == 0)
+		return CEC_PHYS_ADDR_INVALID;
+
+	return cec_get_raw_edid_phys_addr((u8 *)edid,
+				EDID_LENGTH * (edid->extensions + 1), NULL);
+}
 EXPORT_SYMBOL_GPL(cec_get_edid_phys_addr);
 
 void cec_set_edid_phys_addr(u8 *edid, unsigned int size, u16 phys_addr)
diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c
index 8c9e28949ab1..4723e826804a 100644
--- a/drivers/media/i2c/adv7511.c
+++ b/drivers/media/i2c/adv7511.c
@@ -1712,9 +1712,8 @@ static bool adv7511_check_edid_status(struct v4l2_subdev *sd)
 
 		v4l2_dbg(1, debug, sd, "%s: edid complete with %d segment(s)\n", __func__, state->edid.segments);
 		state->edid.complete = true;
-		ed.phys_addr = cec_get_edid_phys_addr(state->edid.data,
-						      state->edid.segments * 256,
-						      NULL);
+		ed.phys_addr = cec_get_raw_edid_phys_addr(state->edid.data,
+				  state->edid.segments * 256, NULL);
 		/* report when we have all segments
 		   but report only for segment 0
 		 */
diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index d8bf435db86d..ac60c9116f9c 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -2305,7 +2305,8 @@ static int adv76xx_set_edid(struct v4l2_subdev *sd, struct v4l2_edid *edid)
 		edid->blocks = 2;
 		return -E2BIG;
 	}
-	pa = cec_get_edid_phys_addr(edid->edid, edid->blocks * 128, &spa_loc);
+	pa = cec_get_raw_edid_phys_addr(edid->edid,
+					edid->blocks * 128, &spa_loc);
 	err = cec_phys_addr_validate(pa, &pa, NULL);
 	if (err)
 		return err;
diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c
index 2d61f0cc2b5b..440870d1d988 100644
--- a/drivers/media/i2c/adv7842.c
+++ b/drivers/media/i2c/adv7842.c
@@ -802,7 +802,7 @@ static int edid_write_hdmi_segment(struct v4l2_subdev *sd, u8 port)
 	if (!state->hdmi_edid.present)
 		return 0;
 
-	pa = cec_get_edid_phys_addr(edid, 256, &spa_loc);
+	pa = cec_get_raw_edid_phys_addr(edid, 256, &spa_loc);
 	err = cec_phys_addr_validate(pa, &pa, NULL);
 	if (err)
 		return err;
diff --git a/drivers/media/platform/vivid/vivid-vid-cap.c b/drivers/media/platform/vivid/vivid-vid-cap.c
index 01419455e545..6a7310e212cf 100644
--- a/drivers/media/platform/vivid/vivid-vid-cap.c
+++ b/drivers/media/platform/vivid/vivid-vid-cap.c
@@ -1736,7 +1736,8 @@ int vidioc_s_edid(struct file *file, void *_fh,
 		edid->blocks = dev->edid_max_blocks;
 		return -E2BIG;
 	}
-	phys_addr = cec_get_edid_phys_addr(edid->edid, edid->blocks * 128, NULL);
+	phys_addr = cec_get_raw_edid_phys_addr(edid->edid,
+					       edid->blocks * 128, NULL);
 	ret = cec_phys_addr_validate(phys_addr, &phys_addr, NULL);
 	if (ret)
 		return ret;
diff --git a/include/media/cec-edid.h b/include/media/cec-edid.h
index bdf731ecba1a..46a1d383608e 100644
--- a/include/media/cec-edid.h
+++ b/include/media/cec-edid.h
@@ -27,7 +27,7 @@
 	((pa) >> 12), ((pa) >> 8) & 0xf, ((pa) >> 4) & 0xf, (pa) & 0xf
 
 /**
- * cec_get_edid_phys_addr() - find and return the physical address
+ * cec_get_raw_edid_phys_addr() - find and return the physical address
  *
  * @edid:	pointer to the EDID data
  * @size:	size in bytes of the EDID data
@@ -37,8 +37,19 @@
  *
  * Return: the physical address or CEC_PHYS_ADDR_INVALID if there is none.
  */
-u16 cec_get_edid_phys_addr(const u8 *edid, unsigned int size,
-			   unsigned int *offset);
+u16 cec_get_raw_edid_phys_addr(const u8 *edid, unsigned int size,
+			       unsigned int *offset);
+
+struct edid;
+
+/**
+ * cec_get_edid_phys_addr() - find and return the physical address
+ *
+ * @edid:	pointer to struct edid
+ *
+ * Return: the physical address or CEC_PHYS_ADDR_INVALID if there is none.
+ */
+u16 cec_get_edid_phys_addr(const struct edid *edid);
 
 /**
  * cec_set_edid_phys_addr() - find and set the physical address
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCHv5 02/11] media: add CEC notifier support
  2017-03-29 14:15 ` Hans Verkuil
  (?)
  (?)
@ 2017-03-29 14:15 ` Hans Verkuil
  -1 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 14:15 UTC (permalink / raw)
  To: linux-media
  Cc: Daniel Vetter, Russell King, dri-devel, linux-samsung-soc,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

Add support for CEC notifiers, which is used to convey CEC physical address
information from video drivers to their CEC counterpart driver(s).

Based on an earlier version from Russell King:

https://patchwork.kernel.org/patch/9277043/

The cec_notifier is a reference counted object containing the CEC physical address
state of a video device.

When a new notifier is registered the current state will be reported to
that notifier at registration time.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 MAINTAINERS                  |   4 +-
 drivers/media/Kconfig        |   3 ++
 drivers/media/Makefile       |   4 ++
 drivers/media/cec-notifier.c | 116 +++++++++++++++++++++++++++++++++++++++++++
 include/media/cec-notifier.h |  93 ++++++++++++++++++++++++++++++++++
 5 files changed, 219 insertions(+), 1 deletion(-)
 create mode 100644 drivers/media/cec-notifier.c
 create mode 100644 include/media/cec-notifier.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 83a42ef1d1a7..cfb2670aa372 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3066,7 +3066,7 @@ F:	drivers/net/ieee802154/cc2520.c
 F:	include/linux/spi/cc2520.h
 F:	Documentation/devicetree/bindings/net/ieee802154/cc2520.txt
 
-CEC DRIVER
+CEC FRAMEWORK
 M:	Hans Verkuil <hans.verkuil@cisco.com>
 L:	linux-media@vger.kernel.org
 T:	git git://linuxtv.org/media_tree.git
@@ -3076,9 +3076,11 @@ F:	Documentation/media/kapi/cec-core.rst
 F:	Documentation/media/uapi/cec
 F:	drivers/media/cec/
 F:	drivers/media/cec-edid.c
+F:	drivers/media/cec-notifier.c
 F:	drivers/media/rc/keymaps/rc-cec.c
 F:	include/media/cec.h
 F:	include/media/cec-edid.h
+F:	include/media/cec-notifier.h
 F:	include/uapi/linux/cec.h
 F:	include/uapi/linux/cec-funcs.h
 
diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig
index 3512316e7a46..799429f51d1a 100644
--- a/drivers/media/Kconfig
+++ b/drivers/media/Kconfig
@@ -99,6 +99,9 @@ config MEDIA_CEC_DEBUG
 config MEDIA_CEC_EDID
 	bool
 
+config MEDIA_CEC_NOTIFIER
+	bool
+
 #
 # Media controller
 #	Selectable only for webcam/grabbers, as other drivers don't use it
diff --git a/drivers/media/Makefile b/drivers/media/Makefile
index d87ccb8eeabe..8b36a571d443 100644
--- a/drivers/media/Makefile
+++ b/drivers/media/Makefile
@@ -6,6 +6,10 @@ ifeq ($(CONFIG_MEDIA_CEC_EDID),y)
   obj-$(CONFIG_MEDIA_SUPPORT) += cec-edid.o
 endif
 
+ifeq ($(CONFIG_MEDIA_CEC_NOTIFIER),y)
+  obj-$(CONFIG_MEDIA_SUPPORT) += cec-notifier.o
+endif
+
 ifeq ($(CONFIG_MEDIA_CEC_SUPPORT),y)
   obj-$(CONFIG_MEDIA_SUPPORT) += cec/
 endif
diff --git a/drivers/media/cec-notifier.c b/drivers/media/cec-notifier.c
new file mode 100644
index 000000000000..a5938c4d3ab4
--- /dev/null
+++ b/drivers/media/cec-notifier.c
@@ -0,0 +1,116 @@
+/*
+ * cec-notifier.c - notify CEC drivers of physical address changes
+ *
+ * Copyright 2016 Russell King <rmk+kernel@arm.linux.org.uk>
+ * Copyright 2016-2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *
+ * This program is free software; you may redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <linux/export.h>
+#include <linux/string.h>
+#include <linux/slab.h>
+#include <linux/list.h>
+#include <linux/kref.h>
+
+#include <media/cec-notifier.h>
+
+struct cec_notifier {
+	struct mutex lock;
+	struct list_head head;
+	struct kref kref;
+	struct device *dev;
+	struct cec_adapter *cec_adap;
+	void (*callback)(struct cec_adapter *adap, u16 pa);
+
+	u16 phys_addr;
+};
+
+static LIST_HEAD(cec_notifiers);
+static DEFINE_MUTEX(cec_notifiers_lock);
+
+struct cec_notifier *cec_notifier_get(struct device *dev)
+{
+	struct cec_notifier *n;
+
+	mutex_lock(&cec_notifiers_lock);
+	list_for_each_entry(n, &cec_notifiers, head) {
+		if (n->dev == dev) {
+			mutex_unlock(&cec_notifiers_lock);
+			kref_get(&n->kref);
+			return n;
+		}
+	}
+	n = kzalloc(sizeof(*n), GFP_KERNEL);
+	if (!n)
+		goto unlock;
+	n->dev = dev;
+	n->phys_addr = CEC_PHYS_ADDR_INVALID;
+	mutex_init(&n->lock);
+	kref_init(&n->kref);
+	list_add_tail(&n->head, &cec_notifiers);
+unlock:
+	mutex_unlock(&cec_notifiers_lock);
+	return n;
+}
+EXPORT_SYMBOL_GPL(cec_notifier_get);
+
+static void cec_notifier_release(struct kref *kref)
+{
+	struct cec_notifier *n =
+		container_of(kref, struct cec_notifier, kref);
+
+	list_del(&n->head);
+	kfree(n);
+}
+
+void cec_notifier_put(struct cec_notifier *n)
+{
+	mutex_lock(&cec_notifiers_lock);
+	kref_put(&n->kref, cec_notifier_release);
+	mutex_unlock(&cec_notifiers_lock);
+}
+EXPORT_SYMBOL_GPL(cec_notifier_put);
+
+void cec_notifier_set_phys_addr(struct cec_notifier *n, u16 pa)
+{
+	mutex_lock(&n->lock);
+	n->phys_addr = pa;
+	if (n->callback)
+		n->callback(n->cec_adap, n->phys_addr);
+	mutex_unlock(&n->lock);
+}
+EXPORT_SYMBOL_GPL(cec_notifier_set_phys_addr);
+
+void cec_notifier_register(struct cec_notifier *n,
+			   struct cec_adapter *adap,
+			   void (*callback)(struct cec_adapter *adap, u16 pa))
+{
+	kref_get(&n->kref);
+	mutex_lock(&n->lock);
+	n->cec_adap = adap;
+	n->callback = callback;
+	n->callback(adap, n->phys_addr);
+	mutex_unlock(&n->lock);
+}
+EXPORT_SYMBOL_GPL(cec_notifier_register);
+
+void cec_notifier_unregister(struct cec_notifier *n)
+{
+	mutex_lock(&n->lock);
+	n->callback = NULL;
+	mutex_unlock(&n->lock);
+	cec_notifier_put(n);
+}
+EXPORT_SYMBOL_GPL(cec_notifier_unregister);
diff --git a/include/media/cec-notifier.h b/include/media/cec-notifier.h
new file mode 100644
index 000000000000..79ad3a48361c
--- /dev/null
+++ b/include/media/cec-notifier.h
@@ -0,0 +1,93 @@
+/*
+ * cec-notifier.h - notify CEC drivers of physical address changes
+ *
+ * Copyright 2016 Russell King <rmk+kernel@arm.linux.org.uk>
+ * Copyright 2016-2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+ *
+ * This program is free software; you may redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef LINUX_CEC_NOTIFIER_H
+#define LINUX_CEC_NOTIFIER_H
+
+#include <linux/types.h>
+#include <media/cec-edid.h>
+
+struct device;
+struct cec_adapter;
+struct cec_notifier;
+
+#ifdef CONFIG_MEDIA_CEC_NOTIFIER
+
+/**
+ * cec_notifier_get - find or create a new cec_notifier for the given device.
+ * @dev: device that sends the events.
+ *
+ * If a notifier for device @dev already exists, then increase the refcount
+ * and return that notifier.
+ *
+ * If it doesn't exist, then allocate a new notifier struct and return a
+ * pointer to that new struct.
+ *
+ * Return NULL if the memory could not be allocated.
+ */
+struct cec_notifier *cec_notifier_get(struct device *dev);
+
+/**
+ * cec_notifier_put - decrease refcount and delete when the refcount reaches 0.
+ * @n: notifier
+ */
+void cec_notifier_put(struct cec_notifier *n);
+
+/**
+ * cec_notifier_set_phys_addr - set a new physical address.
+ * @n: the CEC notifier
+ *
+ * Set a new CEC physical address.
+ */
+void cec_notifier_set_phys_addr(struct cec_notifier *n, u16 pa);
+
+/**
+ * cec_notifier_register - register a callback with the notifier
+ * @n: the CEC notifier
+ * @adap: the CEC adapter, passed as argument to the callback function
+ * @callback: the callback function
+ */
+void cec_notifier_register(struct cec_notifier *n,
+			   struct cec_adapter *adap,
+			   void (*callback)(struct cec_adapter *adap, u16 pa));
+
+/**
+ * cec_notifier_unregister - unregister the callback from the notifier.
+ * @n: the CEC notifier
+ */
+void cec_notifier_unregister(struct cec_notifier *n);
+
+#else
+static inline struct cec_notifier *cec_notifier_get(struct device *dev)
+{
+	/* A non-NULL pointer is expected on success */
+	return (struct cec_notifier *)0xdeadfeed;
+}
+
+static inline void cec_notifier_put(struct cec_notifier *n)
+{
+}
+
+static inline void cec_notifier_set_phys_addr(struct cec_notifier *n, u16 pa)
+{
+}
+#endif
+
+#endif
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCHv5 03/11] cec: integrate CEC notifier support
  2017-03-29 14:15 ` Hans Verkuil
                   ` (2 preceding siblings ...)
  (?)
@ 2017-03-29 14:15 ` Hans Verkuil
  2017-03-29 15:44     ` Hans Verkuil
  -1 siblings, 1 reply; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 14:15 UTC (permalink / raw)
  To: linux-media
  Cc: Daniel Vetter, Russell King, dri-devel, linux-samsung-soc,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

Support the CEC notifier framework, simplifying drivers that
depend on this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/media/cec/cec-core.c | 21 +++++++++++++++++++++
 include/media/cec.h          |  6 ++++++
 2 files changed, 27 insertions(+)

diff --git a/drivers/media/cec/cec-core.c b/drivers/media/cec/cec-core.c
index 37217e205040..2bab6e00b663 100644
--- a/drivers/media/cec/cec-core.c
+++ b/drivers/media/cec/cec-core.c
@@ -195,6 +195,23 @@ static void cec_devnode_unregister(struct cec_devnode *devnode)
 	put_device(&devnode->dev);
 }
 
+#ifdef CONFIG_MEDIA_CEC_NOTIFIER
+static void cec_cec_notify(struct cec_adapter *adap, u16 pa)
+{
+	cec_s_phys_addr(adap, pa, false);
+}
+
+void cec_register_cec_notifier(struct cec_adapter *adap,
+			       struct cec_notifier *notifier)
+{
+	if (WARN_ON(!adap->devnode.registered))
+		return;
+
+	cec_notifier_register(adap->notifier, adap, cec_cec_notify);
+}
+EXPORT_SYMBOL_GPL(cec_register_cec_notifier);
+#endif
+
 struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
 					 void *priv, const char *name, u32 caps,
 					 u8 available_las)
@@ -343,6 +360,10 @@ void cec_unregister_adapter(struct cec_adapter *adap)
 	adap->rc = NULL;
 #endif
 	debugfs_remove_recursive(adap->cec_dir);
+#ifdef CONFIG_MEDIA_CEC_NOTIFIER
+	if (adap->notifier)
+		cec_notifier_unregister(adap->notifier);
+#endif
 	cec_devnode_unregister(&adap->devnode);
 }
 EXPORT_SYMBOL_GPL(cec_unregister_adapter);
diff --git a/include/media/cec.h b/include/media/cec.h
index 96a0aa770d61..e6474b567a25 100644
--- a/include/media/cec.h
+++ b/include/media/cec.h
@@ -30,6 +30,7 @@
 #include <linux/cec-funcs.h>
 #include <media/rc-core.h>
 #include <media/cec-edid.h>
+#include <media/cec-notifier.h>
 
 /**
  * struct cec_devnode - cec device node
@@ -213,6 +214,11 @@ void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt,
 		       u8 nack_cnt, u8 low_drive_cnt, u8 error_cnt);
 void cec_received_msg(struct cec_adapter *adap, struct cec_msg *msg);
 
+#ifdef CONFIG_MEDIA_CEC_NOTIFIER
+void cec_register_cec_notifier(struct cec_adapter *adap,
+			       struct cec_notifier *notifier);
+#endif
+
 #else
 
 static inline int cec_register_adapter(struct cec_adapter *adap,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCHv5 04/11] exynos_hdmi: add CEC notifier support
  2017-03-29 14:15 ` Hans Verkuil
@ 2017-03-29 14:15   ` Hans Verkuil
  -1 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 14:15 UTC (permalink / raw)
  To: linux-media
  Cc: Daniel Vetter, Russell King, dri-devel, linux-samsung-soc,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

Implement the CEC notifier support to allow CEC drivers to
be informed when there is a new physical address.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_hdmi.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 88ccc0469316..2afc8b8052c2 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -43,6 +43,8 @@
 
 #include <drm/exynos_drm.h>
 
+#include <media/cec-notifier.h>
+
 #include "exynos_drm_drv.h"
 #include "exynos_drm_crtc.h"
 
@@ -119,6 +121,7 @@ struct hdmi_context {
 	bool				dvi_mode;
 	struct delayed_work		hotplug_work;
 	struct drm_display_mode		current_mode;
+	struct cec_notifier		*notifier;
 	const struct hdmi_driver_data	*drv_data;
 
 	void __iomem			*regs;
@@ -822,6 +825,7 @@ static enum drm_connector_status hdmi_detect(struct drm_connector *connector,
 	if (gpiod_get_value(hdata->hpd_gpio))
 		return connector_status_connected;
 
+	cec_notifier_set_phys_addr(hdata->notifier, CEC_PHYS_ADDR_INVALID);
 	return connector_status_disconnected;
 }
 
@@ -860,6 +864,8 @@ static int hdmi_get_modes(struct drm_connector *connector)
 		edid->width_cm, edid->height_cm);
 
 	drm_mode_connector_update_edid_property(connector, edid);
+	cec_notifier_set_phys_addr(hdata->notifier,
+				   cec_get_edid_phys_addr(edid));
 
 	ret = drm_add_edid_modes(connector, edid);
 
@@ -1503,6 +1509,7 @@ static void hdmi_disable(struct drm_encoder *encoder)
 	if (funcs && funcs->disable)
 		(*funcs->disable)(crtc);
 
+	cec_notifier_set_phys_addr(hdata->notifier, CEC_PHYS_ADDR_INVALID);
 	cancel_delayed_work(&hdata->hotplug_work);
 
 	hdmiphy_disable(hdata);
@@ -1878,15 +1885,22 @@ static int hdmi_probe(struct platform_device *pdev)
 		}
 	}
 
+	hdata->notifier = cec_notifier_get(&pdev->dev);
+	if (hdata->notifier == NULL) {
+		ret = -ENOMEM;
+		goto err_hdmiphy;
+	}
+
 	pm_runtime_enable(dev);
 
 	ret = component_add(&pdev->dev, &hdmi_component_ops);
 	if (ret)
-		goto err_disable_pm_runtime;
+		goto err_notifier_put;
 
 	return ret;
 
-err_disable_pm_runtime:
+err_notifier_put:
+	cec_notifier_put(hdata->notifier);
 	pm_runtime_disable(dev);
 
 err_hdmiphy:
@@ -1905,9 +1919,11 @@ static int hdmi_remove(struct platform_device *pdev)
 	struct hdmi_context *hdata = platform_get_drvdata(pdev);
 
 	cancel_delayed_work_sync(&hdata->hotplug_work);
+	cec_notifier_set_phys_addr(hdata->notifier, CEC_PHYS_ADDR_INVALID);
 
 	component_del(&pdev->dev, &hdmi_component_ops);
 
+	cec_notifier_put(hdata->notifier);
 	pm_runtime_disable(&pdev->dev);
 
 	if (!IS_ERR(hdata->reg_hdmi_en))
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCHv5 04/11] exynos_hdmi: add CEC notifier support
@ 2017-03-29 14:15   ` Hans Verkuil
  0 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 14:15 UTC (permalink / raw)
  To: linux-media
  Cc: linux-samsung-soc, Russell King, Krzysztof Kozlowski,
	Javier Martinez Canillas, Hans Verkuil, dri-devel, Daniel Vetter,
	Marek Szyprowski

From: Hans Verkuil <hans.verkuil@cisco.com>

Implement the CEC notifier support to allow CEC drivers to
be informed when there is a new physical address.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_hdmi.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 88ccc0469316..2afc8b8052c2 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -43,6 +43,8 @@
 
 #include <drm/exynos_drm.h>
 
+#include <media/cec-notifier.h>
+
 #include "exynos_drm_drv.h"
 #include "exynos_drm_crtc.h"
 
@@ -119,6 +121,7 @@ struct hdmi_context {
 	bool				dvi_mode;
 	struct delayed_work		hotplug_work;
 	struct drm_display_mode		current_mode;
+	struct cec_notifier		*notifier;
 	const struct hdmi_driver_data	*drv_data;
 
 	void __iomem			*regs;
@@ -822,6 +825,7 @@ static enum drm_connector_status hdmi_detect(struct drm_connector *connector,
 	if (gpiod_get_value(hdata->hpd_gpio))
 		return connector_status_connected;
 
+	cec_notifier_set_phys_addr(hdata->notifier, CEC_PHYS_ADDR_INVALID);
 	return connector_status_disconnected;
 }
 
@@ -860,6 +864,8 @@ static int hdmi_get_modes(struct drm_connector *connector)
 		edid->width_cm, edid->height_cm);
 
 	drm_mode_connector_update_edid_property(connector, edid);
+	cec_notifier_set_phys_addr(hdata->notifier,
+				   cec_get_edid_phys_addr(edid));
 
 	ret = drm_add_edid_modes(connector, edid);
 
@@ -1503,6 +1509,7 @@ static void hdmi_disable(struct drm_encoder *encoder)
 	if (funcs && funcs->disable)
 		(*funcs->disable)(crtc);
 
+	cec_notifier_set_phys_addr(hdata->notifier, CEC_PHYS_ADDR_INVALID);
 	cancel_delayed_work(&hdata->hotplug_work);
 
 	hdmiphy_disable(hdata);
@@ -1878,15 +1885,22 @@ static int hdmi_probe(struct platform_device *pdev)
 		}
 	}
 
+	hdata->notifier = cec_notifier_get(&pdev->dev);
+	if (hdata->notifier == NULL) {
+		ret = -ENOMEM;
+		goto err_hdmiphy;
+	}
+
 	pm_runtime_enable(dev);
 
 	ret = component_add(&pdev->dev, &hdmi_component_ops);
 	if (ret)
-		goto err_disable_pm_runtime;
+		goto err_notifier_put;
 
 	return ret;
 
-err_disable_pm_runtime:
+err_notifier_put:
+	cec_notifier_put(hdata->notifier);
 	pm_runtime_disable(dev);
 
 err_hdmiphy:
@@ -1905,9 +1919,11 @@ static int hdmi_remove(struct platform_device *pdev)
 	struct hdmi_context *hdata = platform_get_drvdata(pdev);
 
 	cancel_delayed_work_sync(&hdata->hotplug_work);
+	cec_notifier_set_phys_addr(hdata->notifier, CEC_PHYS_ADDR_INVALID);
 
 	component_del(&pdev->dev, &hdmi_component_ops);
 
+	cec_notifier_put(hdata->notifier);
 	pm_runtime_disable(&pdev->dev);
 
 	if (!IS_ERR(hdata->reg_hdmi_en))
-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCHv5 05/11] ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi
  2017-03-29 14:15 ` Hans Verkuil
                   ` (4 preceding siblings ...)
  (?)
@ 2017-03-29 14:15 ` Hans Verkuil
  2017-03-30 21:34   ` Krzysztof Kozlowski
  -1 siblings, 1 reply; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 14:15 UTC (permalink / raw)
  To: linux-media
  Cc: Daniel Vetter, Russell King, dri-devel, linux-samsung-soc,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil,
	devicetree

From: Hans Verkuil <hans.verkuil@cisco.com>

Add the new hdmi phandle to exynos4.dtsi. This phandle is needed by the
s5p-cec driver to initialize the CEC notifier framework.

Tested with my Odroid U3.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
CC: linux-samsung-soc@vger.kernel.org
CC: devicetree@vger.kernel.org
CC: Krzysztof Kozlowski <krzk@kernel.org>
---
 arch/arm/boot/dts/exynos4.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index 18def1c774d5..84fcdff140ae 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -771,6 +771,7 @@
 		clocks = <&clock CLK_HDMI_CEC>;
 		clock-names = "hdmicec";
 		samsung,syscon-phandle = <&pmu_system_controller>;
+		hdmi-phandle = <&hdmi>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&hdmi_cec>;
 		status = "disabled";
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCHv5 06/11] s5p-cec.txt: document the HDMI controller phandle
  2017-03-29 14:15 ` Hans Verkuil
@ 2017-03-29 14:15   ` Hans Verkuil
  -1 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 14:15 UTC (permalink / raw)
  To: linux-media
  Cc: devicetree, linux-samsung-soc, Russell King, Krzysztof Kozlowski,
	Javier Martinez Canillas, Hans Verkuil, dri-devel, Daniel Vetter,
	Marek Szyprowski

From: Hans Verkuil <hans.verkuil@cisco.com>

Update the bindings documenting the new hdmi phandle.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
CC: linux-samsung-soc@vger.kernel.org
CC: devicetree@vger.kernel.org
CC: Krzysztof Kozlowski <krzk@kernel.org>
---
 Documentation/devicetree/bindings/media/s5p-cec.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/s5p-cec.txt b/Documentation/devicetree/bindings/media/s5p-cec.txt
index 925ab4d72eaa..4bb08d9d940b 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
+  - hdmi-phandle - phandle to the HDMI controller
 
 Example:
 
@@ -25,6 +26,7 @@ hdmicec: cec@100B0000 {
 	clocks = <&clock CLK_HDMI_CEC>;
 	clock-names = "hdmicec";
 	samsung,syscon-phandle = <&pmu_system_controller>;
+	hdmi-phandle = <&hdmi>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&hdmi_cec>;
 	status = "okay";
-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCHv5 06/11] s5p-cec.txt: document the HDMI controller phandle
@ 2017-03-29 14:15   ` Hans Verkuil
  0 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 14:15 UTC (permalink / raw)
  To: linux-media
  Cc: Daniel Vetter, Russell King, dri-devel, linux-samsung-soc,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil,
	devicetree

From: Hans Verkuil <hans.verkuil@cisco.com>

Update the bindings documenting the new hdmi phandle.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
CC: linux-samsung-soc@vger.kernel.org
CC: devicetree@vger.kernel.org
CC: Krzysztof Kozlowski <krzk@kernel.org>
---
 Documentation/devicetree/bindings/media/s5p-cec.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/s5p-cec.txt b/Documentation/devicetree/bindings/media/s5p-cec.txt
index 925ab4d72eaa..4bb08d9d940b 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
+  - hdmi-phandle - phandle to the HDMI controller
 
 Example:
 
@@ -25,6 +26,7 @@ hdmicec: cec@100B0000 {
 	clocks = <&clock CLK_HDMI_CEC>;
 	clock-names = "hdmicec";
 	samsung,syscon-phandle = <&pmu_system_controller>;
+	hdmi-phandle = <&hdmi>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&hdmi_cec>;
 	status = "okay";
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCHv5 07/11] s5p-cec: add cec-notifier support, move out of staging
  2017-03-29 14:15 ` Hans Verkuil
                   ` (6 preceding siblings ...)
  (?)
@ 2017-03-29 14:15 ` Hans Verkuil
  2017-03-30 21:38   ` Krzysztof Kozlowski
  -1 siblings, 1 reply; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 14:15 UTC (permalink / raw)
  To: linux-media
  Cc: Daniel Vetter, Russell King, dri-devel, linux-samsung-soc,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil

From: Hans Verkuil <hans.verkuil@cisco.com>

By using the CEC 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 <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
CC: linux-samsung-soc@vger.kernel.org
CC: Krzysztof Kozlowski <krzk@kernel.org>
---
 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 -----
 12 files changed, 52 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/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index ab0bb4879b54..2c449b88fc94 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -460,6 +460,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 MEDIA_CEC_NOTIFIER
+       ---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 8959f6e6692a..2f94d82afa4c 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 drivers/staging/media/s5p-cec/Makefile
rename to drivers/media/platform/s5p-cec/Makefile
diff --git a/drivers/staging/media/s5p-cec/exynos_hdmi_cec.h b/drivers/media/platform/s5p-cec/exynos_hdmi_cec.h
similarity index 100%
rename from drivers/staging/media/s5p-cec/exynos_hdmi_cec.h
rename to drivers/media/platform/s5p-cec/exynos_hdmi_cec.h
diff --git a/drivers/staging/media/s5p-cec/exynos_hdmi_cecctrl.c b/drivers/media/platform/s5p-cec/exynos_hdmi_cecctrl.c
similarity index 100%
rename from drivers/staging/media/s5p-cec/exynos_hdmi_cecctrl.c
rename to drivers/media/platform/s5p-cec/exynos_hdmi_cecctrl.c
diff --git a/drivers/staging/media/s5p-cec/regs-cec.h b/drivers/media/platform/s5p-cec/regs-cec.h
similarity index 100%
rename from drivers/staging/media/s5p-cec/regs-cec.h
rename to drivers/media/platform/s5p-cec/regs-cec.h
diff --git a/drivers/staging/media/s5p-cec/s5p_cec.c b/drivers/media/platform/s5p-cec/s5p_cec.c
similarity index 89%
rename from drivers/staging/media/s5p-cec/s5p_cec.c
rename to drivers/media/platform/s5p-cec/s5p_cec.c
index 2a07968b5ac6..f7adf61caaa8 100644
--- a/drivers/staging/media/s5p-cec/s5p_cec.c
+++ b/drivers/media/platform/s5p-cec/s5p_cec.c
@@ -19,11 +19,14 @@
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/timer.h>
 #include <linux/workqueue.h>
 #include <media/cec.h>
+#include <media/cec-edid.h>
+#include <media/cec-notifier.h>
 
 #include "exynos_hdmi_cec.h"
 #include "regs-cec.h"
@@ -167,10 +170,22 @@ static const struct cec_adap_ops s5p_cec_adap_ops = {
 static int s5p_cec_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
+	struct device_node *np;
+	struct platform_device *hdmi_dev;
 	struct resource *res;
 	struct s5p_cec_dev *cec;
 	int ret;
 
+	np = of_parse_phandle(pdev->dev.of_node, "hdmi-phandle", 0);
+
+	if (!np) {
+		dev_err(&pdev->dev, "Failed to find hdmi node in device tree\n");
+		return -ENODEV;
+	}
+	hdmi_dev = of_find_device_by_node(np);
+	if (hdmi_dev == NULL)
+		return -EPROBE_DEFER;
+
 	cec = devm_kzalloc(&pdev->dev, sizeof(*cec), GFP_KERNEL);
 	if (!cec)
 		return -ENOMEM;
@@ -200,24 +215,33 @@ static int s5p_cec_probe(struct platform_device *pdev)
 	if (IS_ERR(cec->reg))
 		return PTR_ERR(cec->reg);
 
+	cec->notifier = cec_notifier_get(&hdmi_dev->dev);
+	if (cec->notifier == NULL)
+		return -ENOMEM;
+
 	cec->adap = cec_allocate_adapter(&s5p_cec_adap_ops, cec,
 		CEC_NAME,
-		CEC_CAP_PHYS_ADDR | CEC_CAP_LOG_ADDRS | CEC_CAP_TRANSMIT |
+		CEC_CAP_LOG_ADDRS | CEC_CAP_TRANSMIT |
 		CEC_CAP_PASSTHROUGH | CEC_CAP_RC, 1);
 	ret = PTR_ERR_OR_ZERO(cec->adap);
 	if (ret)
 		return ret;
+
 	ret = cec_register_adapter(cec->adap, &pdev->dev);
-	if (ret) {
-		cec_delete_adapter(cec->adap);
-		return ret;
-	}
+	if (ret)
+		goto err_delete_adapter;
+
+	cec_register_cec_notifier(cec->adap, cec->notifier);
 
 	platform_set_drvdata(pdev, cec);
 	pm_runtime_enable(dev);
 
 	dev_dbg(dev, "successfuly probed\n");
 	return 0;
+
+err_delete_adapter:
+	cec_delete_adapter(cec->adap);
+	return ret;
 }
 
 static int s5p_cec_remove(struct platform_device *pdev)
@@ -225,6 +249,7 @@ static int s5p_cec_remove(struct platform_device *pdev)
 	struct s5p_cec_dev *cec = platform_get_drvdata(pdev);
 
 	cec_unregister_adapter(cec->adap);
+	cec_notifier_put(cec->notifier);
 	pm_runtime_disable(&pdev->dev);
 	return 0;
 }
diff --git a/drivers/staging/media/s5p-cec/s5p_cec.h b/drivers/media/platform/s5p-cec/s5p_cec.h
similarity index 97%
rename from drivers/staging/media/s5p-cec/s5p_cec.h
rename to drivers/media/platform/s5p-cec/s5p_cec.h
index 03732c13d19f..7015845c1caa 100644
--- a/drivers/staging/media/s5p-cec/s5p_cec.h
+++ b/drivers/media/platform/s5p-cec/s5p_cec.h
@@ -59,12 +59,15 @@ enum cec_state {
 	STATE_ERROR
 };
 
+struct cec_notifier;
+
 struct s5p_cec_dev {
 	struct cec_adapter	*adap;
 	struct clk		*clk;
 	struct device		*dev;
 	struct mutex		lock;
 	struct regmap           *pmu;
+	struct cec_notifier	*notifier;
 	int			irq;
 	void __iomem		*reg;
 
diff --git a/drivers/staging/media/Kconfig b/drivers/staging/media/Kconfig
index abd0e2d57c20..c0d83cecf528 100644
--- a/drivers/staging/media/Kconfig
+++ b/drivers/staging/media/Kconfig
@@ -29,8 +29,6 @@ source "drivers/staging/media/omap4iss/Kconfig"
 
 source "drivers/staging/media/platform/bcm2835/Kconfig"
 
-source "drivers/staging/media/s5p-cec/Kconfig"
-
 # Keep LIRC at the end, as it has sub-menus
 source "drivers/staging/media/lirc/Kconfig"
 
diff --git a/drivers/staging/media/Makefile b/drivers/staging/media/Makefile
index dc89325c463d..97b29ece9a2c 100644
--- a/drivers/staging/media/Makefile
+++ b/drivers/staging/media/Makefile
@@ -1,5 +1,4 @@
 obj-$(CONFIG_I2C_BCM2048)	+= bcm2048/
-obj-$(CONFIG_VIDEO_SAMSUNG_S5P_CEC) += s5p-cec/
 obj-$(CONFIG_DVB_CXD2099)	+= cxd2099/
 obj-$(CONFIG_LIRC_STAGING)	+= lirc/
 obj-$(CONFIG_VIDEO_BCM2835)	+= platform/bcm2835/
diff --git a/drivers/staging/media/s5p-cec/Kconfig b/drivers/staging/media/s5p-cec/Kconfig
deleted file mode 100644
index 7a3489df3e70..000000000000
--- a/drivers/staging/media/s5p-cec/Kconfig
+++ /dev/null
@@ -1,9 +0,0 @@
-config VIDEO_SAMSUNG_S5P_CEC
-       tristate "Samsung S5P CEC driver"
-       depends on VIDEO_DEV && MEDIA_CEC_SUPPORT && (ARCH_EXYNOS || COMPILE_TEST)
-       ---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.
-
diff --git a/drivers/staging/media/s5p-cec/TODO b/drivers/staging/media/s5p-cec/TODO
deleted file mode 100644
index 64f21bab38f5..000000000000
--- a/drivers/staging/media/s5p-cec/TODO
+++ /dev/null
@@ -1,7 +0,0 @@
-This driver requires that userspace sets the physical address.
-However, this should be passed on from the corresponding
-Samsung HDMI driver.
-
-We have to wait until the HDMI notifier framework has been merged
-in order to handle this gracefully, until that time this driver
-has to remain in staging.
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCHv5 08/11] sti: hdmi: add CEC notifier support
  2017-03-29 14:15 ` Hans Verkuil
@ 2017-03-29 14:15   ` Hans Verkuil
  -1 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 14:15 UTC (permalink / raw)
  To: linux-media
  Cc: Daniel Vetter, Russell King, dri-devel, linux-samsung-soc,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil

From: Benjamin Gaignard <benjamin.gaignard@linaro.org>

Implement the CEC notifier support to allow CEC drivers to
be informed when there is a new physical address.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/gpu/drm/sti/sti_hdmi.c | 11 +++++++++++
 drivers/gpu/drm/sti/sti_hdmi.h |  3 +++
 2 files changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index ce2dcba679d5..345d3631cf50 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -771,6 +771,8 @@ static void sti_hdmi_disable(struct drm_bridge *bridge)
 	clk_disable_unprepare(hdmi->clk_pix);
 
 	hdmi->enabled = false;
+
+	cec_notifier_set_phys_addr(hdmi->notifier, CEC_PHYS_ADDR_INVALID);
 }
 
 /**
@@ -973,6 +975,7 @@ static int sti_hdmi_connector_get_modes(struct drm_connector *connector)
 	DRM_DEBUG_KMS("%s : %dx%d cm\n",
 		      (hdmi->hdmi_monitor ? "hdmi monitor" : "dvi monitor"),
 		      edid->width_cm, edid->height_cm);
+	cec_notifier_set_phys_addr(hdmi->notifier, cec_get_edid_phys_addr(edid));
 
 	count = drm_add_edid_modes(connector, edid);
 	drm_mode_connector_update_edid_property(connector, edid);
@@ -1035,6 +1038,7 @@ sti_hdmi_connector_detect(struct drm_connector *connector, bool force)
 	}
 
 	DRM_DEBUG_DRIVER("hdmi cable disconnected\n");
+	cec_notifier_set_phys_addr(hdmi->notifier, CEC_PHYS_ADDR_INVALID);
 	return connector_status_disconnected;
 }
 
@@ -1423,6 +1427,10 @@ static int sti_hdmi_probe(struct platform_device *pdev)
 		goto release_adapter;
 	}
 
+	hdmi->notifier = cec_notifier_get(&pdev->dev);
+	if (!hdmi->notifier)
+		goto release_adapter;
+
 	hdmi->reset = devm_reset_control_get(dev, "hdmi");
 	/* Take hdmi out of reset */
 	if (!IS_ERR(hdmi->reset))
@@ -1442,11 +1450,14 @@ static int sti_hdmi_remove(struct platform_device *pdev)
 {
 	struct sti_hdmi *hdmi = dev_get_drvdata(&pdev->dev);
 
+	cec_notifier_set_phys_addr(hdmi->notifier, CEC_PHYS_ADDR_INVALID);
+
 	i2c_put_adapter(hdmi->ddc_adapt);
 	if (hdmi->audio_pdev)
 		platform_device_unregister(hdmi->audio_pdev);
 	component_del(&pdev->dev, &sti_hdmi_ops);
 
+	cec_notifier_put(hdmi->notifier);
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/sti/sti_hdmi.h b/drivers/gpu/drm/sti/sti_hdmi.h
index 407012350f1a..c6469b56ce7e 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.h
+++ b/drivers/gpu/drm/sti/sti_hdmi.h
@@ -11,6 +11,7 @@
 #include <linux/platform_device.h>
 
 #include <drm/drmP.h>
+#include <media/cec-notifier.h>
 
 #define HDMI_STA           0x0010
 #define HDMI_STA_DLL_LCK   BIT(5)
@@ -64,6 +65,7 @@ static const struct drm_prop_enum_list colorspace_mode_names[] = {
  * @audio_pdev: ASoC hdmi-codec platform device
  * @audio: hdmi audio parameters.
  * @drm_connector: hdmi connector
+ * @notifier: hotplug detect notifier
  */
 struct sti_hdmi {
 	struct device dev;
@@ -89,6 +91,7 @@ struct sti_hdmi {
 	struct platform_device *audio_pdev;
 	struct hdmi_audio_params audio;
 	struct drm_connector *drm_connector;
+	struct cec_notifier *notifier;
 };
 
 u32 hdmi_read(struct sti_hdmi *hdmi, int offset);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCHv5 08/11] sti: hdmi: add CEC notifier support
@ 2017-03-29 14:15   ` Hans Verkuil
  0 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 14:15 UTC (permalink / raw)
  To: linux-media
  Cc: linux-samsung-soc, Russell King, Krzysztof Kozlowski,
	Javier Martinez Canillas, Hans Verkuil, dri-devel, Daniel Vetter,
	Marek Szyprowski

From: Benjamin Gaignard <benjamin.gaignard@linaro.org>

Implement the CEC notifier support to allow CEC drivers to
be informed when there is a new physical address.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/gpu/drm/sti/sti_hdmi.c | 11 +++++++++++
 drivers/gpu/drm/sti/sti_hdmi.h |  3 +++
 2 files changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c
index ce2dcba679d5..345d3631cf50 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.c
+++ b/drivers/gpu/drm/sti/sti_hdmi.c
@@ -771,6 +771,8 @@ static void sti_hdmi_disable(struct drm_bridge *bridge)
 	clk_disable_unprepare(hdmi->clk_pix);
 
 	hdmi->enabled = false;
+
+	cec_notifier_set_phys_addr(hdmi->notifier, CEC_PHYS_ADDR_INVALID);
 }
 
 /**
@@ -973,6 +975,7 @@ static int sti_hdmi_connector_get_modes(struct drm_connector *connector)
 	DRM_DEBUG_KMS("%s : %dx%d cm\n",
 		      (hdmi->hdmi_monitor ? "hdmi monitor" : "dvi monitor"),
 		      edid->width_cm, edid->height_cm);
+	cec_notifier_set_phys_addr(hdmi->notifier, cec_get_edid_phys_addr(edid));
 
 	count = drm_add_edid_modes(connector, edid);
 	drm_mode_connector_update_edid_property(connector, edid);
@@ -1035,6 +1038,7 @@ sti_hdmi_connector_detect(struct drm_connector *connector, bool force)
 	}
 
 	DRM_DEBUG_DRIVER("hdmi cable disconnected\n");
+	cec_notifier_set_phys_addr(hdmi->notifier, CEC_PHYS_ADDR_INVALID);
 	return connector_status_disconnected;
 }
 
@@ -1423,6 +1427,10 @@ static int sti_hdmi_probe(struct platform_device *pdev)
 		goto release_adapter;
 	}
 
+	hdmi->notifier = cec_notifier_get(&pdev->dev);
+	if (!hdmi->notifier)
+		goto release_adapter;
+
 	hdmi->reset = devm_reset_control_get(dev, "hdmi");
 	/* Take hdmi out of reset */
 	if (!IS_ERR(hdmi->reset))
@@ -1442,11 +1450,14 @@ static int sti_hdmi_remove(struct platform_device *pdev)
 {
 	struct sti_hdmi *hdmi = dev_get_drvdata(&pdev->dev);
 
+	cec_notifier_set_phys_addr(hdmi->notifier, CEC_PHYS_ADDR_INVALID);
+
 	i2c_put_adapter(hdmi->ddc_adapt);
 	if (hdmi->audio_pdev)
 		platform_device_unregister(hdmi->audio_pdev);
 	component_del(&pdev->dev, &sti_hdmi_ops);
 
+	cec_notifier_put(hdmi->notifier);
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/sti/sti_hdmi.h b/drivers/gpu/drm/sti/sti_hdmi.h
index 407012350f1a..c6469b56ce7e 100644
--- a/drivers/gpu/drm/sti/sti_hdmi.h
+++ b/drivers/gpu/drm/sti/sti_hdmi.h
@@ -11,6 +11,7 @@
 #include <linux/platform_device.h>
 
 #include <drm/drmP.h>
+#include <media/cec-notifier.h>
 
 #define HDMI_STA           0x0010
 #define HDMI_STA_DLL_LCK   BIT(5)
@@ -64,6 +65,7 @@ static const struct drm_prop_enum_list colorspace_mode_names[] = {
  * @audio_pdev: ASoC hdmi-codec platform device
  * @audio: hdmi audio parameters.
  * @drm_connector: hdmi connector
+ * @notifier: hotplug detect notifier
  */
 struct sti_hdmi {
 	struct device dev;
@@ -89,6 +91,7 @@ struct sti_hdmi {
 	struct platform_device *audio_pdev;
 	struct hdmi_audio_params audio;
 	struct drm_connector *drm_connector;
+	struct cec_notifier *notifier;
 };
 
 u32 hdmi_read(struct sti_hdmi *hdmi, int offset);
-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCHv5 09/11] stih-cec.txt: document new hdmi phandle
  2017-03-29 14:15 ` Hans Verkuil
                   ` (8 preceding siblings ...)
  (?)
@ 2017-03-29 14:15 ` Hans Verkuil
  -1 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 14:15 UTC (permalink / raw)
  To: linux-media
  Cc: Daniel Vetter, Russell King, dri-devel, linux-samsung-soc,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil,
	devicetree

From: Benjamin Gaignard <benjamin.gaignard@linaro.org>

Update the bindings documentation with the new hdmi phandle.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Rob Herring <robh@kernel.org>
CC: devicetree@vger.kernel.org
---
 Documentation/devicetree/bindings/media/stih-cec.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/media/stih-cec.txt b/Documentation/devicetree/bindings/media/stih-cec.txt
index 71c4b2f4bcef..289a08b33651 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-phandle: Phandle to the HDMI controller
 
 Example for STIH407:
 
@@ -22,4 +23,5 @@ sti-cec@094a087c {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_cec0_default>;
 	resets = <&softreset STIH407_LPM_SOFTRESET>;
+	hdmi-phandle = <&hdmi>;
 };
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCHv5 10/11] stih-cec: add CEC notifier support
  2017-03-29 14:15 ` Hans Verkuil
@ 2017-03-29 14:15   ` Hans Verkuil
  -1 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 14:15 UTC (permalink / raw)
  To: linux-media
  Cc: devicetree, linux-samsung-soc, Russell King, Krzysztof Kozlowski,
	Javier Martinez Canillas, Hans Verkuil, dri-devel, Daniel Vetter,
	Marek Szyprowski

From: Benjamin Gaignard <benjamin.gaignard@linaro.org>

By using the CEC 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.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
CC: devicetree@vger.kernel.org
---
 drivers/media/platform/Kconfig                     | 10 +++++++
 drivers/media/platform/Makefile                    |  1 +
 .../st-cec => media/platform/sti/cec}/Makefile     |  0
 .../st-cec => media/platform/sti/cec}/stih-cec.c   | 31 +++++++++++++++++++---
 drivers/staging/media/Kconfig                      |  2 --
 drivers/staging/media/Makefile                     |  1 -
 drivers/staging/media/st-cec/Kconfig               |  8 ------
 drivers/staging/media/st-cec/TODO                  |  7 -----
 8 files changed, 39 insertions(+), 21 deletions(-)
 rename drivers/{staging/media/st-cec => media/platform/sti/cec}/Makefile (100%)
 rename drivers/{staging/media/st-cec => media/platform/sti/cec}/stih-cec.c (93%)
 delete mode 100644 drivers/staging/media/st-cec/Kconfig
 delete mode 100644 drivers/staging/media/st-cec/TODO

diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 2c449b88fc94..7321f6123659 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -476,6 +476,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 MEDIA_CEC_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 2f94d82afa4c..940724ab9b70 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_VIDEO_STI_DELTA)		+= sti/delta/
 
diff --git a/drivers/staging/media/st-cec/Makefile b/drivers/media/platform/sti/cec/Makefile
similarity index 100%
rename from drivers/staging/media/st-cec/Makefile
rename to drivers/media/platform/sti/cec/Makefile
diff --git a/drivers/staging/media/st-cec/stih-cec.c b/drivers/media/platform/sti/cec/stih-cec.c
similarity index 93%
rename from drivers/staging/media/st-cec/stih-cec.c
rename to drivers/media/platform/sti/cec/stih-cec.c
index 3c25638a9610..636281c64c04 100644
--- a/drivers/staging/media/st-cec/stih-cec.c
+++ b/drivers/media/platform/sti/cec/stih-cec.c
@@ -1,6 +1,4 @@
 /*
- * drivers/staging/media/st-cec/stih-cec.c
- *
  * STIH4xx CEC driver
  * Copyright (C) STMicroelectronic SA 2016
  *
@@ -15,9 +13,11 @@
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 
 #include <media/cec.h>
+#include <media/cec-notifier.h>
 
 #define CEC_NAME	"stih-cec"
 
@@ -129,6 +129,7 @@ struct stih_cec {
 	void __iomem		*regs;
 	int			irq;
 	u32			irq_status;
+	struct cec_notifier	*notifier;
 };
 
 static int stih_cec_adap_enable(struct cec_adapter *adap, bool enable)
@@ -303,12 +304,29 @@ static int stih_cec_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct resource *res;
 	struct stih_cec *cec;
+	struct device_node *np;
+	struct platform_device *hdmi_dev;
 	int ret;
 
 	cec = devm_kzalloc(dev, sizeof(*cec), GFP_KERNEL);
 	if (!cec)
 		return -ENOMEM;
 
+	np = of_parse_phandle(pdev->dev.of_node, "hdmi-phandle", 0);
+
+	if (!np) {
+		dev_err(&pdev->dev, "Failed to find hdmi node in device tree\n");
+		return -ENODEV;
+	}
+
+	hdmi_dev = of_find_device_by_node(np);
+	if (!hdmi_dev)
+		return -EPROBE_DEFER;
+
+	cec->notifier = cec_notifier_get(&hdmi_dev->dev);
+	if (!cec->notifier)
+		return -ENOMEM;
+
 	cec->dev = dev;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -335,7 +353,7 @@ static int stih_cec_probe(struct platform_device *pdev)
 	cec->adap = cec_allocate_adapter(&sti_cec_adap_ops, cec,
 			CEC_NAME,
 			CEC_CAP_LOG_ADDRS | CEC_CAP_PASSTHROUGH |
-			CEC_CAP_PHYS_ADDR | CEC_CAP_TRANSMIT, 1);
+			CEC_CAP_TRANSMIT, 1);
 	ret = PTR_ERR_OR_ZERO(cec->adap);
 	if (ret)
 		return ret;
@@ -346,12 +364,19 @@ static int stih_cec_probe(struct platform_device *pdev)
 		return ret;
 	}
 
+	cec_register_cec_notifier(cec->adap, cec->notifier);
+
 	platform_set_drvdata(pdev, cec);
 	return 0;
 }
 
 static int stih_cec_remove(struct platform_device *pdev)
 {
+	struct stih_cec *cec = platform_get_drvdata(pdev);
+
+	cec_unregister_adapter(cec->adap);
+	cec_notifier_put(cec->notifier);
+
 	return 0;
 }
 
diff --git a/drivers/staging/media/Kconfig b/drivers/staging/media/Kconfig
index c0d83cecf528..8ed8202da57a 100644
--- a/drivers/staging/media/Kconfig
+++ b/drivers/staging/media/Kconfig
@@ -32,6 +32,4 @@ source "drivers/staging/media/platform/bcm2835/Kconfig"
 # Keep LIRC at the end, as it has sub-menus
 source "drivers/staging/media/lirc/Kconfig"
 
-source "drivers/staging/media/st-cec/Kconfig"
-
 endif
diff --git a/drivers/staging/media/Makefile b/drivers/staging/media/Makefile
index 97b29ece9a2c..3a6adeabede1 100644
--- a/drivers/staging/media/Makefile
+++ b/drivers/staging/media/Makefile
@@ -4,4 +4,3 @@ obj-$(CONFIG_LIRC_STAGING)	+= lirc/
 obj-$(CONFIG_VIDEO_BCM2835)	+= platform/bcm2835/
 obj-$(CONFIG_VIDEO_DM365_VPFE)	+= davinci_vpfe/
 obj-$(CONFIG_VIDEO_OMAP4)	+= omap4iss/
-obj-$(CONFIG_VIDEO_STI_HDMI_CEC) += st-cec/
diff --git a/drivers/staging/media/st-cec/Kconfig b/drivers/staging/media/st-cec/Kconfig
deleted file mode 100644
index c04283db58d6..000000000000
--- a/drivers/staging/media/st-cec/Kconfig
+++ /dev/null
@@ -1,8 +0,0 @@
-config VIDEO_STI_HDMI_CEC
-       tristate "STMicroelectronics STiH4xx HDMI CEC driver"
-       depends on VIDEO_DEV && MEDIA_CEC_SUPPORT && (ARCH_STI || COMPILE_TEST)
-       ---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.
diff --git a/drivers/staging/media/st-cec/TODO b/drivers/staging/media/st-cec/TODO
deleted file mode 100644
index c61289742c5c..000000000000
--- a/drivers/staging/media/st-cec/TODO
+++ /dev/null
@@ -1,7 +0,0 @@
-This driver requires that userspace sets the physical address.
-However, this should be passed on from the corresponding
-ST HDMI driver.
-
-We have to wait until the HDMI notifier framework has been merged
-in order to handle this gracefully, until that time this driver
-has to remain in staging.
-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCHv5 10/11] stih-cec: add CEC notifier support
@ 2017-03-29 14:15   ` Hans Verkuil
  0 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 14:15 UTC (permalink / raw)
  To: linux-media
  Cc: Daniel Vetter, Russell King, dri-devel, linux-samsung-soc,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil,
	devicetree

From: Benjamin Gaignard <benjamin.gaignard@linaro.org>

By using the CEC 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.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
CC: devicetree@vger.kernel.org
---
 drivers/media/platform/Kconfig                     | 10 +++++++
 drivers/media/platform/Makefile                    |  1 +
 .../st-cec => media/platform/sti/cec}/Makefile     |  0
 .../st-cec => media/platform/sti/cec}/stih-cec.c   | 31 +++++++++++++++++++---
 drivers/staging/media/Kconfig                      |  2 --
 drivers/staging/media/Makefile                     |  1 -
 drivers/staging/media/st-cec/Kconfig               |  8 ------
 drivers/staging/media/st-cec/TODO                  |  7 -----
 8 files changed, 39 insertions(+), 21 deletions(-)
 rename drivers/{staging/media/st-cec => media/platform/sti/cec}/Makefile (100%)
 rename drivers/{staging/media/st-cec => media/platform/sti/cec}/stih-cec.c (93%)
 delete mode 100644 drivers/staging/media/st-cec/Kconfig
 delete mode 100644 drivers/staging/media/st-cec/TODO

diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 2c449b88fc94..7321f6123659 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -476,6 +476,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 MEDIA_CEC_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 2f94d82afa4c..940724ab9b70 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_VIDEO_STI_DELTA)		+= sti/delta/
 
diff --git a/drivers/staging/media/st-cec/Makefile b/drivers/media/platform/sti/cec/Makefile
similarity index 100%
rename from drivers/staging/media/st-cec/Makefile
rename to drivers/media/platform/sti/cec/Makefile
diff --git a/drivers/staging/media/st-cec/stih-cec.c b/drivers/media/platform/sti/cec/stih-cec.c
similarity index 93%
rename from drivers/staging/media/st-cec/stih-cec.c
rename to drivers/media/platform/sti/cec/stih-cec.c
index 3c25638a9610..636281c64c04 100644
--- a/drivers/staging/media/st-cec/stih-cec.c
+++ b/drivers/media/platform/sti/cec/stih-cec.c
@@ -1,6 +1,4 @@
 /*
- * drivers/staging/media/st-cec/stih-cec.c
- *
  * STIH4xx CEC driver
  * Copyright (C) STMicroelectronic SA 2016
  *
@@ -15,9 +13,11 @@
 #include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
 
 #include <media/cec.h>
+#include <media/cec-notifier.h>
 
 #define CEC_NAME	"stih-cec"
 
@@ -129,6 +129,7 @@ struct stih_cec {
 	void __iomem		*regs;
 	int			irq;
 	u32			irq_status;
+	struct cec_notifier	*notifier;
 };
 
 static int stih_cec_adap_enable(struct cec_adapter *adap, bool enable)
@@ -303,12 +304,29 @@ static int stih_cec_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct resource *res;
 	struct stih_cec *cec;
+	struct device_node *np;
+	struct platform_device *hdmi_dev;
 	int ret;
 
 	cec = devm_kzalloc(dev, sizeof(*cec), GFP_KERNEL);
 	if (!cec)
 		return -ENOMEM;
 
+	np = of_parse_phandle(pdev->dev.of_node, "hdmi-phandle", 0);
+
+	if (!np) {
+		dev_err(&pdev->dev, "Failed to find hdmi node in device tree\n");
+		return -ENODEV;
+	}
+
+	hdmi_dev = of_find_device_by_node(np);
+	if (!hdmi_dev)
+		return -EPROBE_DEFER;
+
+	cec->notifier = cec_notifier_get(&hdmi_dev->dev);
+	if (!cec->notifier)
+		return -ENOMEM;
+
 	cec->dev = dev;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -335,7 +353,7 @@ static int stih_cec_probe(struct platform_device *pdev)
 	cec->adap = cec_allocate_adapter(&sti_cec_adap_ops, cec,
 			CEC_NAME,
 			CEC_CAP_LOG_ADDRS | CEC_CAP_PASSTHROUGH |
-			CEC_CAP_PHYS_ADDR | CEC_CAP_TRANSMIT, 1);
+			CEC_CAP_TRANSMIT, 1);
 	ret = PTR_ERR_OR_ZERO(cec->adap);
 	if (ret)
 		return ret;
@@ -346,12 +364,19 @@ static int stih_cec_probe(struct platform_device *pdev)
 		return ret;
 	}
 
+	cec_register_cec_notifier(cec->adap, cec->notifier);
+
 	platform_set_drvdata(pdev, cec);
 	return 0;
 }
 
 static int stih_cec_remove(struct platform_device *pdev)
 {
+	struct stih_cec *cec = platform_get_drvdata(pdev);
+
+	cec_unregister_adapter(cec->adap);
+	cec_notifier_put(cec->notifier);
+
 	return 0;
 }
 
diff --git a/drivers/staging/media/Kconfig b/drivers/staging/media/Kconfig
index c0d83cecf528..8ed8202da57a 100644
--- a/drivers/staging/media/Kconfig
+++ b/drivers/staging/media/Kconfig
@@ -32,6 +32,4 @@ source "drivers/staging/media/platform/bcm2835/Kconfig"
 # Keep LIRC at the end, as it has sub-menus
 source "drivers/staging/media/lirc/Kconfig"
 
-source "drivers/staging/media/st-cec/Kconfig"
-
 endif
diff --git a/drivers/staging/media/Makefile b/drivers/staging/media/Makefile
index 97b29ece9a2c..3a6adeabede1 100644
--- a/drivers/staging/media/Makefile
+++ b/drivers/staging/media/Makefile
@@ -4,4 +4,3 @@ obj-$(CONFIG_LIRC_STAGING)	+= lirc/
 obj-$(CONFIG_VIDEO_BCM2835)	+= platform/bcm2835/
 obj-$(CONFIG_VIDEO_DM365_VPFE)	+= davinci_vpfe/
 obj-$(CONFIG_VIDEO_OMAP4)	+= omap4iss/
-obj-$(CONFIG_VIDEO_STI_HDMI_CEC) += st-cec/
diff --git a/drivers/staging/media/st-cec/Kconfig b/drivers/staging/media/st-cec/Kconfig
deleted file mode 100644
index c04283db58d6..000000000000
--- a/drivers/staging/media/st-cec/Kconfig
+++ /dev/null
@@ -1,8 +0,0 @@
-config VIDEO_STI_HDMI_CEC
-       tristate "STMicroelectronics STiH4xx HDMI CEC driver"
-       depends on VIDEO_DEV && MEDIA_CEC_SUPPORT && (ARCH_STI || COMPILE_TEST)
-       ---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.
diff --git a/drivers/staging/media/st-cec/TODO b/drivers/staging/media/st-cec/TODO
deleted file mode 100644
index c61289742c5c..000000000000
--- a/drivers/staging/media/st-cec/TODO
+++ /dev/null
@@ -1,7 +0,0 @@
-This driver requires that userspace sets the physical address.
-However, this should be passed on from the corresponding
-ST HDMI driver.
-
-We have to wait until the HDMI notifier framework has been merged
-in order to handle this gracefully, until that time this driver
-has to remain in staging.
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCHv5 11/11] arm: sti: update sti-cec for CEC notifier support
  2017-03-29 14:15 ` Hans Verkuil
                   ` (10 preceding siblings ...)
  (?)
@ 2017-03-29 14:15 ` Hans Verkuil
  2017-03-30  7:41     ` Benjamin Gaignard
  -1 siblings, 1 reply; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 14:15 UTC (permalink / raw)
  To: linux-media
  Cc: Daniel Vetter, Russell King, dri-devel, linux-samsung-soc,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil,
	devicetree

From: Benjamin Gaignard <benjamin.gaignard@linaro.org>

To use CEC notifier sti CEC driver needs to get phandle
of the hdmi device.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
CC: devicetree@vger.kernel.org
---
 arch/arm/boot/dts/stih407-family.dtsi | 12 ------------
 arch/arm/boot/dts/stih410.dtsi        | 13 +++++++++++++
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/dts/stih407-family.dtsi b/arch/arm/boot/dts/stih407-family.dtsi
index d753ac36788f..044184580326 100644
--- a/arch/arm/boot/dts/stih407-family.dtsi
+++ b/arch/arm/boot/dts/stih407-family.dtsi
@@ -742,18 +742,6 @@
 				 <&clk_s_c0_flexgen CLK_ETH_PHY>;
 		};
 
-		cec: sti-cec@094a087c {
-			compatible = "st,stih-cec";
-			reg = <0x94a087c 0x64>;
-			clocks = <&clk_sysin>;
-			clock-names = "cec-clk";
-			interrupts = <GIC_SPI 140 IRQ_TYPE_NONE>;
-			interrupt-names = "cec-irq";
-			pinctrl-names = "default";
-			pinctrl-0 = <&pinctrl_cec0_default>;
-			resets = <&softreset STIH407_LPM_SOFTRESET>;
-		};
-
 		rng10: rng@08a89000 {
 			compatible      = "st,rng";
 			reg		= <0x08a89000 0x1000>;
diff --git a/arch/arm/boot/dts/stih410.dtsi b/arch/arm/boot/dts/stih410.dtsi
index 3c9672c5b09f..21fe72b183d8 100644
--- a/arch/arm/boot/dts/stih410.dtsi
+++ b/arch/arm/boot/dts/stih410.dtsi
@@ -281,5 +281,18 @@
 				 <&clk_s_c0_flexgen CLK_ST231_DMU>,
 				 <&clk_s_c0_flexgen CLK_FLASH_PROMIP>;
 		};
+
+		sti-cec@094a087c {
+			compatible = "st,stih-cec";
+			reg = <0x94a087c 0x64>;
+			clocks = <&clk_sysin>;
+			clock-names = "cec-clk";
+			interrupts = <GIC_SPI 140 IRQ_TYPE_NONE>;
+			interrupt-names = "cec-irq";
+			pinctrl-names = "default";
+			pinctrl-0 = <&pinctrl_cec0_default>;
+			resets = <&softreset STIH407_LPM_SOFTRESET>;
+			hdmi-phandle = <&sti_hdmi>;
+		};
 	};
 };
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCHv5.1 03/11] cec: integrate CEC notifier support
  2017-03-29 14:15 ` [PATCHv5 03/11] cec: integrate " Hans Verkuil
@ 2017-03-29 15:44     ` Hans Verkuil
  0 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 15:44 UTC (permalink / raw)
  To: linux-media
  Cc: Daniel Vetter, Russell King, dri-devel, linux-samsung-soc,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil

Support the CEC notifier framework, simplifying drivers that
depend on this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
Accidentally removed adap->notifier causing this to fail. Fixed this
stupid mistake.
---
 drivers/media/cec/cec-core.c | 22 ++++++++++++++++++++++
 include/media/cec.h          | 10 ++++++++++
 2 files changed, 32 insertions(+)

diff --git a/drivers/media/cec/cec-core.c b/drivers/media/cec/cec-core.c
index 37217e205040..e5070b374276 100644
--- a/drivers/media/cec/cec-core.c
+++ b/drivers/media/cec/cec-core.c
@@ -195,6 +195,24 @@ static void cec_devnode_unregister(struct cec_devnode *devnode)
 	put_device(&devnode->dev);
 }

+#ifdef CONFIG_MEDIA_CEC_NOTIFIER
+static void cec_cec_notify(struct cec_adapter *adap, u16 pa)
+{
+	cec_s_phys_addr(adap, pa, false);
+}
+
+void cec_register_cec_notifier(struct cec_adapter *adap,
+			       struct cec_notifier *notifier)
+{
+	if (WARN_ON(!adap->devnode.registered))
+		return;
+
+	adap->notifier = notifier;
+	cec_notifier_register(adap->notifier, adap, cec_cec_notify);
+}
+EXPORT_SYMBOL_GPL(cec_register_cec_notifier);
+#endif
+
 struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
 					 void *priv, const char *name, u32 caps,
 					 u8 available_las)
@@ -343,6 +361,10 @@ void cec_unregister_adapter(struct cec_adapter *adap)
 	adap->rc = NULL;
 #endif
 	debugfs_remove_recursive(adap->cec_dir);
+#ifdef CONFIG_MEDIA_CEC_NOTIFIER
+	if (adap->notifier)
+		cec_notifier_unregister(adap->notifier);
+#endif
 	cec_devnode_unregister(&adap->devnode);
 }
 EXPORT_SYMBOL_GPL(cec_unregister_adapter);
diff --git a/include/media/cec.h b/include/media/cec.h
index 96a0aa770d61..307f5dcaf034 100644
--- a/include/media/cec.h
+++ b/include/media/cec.h
@@ -30,6 +30,7 @@
 #include <linux/cec-funcs.h>
 #include <media/rc-core.h>
 #include <media/cec-edid.h>
+#include <media/cec-notifier.h>

 /**
  * struct cec_devnode - cec device node
@@ -173,6 +174,10 @@ struct cec_adapter {
 	bool passthrough;
 	struct cec_log_addrs log_addrs;

+#ifdef CONFIG_MEDIA_CEC_NOTIFIER
+	struct cec_notifier *notifier;
+#endif
+
 	struct dentry *cec_dir;
 	struct dentry *status_file;

@@ -213,6 +218,11 @@ void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt,
 		       u8 nack_cnt, u8 low_drive_cnt, u8 error_cnt);
 void cec_received_msg(struct cec_adapter *adap, struct cec_msg *msg);

+#ifdef CONFIG_MEDIA_CEC_NOTIFIER
+void cec_register_cec_notifier(struct cec_adapter *adap,
+			       struct cec_notifier *notifier);
+#endif
+
 #else

 static inline int cec_register_adapter(struct cec_adapter *adap,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCHv5.1 03/11] cec: integrate CEC notifier support
@ 2017-03-29 15:44     ` Hans Verkuil
  0 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 15:44 UTC (permalink / raw)
  To: linux-media
  Cc: linux-samsung-soc, Russell King, Krzysztof Kozlowski,
	Javier Martinez Canillas, Hans Verkuil, dri-devel, Daniel Vetter,
	Marek Szyprowski

Support the CEC notifier framework, simplifying drivers that
depend on this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
Accidentally removed adap->notifier causing this to fail. Fixed this
stupid mistake.
---
 drivers/media/cec/cec-core.c | 22 ++++++++++++++++++++++
 include/media/cec.h          | 10 ++++++++++
 2 files changed, 32 insertions(+)

diff --git a/drivers/media/cec/cec-core.c b/drivers/media/cec/cec-core.c
index 37217e205040..e5070b374276 100644
--- a/drivers/media/cec/cec-core.c
+++ b/drivers/media/cec/cec-core.c
@@ -195,6 +195,24 @@ static void cec_devnode_unregister(struct cec_devnode *devnode)
 	put_device(&devnode->dev);
 }

+#ifdef CONFIG_MEDIA_CEC_NOTIFIER
+static void cec_cec_notify(struct cec_adapter *adap, u16 pa)
+{
+	cec_s_phys_addr(adap, pa, false);
+}
+
+void cec_register_cec_notifier(struct cec_adapter *adap,
+			       struct cec_notifier *notifier)
+{
+	if (WARN_ON(!adap->devnode.registered))
+		return;
+
+	adap->notifier = notifier;
+	cec_notifier_register(adap->notifier, adap, cec_cec_notify);
+}
+EXPORT_SYMBOL_GPL(cec_register_cec_notifier);
+#endif
+
 struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
 					 void *priv, const char *name, u32 caps,
 					 u8 available_las)
@@ -343,6 +361,10 @@ void cec_unregister_adapter(struct cec_adapter *adap)
 	adap->rc = NULL;
 #endif
 	debugfs_remove_recursive(adap->cec_dir);
+#ifdef CONFIG_MEDIA_CEC_NOTIFIER
+	if (adap->notifier)
+		cec_notifier_unregister(adap->notifier);
+#endif
 	cec_devnode_unregister(&adap->devnode);
 }
 EXPORT_SYMBOL_GPL(cec_unregister_adapter);
diff --git a/include/media/cec.h b/include/media/cec.h
index 96a0aa770d61..307f5dcaf034 100644
--- a/include/media/cec.h
+++ b/include/media/cec.h
@@ -30,6 +30,7 @@
 #include <linux/cec-funcs.h>
 #include <media/rc-core.h>
 #include <media/cec-edid.h>
+#include <media/cec-notifier.h>

 /**
  * struct cec_devnode - cec device node
@@ -173,6 +174,10 @@ struct cec_adapter {
 	bool passthrough;
 	struct cec_log_addrs log_addrs;

+#ifdef CONFIG_MEDIA_CEC_NOTIFIER
+	struct cec_notifier *notifier;
+#endif
+
 	struct dentry *cec_dir;
 	struct dentry *status_file;

@@ -213,6 +218,11 @@ void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt,
 		       u8 nack_cnt, u8 low_drive_cnt, u8 error_cnt);
 void cec_received_msg(struct cec_adapter *adap, struct cec_msg *msg);

+#ifdef CONFIG_MEDIA_CEC_NOTIFIER
+void cec_register_cec_notifier(struct cec_adapter *adap,
+			       struct cec_notifier *notifier);
+#endif
+
 #else

 static inline int cec_register_adapter(struct cec_adapter *adap,
-- 
2.11.0


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 00/11] video/exynos/sti/cec: add CEC notifier & use in drivers
  2017-03-29 14:15 ` Hans Verkuil
@ 2017-03-29 15:55   ` Benjamin Gaignard
  -1 siblings, 0 replies; 40+ messages in thread
From: Benjamin Gaignard @ 2017-03-29 15:55 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: linux-media, Daniel Vetter, Russell King, dri-devel,
	moderated list:ARM/S5P EXYNOS AR...,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas

2017-03-29 16:15 GMT+02:00 Hans Verkuil <hverkuil@xs4all.nl>:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> This patch series adds the CEC physical address notifier code, based on
> Russell's code:
>
> https://patchwork.kernel.org/patch/9277043/
>
> It adds support for it to the exynos_hdmi drm driver, adds support for
> it to the CEC framework and finally adds support to the s5p-cec driver,
> which now can be moved out of staging.
>
> Also included is similar code for the STI platform, contributed by
> Benjamin Gaignard.
>
> Tested the exynos code with my Odroid U3 exynos4 devboard.
>
> After discussions with Daniel Vetter and Russell King I have removed
> the EDID/ELD/HPD connect/disconnect events from the notifier and now
> just use it to report the CEC physical address. This also means that
> it is now renamed to CEC notifier instead of HPD notifier and that
> it is now in drivers/media. The block_notifier was dropped as well
> and instead a simple callback is registered. This means that the
> relationship between HDMI and CEC is now 1:1 and no longer 1:n, but
> should this be needed in the future, then that can easily be added
> back.
>
> Daniel, regarding your suggestions here:
>
> http://www.spinics.net/lists/dri-devel/msg133907.html
>
> this patch series maps to your mail above as follows:
>
> struct cec_pin == struct cec_notifier
> cec_(un)register_pin == cec_notifier_get/put
> cec_set_address == cec_notifier_set_phys_addr
> cec_(un)register_callbacks == cec_notifier_(un)register
>
> Comments are welcome. I'd like to get this in for the 4.12 kernel as
> this is a missing piece needed to integrate CEC drivers.

I have been able to compile and test sti cec driver so you can add
my tested-by on this serie.

Thanks,

Benjamin

>
> Regards,
>
>         Hans
>
> Changes since v4:
> - Dropped EDID/ELD/connect/disconnect support. Instead, just report the
>   CEC physical address (and use INVALID when disconnecting).
> - Since this is now completely CEC specific, move it to drivers/media
>   and rename to cec-notifier.
> - Drop block_notifier. Instead just set a callback for the notifier.
> - Use 'hdmi-phandle' in the bindings for both exynos and sti. So no
>   vendor prefix and 'hdmi-phandle' instead of 'hdmi-handle'.
> - Make struct cec_notifier opaque. Add a helper function to get the
>   physical address from a cec_notifier struct.
> - Provide dummy functions in cec-notifier.h so it can be used when
>   CONFIG_MEDIA_CEC_NOTIFIER is undefined.
> - Don't select the CEC notifier in the HDMI drivers. It should only
>   be enabled by actual CEC drivers.
>
> Changes since v3:
> - Added the STI patches
> - Split the exynos4 binding patches in one for documentation and one
>   for the dts change itself, also use the correct subject and CC to
>   the correct mailinglists (I hope  )
>
> Changes since v2:
> - Split off the dts changes of the s5p-cec patch into a separate patch
> - Renamed HPD_NOTIFIERS to HPD_NOTIFIER to be consistent with the name
>   of the source.
>
> Changes since v1:
>
> Renamed HDMI notifier to HPD (hotplug detect) notifier since this code is
> not HDMI specific, but is interesting for any video source that has to
> deal with hotplug detect and EDID/ELD (HDMI, DVI, VGA, DP, ....).
> Only the use with CEC adapters is HDMI specific, but the HPD notifier
> is more generic.
>
>
>
>
> Benjamin Gaignard (4):
>   sti: hdmi: add CEC notifier support
>   stih-cec.txt: document new hdmi phandle
>   stih-cec: add CEC notifier support
>   arm: sti: update sti-cec for CEC notifier support
>
> Hans Verkuil (7):
>   cec-edid: rename cec_get_edid_phys_addr
>   media: add CEC notifier support
>   cec: integrate CEC notifier support
>   exynos_hdmi: add CEC notifier support
>   ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi
>   s5p-cec.txt: document the HDMI controller phandle
>   s5p-cec: add cec-notifier support, move out of staging
>
>  .../devicetree/bindings/media/s5p-cec.txt          |   2 +
>  .../devicetree/bindings/media/stih-cec.txt         |   2 +
>  MAINTAINERS                                        |   4 +-
>  arch/arm/boot/dts/exynos4.dtsi                     |   1 +
>  arch/arm/boot/dts/stih407-family.dtsi              |  12 ---
>  arch/arm/boot/dts/stih410.dtsi                     |  13 +++
>  drivers/gpu/drm/exynos/exynos_hdmi.c               |  20 +++-
>  drivers/gpu/drm/sti/sti_hdmi.c                     |  11 ++
>  drivers/gpu/drm/sti/sti_hdmi.h                     |   3 +
>  drivers/media/Kconfig                              |   3 +
>  drivers/media/Makefile                             |   4 +
>  drivers/media/cec-edid.c                           |  15 ++-
>  drivers/media/cec-notifier.c                       | 116 +++++++++++++++++++++
>  drivers/media/cec/cec-core.c                       |  21 ++++
>  drivers/media/i2c/adv7511.c                        |   5 +-
>  drivers/media/i2c/adv7604.c                        |   3 +-
>  drivers/media/i2c/adv7842.c                        |   2 +-
>  drivers/media/platform/Kconfig                     |  28 +++++
>  drivers/media/platform/Makefile                    |   2 +
>  .../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 +
>  .../st-cec => media/platform/sti/cec}/Makefile     |   0
>  .../st-cec => media/platform/sti/cec}/stih-cec.c   |  31 +++++-
>  drivers/media/platform/vivid/vivid-vid-cap.c       |   3 +-
>  drivers/staging/media/Kconfig                      |   4 -
>  drivers/staging/media/Makefile                     |   2 -
>  drivers/staging/media/s5p-cec/Kconfig              |   9 --
>  drivers/staging/media/s5p-cec/TODO                 |   7 --
>  drivers/staging/media/st-cec/Kconfig               |   8 --
>  drivers/staging/media/st-cec/TODO                  |   7 --
>  include/media/cec-edid.h                           |  17 ++-
>  include/media/cec-notifier.h                       |  93 +++++++++++++++++
>  include/media/cec.h                                |   6 ++
>  37 files changed, 421 insertions(+), 71 deletions(-)
>  create mode 100644 drivers/media/cec-notifier.c
>  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%)
>  rename drivers/{staging/media/st-cec => media/platform/sti/cec}/Makefile (100%)
>  rename drivers/{staging/media/st-cec => media/platform/sti/cec}/stih-cec.c (93%)
>  delete mode 100644 drivers/staging/media/s5p-cec/Kconfig
>  delete mode 100644 drivers/staging/media/s5p-cec/TODO
>  delete mode 100644 drivers/staging/media/st-cec/Kconfig
>  delete mode 100644 drivers/staging/media/st-cec/TODO
>  create mode 100644 include/media/cec-notifier.h
>
> --
> 2.11.0
>



-- 
Benjamin Gaignard

Graphic Study Group

Linaro.org │ Open source software for ARM SoCs

Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 00/11] video/exynos/sti/cec: add CEC notifier & use in drivers
@ 2017-03-29 15:55   ` Benjamin Gaignard
  0 siblings, 0 replies; 40+ messages in thread
From: Benjamin Gaignard @ 2017-03-29 15:55 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: moderated list:ARM/S5P EXYNOS AR...,
	Russell King, Krzysztof Kozlowski, Javier Martinez Canillas,
	dri-devel, Daniel Vetter, Marek Szyprowski, linux-media

2017-03-29 16:15 GMT+02:00 Hans Verkuil <hverkuil@xs4all.nl>:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> This patch series adds the CEC physical address notifier code, based on
> Russell's code:
>
> https://patchwork.kernel.org/patch/9277043/
>
> It adds support for it to the exynos_hdmi drm driver, adds support for
> it to the CEC framework and finally adds support to the s5p-cec driver,
> which now can be moved out of staging.
>
> Also included is similar code for the STI platform, contributed by
> Benjamin Gaignard.
>
> Tested the exynos code with my Odroid U3 exynos4 devboard.
>
> After discussions with Daniel Vetter and Russell King I have removed
> the EDID/ELD/HPD connect/disconnect events from the notifier and now
> just use it to report the CEC physical address. This also means that
> it is now renamed to CEC notifier instead of HPD notifier and that
> it is now in drivers/media. The block_notifier was dropped as well
> and instead a simple callback is registered. This means that the
> relationship between HDMI and CEC is now 1:1 and no longer 1:n, but
> should this be needed in the future, then that can easily be added
> back.
>
> Daniel, regarding your suggestions here:
>
> http://www.spinics.net/lists/dri-devel/msg133907.html
>
> this patch series maps to your mail above as follows:
>
> struct cec_pin == struct cec_notifier
> cec_(un)register_pin == cec_notifier_get/put
> cec_set_address == cec_notifier_set_phys_addr
> cec_(un)register_callbacks == cec_notifier_(un)register
>
> Comments are welcome. I'd like to get this in for the 4.12 kernel as
> this is a missing piece needed to integrate CEC drivers.

I have been able to compile and test sti cec driver so you can add
my tested-by on this serie.

Thanks,

Benjamin

>
> Regards,
>
>         Hans
>
> Changes since v4:
> - Dropped EDID/ELD/connect/disconnect support. Instead, just report the
>   CEC physical address (and use INVALID when disconnecting).
> - Since this is now completely CEC specific, move it to drivers/media
>   and rename to cec-notifier.
> - Drop block_notifier. Instead just set a callback for the notifier.
> - Use 'hdmi-phandle' in the bindings for both exynos and sti. So no
>   vendor prefix and 'hdmi-phandle' instead of 'hdmi-handle'.
> - Make struct cec_notifier opaque. Add a helper function to get the
>   physical address from a cec_notifier struct.
> - Provide dummy functions in cec-notifier.h so it can be used when
>   CONFIG_MEDIA_CEC_NOTIFIER is undefined.
> - Don't select the CEC notifier in the HDMI drivers. It should only
>   be enabled by actual CEC drivers.
>
> Changes since v3:
> - Added the STI patches
> - Split the exynos4 binding patches in one for documentation and one
>   for the dts change itself, also use the correct subject and CC to
>   the correct mailinglists (I hope  )
>
> Changes since v2:
> - Split off the dts changes of the s5p-cec patch into a separate patch
> - Renamed HPD_NOTIFIERS to HPD_NOTIFIER to be consistent with the name
>   of the source.
>
> Changes since v1:
>
> Renamed HDMI notifier to HPD (hotplug detect) notifier since this code is
> not HDMI specific, but is interesting for any video source that has to
> deal with hotplug detect and EDID/ELD (HDMI, DVI, VGA, DP, ....).
> Only the use with CEC adapters is HDMI specific, but the HPD notifier
> is more generic.
>
>
>
>
> Benjamin Gaignard (4):
>   sti: hdmi: add CEC notifier support
>   stih-cec.txt: document new hdmi phandle
>   stih-cec: add CEC notifier support
>   arm: sti: update sti-cec for CEC notifier support
>
> Hans Verkuil (7):
>   cec-edid: rename cec_get_edid_phys_addr
>   media: add CEC notifier support
>   cec: integrate CEC notifier support
>   exynos_hdmi: add CEC notifier support
>   ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi
>   s5p-cec.txt: document the HDMI controller phandle
>   s5p-cec: add cec-notifier support, move out of staging
>
>  .../devicetree/bindings/media/s5p-cec.txt          |   2 +
>  .../devicetree/bindings/media/stih-cec.txt         |   2 +
>  MAINTAINERS                                        |   4 +-
>  arch/arm/boot/dts/exynos4.dtsi                     |   1 +
>  arch/arm/boot/dts/stih407-family.dtsi              |  12 ---
>  arch/arm/boot/dts/stih410.dtsi                     |  13 +++
>  drivers/gpu/drm/exynos/exynos_hdmi.c               |  20 +++-
>  drivers/gpu/drm/sti/sti_hdmi.c                     |  11 ++
>  drivers/gpu/drm/sti/sti_hdmi.h                     |   3 +
>  drivers/media/Kconfig                              |   3 +
>  drivers/media/Makefile                             |   4 +
>  drivers/media/cec-edid.c                           |  15 ++-
>  drivers/media/cec-notifier.c                       | 116 +++++++++++++++++++++
>  drivers/media/cec/cec-core.c                       |  21 ++++
>  drivers/media/i2c/adv7511.c                        |   5 +-
>  drivers/media/i2c/adv7604.c                        |   3 +-
>  drivers/media/i2c/adv7842.c                        |   2 +-
>  drivers/media/platform/Kconfig                     |  28 +++++
>  drivers/media/platform/Makefile                    |   2 +
>  .../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 +
>  .../st-cec => media/platform/sti/cec}/Makefile     |   0
>  .../st-cec => media/platform/sti/cec}/stih-cec.c   |  31 +++++-
>  drivers/media/platform/vivid/vivid-vid-cap.c       |   3 +-
>  drivers/staging/media/Kconfig                      |   4 -
>  drivers/staging/media/Makefile                     |   2 -
>  drivers/staging/media/s5p-cec/Kconfig              |   9 --
>  drivers/staging/media/s5p-cec/TODO                 |   7 --
>  drivers/staging/media/st-cec/Kconfig               |   8 --
>  drivers/staging/media/st-cec/TODO                  |   7 --
>  include/media/cec-edid.h                           |  17 ++-
>  include/media/cec-notifier.h                       |  93 +++++++++++++++++
>  include/media/cec.h                                |   6 ++
>  37 files changed, 421 insertions(+), 71 deletions(-)
>  create mode 100644 drivers/media/cec-notifier.c
>  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%)
>  rename drivers/{staging/media/st-cec => media/platform/sti/cec}/Makefile (100%)
>  rename drivers/{staging/media/st-cec => media/platform/sti/cec}/stih-cec.c (93%)
>  delete mode 100644 drivers/staging/media/s5p-cec/Kconfig
>  delete mode 100644 drivers/staging/media/s5p-cec/TODO
>  delete mode 100644 drivers/staging/media/st-cec/Kconfig
>  delete mode 100644 drivers/staging/media/st-cec/TODO
>  create mode 100644 include/media/cec-notifier.h
>
> --
> 2.11.0
>



-- 
Benjamin Gaignard

Graphic Study Group

Linaro.org │ Open source software for ARM SoCs

Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 00/11] video/exynos/sti/cec: add CEC notifier & use in drivers
  2017-03-29 14:15 ` Hans Verkuil
@ 2017-03-29 17:47   ` Daniel Vetter
  -1 siblings, 0 replies; 40+ messages in thread
From: Daniel Vetter @ 2017-03-29 17:47 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: linux-media, linux-samsung-soc, Russell King,
	Krzysztof Kozlowski, Javier Martinez Canillas, dri-devel,
	Daniel Vetter, Marek Szyprowski

On Wed, Mar 29, 2017 at 04:15:32PM +0200, Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> This patch series adds the CEC physical address notifier code, based on
> Russell's code:
> 
> https://patchwork.kernel.org/patch/9277043/
> 
> It adds support for it to the exynos_hdmi drm driver, adds support for
> it to the CEC framework and finally adds support to the s5p-cec driver,
> which now can be moved out of staging.
> 
> Also included is similar code for the STI platform, contributed by
> Benjamin Gaignard.
> 
> Tested the exynos code with my Odroid U3 exynos4 devboard.
> 
> After discussions with Daniel Vetter and Russell King I have removed
> the EDID/ELD/HPD connect/disconnect events from the notifier and now
> just use it to report the CEC physical address. This also means that
> it is now renamed to CEC notifier instead of HPD notifier and that
> it is now in drivers/media. The block_notifier was dropped as well
> and instead a simple callback is registered. This means that the
> relationship between HDMI and CEC is now 1:1 and no longer 1:n, but
> should this be needed in the future, then that can easily be added
> back.
> 
> Daniel, regarding your suggestions here:
> 
> http://www.spinics.net/lists/dri-devel/msg133907.html
> 
> this patch series maps to your mail above as follows:
> 
> struct cec_pin == struct cec_notifier
> cec_(un)register_pin == cec_notifier_get/put
> cec_set_address == cec_notifier_set_phys_addr
> cec_(un)register_callbacks == cec_notifier_(un)register
> 
> Comments are welcome. I'd like to get this in for the 4.12 kernel as
> this is a missing piece needed to integrate CEC drivers.
> 
> Regards,
> 
> 	Hans
> 
> Changes since v4:
> - Dropped EDID/ELD/connect/disconnect support. Instead, just report the
>   CEC physical address (and use INVALID when disconnecting).
> - Since this is now completely CEC specific, move it to drivers/media
>   and rename to cec-notifier.
> - Drop block_notifier. Instead just set a callback for the notifier.
> - Use 'hdmi-phandle' in the bindings for both exynos and sti. So no
>   vendor prefix and 'hdmi-phandle' instead of 'hdmi-handle'.
> - Make struct cec_notifier opaque. Add a helper function to get the
>   physical address from a cec_notifier struct.
> - Provide dummy functions in cec-notifier.h so it can be used when
>   CONFIG_MEDIA_CEC_NOTIFIER is undefined.
> - Don't select the CEC notifier in the HDMI drivers. It should only
>   be enabled by actual CEC drivers.

I just quickly scaned through it, but this seems to address all my
concerns fully. Thanks for respinning. On the entire pile (or just the
core cec notifier bits):

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> 
> Changes since v3:
> - Added the STI patches
> - Split the exynos4 binding patches in one for documentation and one
>   for the dts change itself, also use the correct subject and CC to
>   the correct mailinglists (I hope  )
> 
> Changes since v2:
> - Split off the dts changes of the s5p-cec patch into a separate patch
> - Renamed HPD_NOTIFIERS to HPD_NOTIFIER to be consistent with the name
>   of the source.
> 
> Changes since v1:
> 
> Renamed HDMI notifier to HPD (hotplug detect) notifier since this code is
> not HDMI specific, but is interesting for any video source that has to
> deal with hotplug detect and EDID/ELD (HDMI, DVI, VGA, DP, ....).
> Only the use with CEC adapters is HDMI specific, but the HPD notifier
> is more generic.
> 
> 
> 
> 
> Benjamin Gaignard (4):
>   sti: hdmi: add CEC notifier support
>   stih-cec.txt: document new hdmi phandle
>   stih-cec: add CEC notifier support
>   arm: sti: update sti-cec for CEC notifier support
> 
> Hans Verkuil (7):
>   cec-edid: rename cec_get_edid_phys_addr
>   media: add CEC notifier support
>   cec: integrate CEC notifier support
>   exynos_hdmi: add CEC notifier support
>   ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi
>   s5p-cec.txt: document the HDMI controller phandle
>   s5p-cec: add cec-notifier support, move out of staging
> 
>  .../devicetree/bindings/media/s5p-cec.txt          |   2 +
>  .../devicetree/bindings/media/stih-cec.txt         |   2 +
>  MAINTAINERS                                        |   4 +-
>  arch/arm/boot/dts/exynos4.dtsi                     |   1 +
>  arch/arm/boot/dts/stih407-family.dtsi              |  12 ---
>  arch/arm/boot/dts/stih410.dtsi                     |  13 +++
>  drivers/gpu/drm/exynos/exynos_hdmi.c               |  20 +++-
>  drivers/gpu/drm/sti/sti_hdmi.c                     |  11 ++
>  drivers/gpu/drm/sti/sti_hdmi.h                     |   3 +
>  drivers/media/Kconfig                              |   3 +
>  drivers/media/Makefile                             |   4 +
>  drivers/media/cec-edid.c                           |  15 ++-
>  drivers/media/cec-notifier.c                       | 116 +++++++++++++++++++++
>  drivers/media/cec/cec-core.c                       |  21 ++++
>  drivers/media/i2c/adv7511.c                        |   5 +-
>  drivers/media/i2c/adv7604.c                        |   3 +-
>  drivers/media/i2c/adv7842.c                        |   2 +-
>  drivers/media/platform/Kconfig                     |  28 +++++
>  drivers/media/platform/Makefile                    |   2 +
>  .../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 +
>  .../st-cec => media/platform/sti/cec}/Makefile     |   0
>  .../st-cec => media/platform/sti/cec}/stih-cec.c   |  31 +++++-
>  drivers/media/platform/vivid/vivid-vid-cap.c       |   3 +-
>  drivers/staging/media/Kconfig                      |   4 -
>  drivers/staging/media/Makefile                     |   2 -
>  drivers/staging/media/s5p-cec/Kconfig              |   9 --
>  drivers/staging/media/s5p-cec/TODO                 |   7 --
>  drivers/staging/media/st-cec/Kconfig               |   8 --
>  drivers/staging/media/st-cec/TODO                  |   7 --
>  include/media/cec-edid.h                           |  17 ++-
>  include/media/cec-notifier.h                       |  93 +++++++++++++++++
>  include/media/cec.h                                |   6 ++
>  37 files changed, 421 insertions(+), 71 deletions(-)
>  create mode 100644 drivers/media/cec-notifier.c
>  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%)
>  rename drivers/{staging/media/st-cec => media/platform/sti/cec}/Makefile (100%)
>  rename drivers/{staging/media/st-cec => media/platform/sti/cec}/stih-cec.c (93%)
>  delete mode 100644 drivers/staging/media/s5p-cec/Kconfig
>  delete mode 100644 drivers/staging/media/s5p-cec/TODO
>  delete mode 100644 drivers/staging/media/st-cec/Kconfig
>  delete mode 100644 drivers/staging/media/st-cec/TODO
>  create mode 100644 include/media/cec-notifier.h
> 
> -- 
> 2.11.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 00/11] video/exynos/sti/cec: add CEC notifier & use in drivers
@ 2017-03-29 17:47   ` Daniel Vetter
  0 siblings, 0 replies; 40+ messages in thread
From: Daniel Vetter @ 2017-03-29 17:47 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: linux-samsung-soc, Russell King, dri-devel,
	Javier Martinez Canillas, Krzysztof Kozlowski, Daniel Vetter,
	Marek Szyprowski, linux-media

On Wed, Mar 29, 2017 at 04:15:32PM +0200, Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> This patch series adds the CEC physical address notifier code, based on
> Russell's code:
> 
> https://patchwork.kernel.org/patch/9277043/
> 
> It adds support for it to the exynos_hdmi drm driver, adds support for
> it to the CEC framework and finally adds support to the s5p-cec driver,
> which now can be moved out of staging.
> 
> Also included is similar code for the STI platform, contributed by
> Benjamin Gaignard.
> 
> Tested the exynos code with my Odroid U3 exynos4 devboard.
> 
> After discussions with Daniel Vetter and Russell King I have removed
> the EDID/ELD/HPD connect/disconnect events from the notifier and now
> just use it to report the CEC physical address. This also means that
> it is now renamed to CEC notifier instead of HPD notifier and that
> it is now in drivers/media. The block_notifier was dropped as well
> and instead a simple callback is registered. This means that the
> relationship between HDMI and CEC is now 1:1 and no longer 1:n, but
> should this be needed in the future, then that can easily be added
> back.
> 
> Daniel, regarding your suggestions here:
> 
> http://www.spinics.net/lists/dri-devel/msg133907.html
> 
> this patch series maps to your mail above as follows:
> 
> struct cec_pin == struct cec_notifier
> cec_(un)register_pin == cec_notifier_get/put
> cec_set_address == cec_notifier_set_phys_addr
> cec_(un)register_callbacks == cec_notifier_(un)register
> 
> Comments are welcome. I'd like to get this in for the 4.12 kernel as
> this is a missing piece needed to integrate CEC drivers.
> 
> Regards,
> 
> 	Hans
> 
> Changes since v4:
> - Dropped EDID/ELD/connect/disconnect support. Instead, just report the
>   CEC physical address (and use INVALID when disconnecting).
> - Since this is now completely CEC specific, move it to drivers/media
>   and rename to cec-notifier.
> - Drop block_notifier. Instead just set a callback for the notifier.
> - Use 'hdmi-phandle' in the bindings for both exynos and sti. So no
>   vendor prefix and 'hdmi-phandle' instead of 'hdmi-handle'.
> - Make struct cec_notifier opaque. Add a helper function to get the
>   physical address from a cec_notifier struct.
> - Provide dummy functions in cec-notifier.h so it can be used when
>   CONFIG_MEDIA_CEC_NOTIFIER is undefined.
> - Don't select the CEC notifier in the HDMI drivers. It should only
>   be enabled by actual CEC drivers.

I just quickly scaned through it, but this seems to address all my
concerns fully. Thanks for respinning. On the entire pile (or just the
core cec notifier bits):

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> 
> Changes since v3:
> - Added the STI patches
> - Split the exynos4 binding patches in one for documentation and one
>   for the dts change itself, also use the correct subject and CC to
>   the correct mailinglists (I hope  )
> 
> Changes since v2:
> - Split off the dts changes of the s5p-cec patch into a separate patch
> - Renamed HPD_NOTIFIERS to HPD_NOTIFIER to be consistent with the name
>   of the source.
> 
> Changes since v1:
> 
> Renamed HDMI notifier to HPD (hotplug detect) notifier since this code is
> not HDMI specific, but is interesting for any video source that has to
> deal with hotplug detect and EDID/ELD (HDMI, DVI, VGA, DP, ....).
> Only the use with CEC adapters is HDMI specific, but the HPD notifier
> is more generic.
> 
> 
> 
> 
> Benjamin Gaignard (4):
>   sti: hdmi: add CEC notifier support
>   stih-cec.txt: document new hdmi phandle
>   stih-cec: add CEC notifier support
>   arm: sti: update sti-cec for CEC notifier support
> 
> Hans Verkuil (7):
>   cec-edid: rename cec_get_edid_phys_addr
>   media: add CEC notifier support
>   cec: integrate CEC notifier support
>   exynos_hdmi: add CEC notifier support
>   ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi
>   s5p-cec.txt: document the HDMI controller phandle
>   s5p-cec: add cec-notifier support, move out of staging
> 
>  .../devicetree/bindings/media/s5p-cec.txt          |   2 +
>  .../devicetree/bindings/media/stih-cec.txt         |   2 +
>  MAINTAINERS                                        |   4 +-
>  arch/arm/boot/dts/exynos4.dtsi                     |   1 +
>  arch/arm/boot/dts/stih407-family.dtsi              |  12 ---
>  arch/arm/boot/dts/stih410.dtsi                     |  13 +++
>  drivers/gpu/drm/exynos/exynos_hdmi.c               |  20 +++-
>  drivers/gpu/drm/sti/sti_hdmi.c                     |  11 ++
>  drivers/gpu/drm/sti/sti_hdmi.h                     |   3 +
>  drivers/media/Kconfig                              |   3 +
>  drivers/media/Makefile                             |   4 +
>  drivers/media/cec-edid.c                           |  15 ++-
>  drivers/media/cec-notifier.c                       | 116 +++++++++++++++++++++
>  drivers/media/cec/cec-core.c                       |  21 ++++
>  drivers/media/i2c/adv7511.c                        |   5 +-
>  drivers/media/i2c/adv7604.c                        |   3 +-
>  drivers/media/i2c/adv7842.c                        |   2 +-
>  drivers/media/platform/Kconfig                     |  28 +++++
>  drivers/media/platform/Makefile                    |   2 +
>  .../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 +
>  .../st-cec => media/platform/sti/cec}/Makefile     |   0
>  .../st-cec => media/platform/sti/cec}/stih-cec.c   |  31 +++++-
>  drivers/media/platform/vivid/vivid-vid-cap.c       |   3 +-
>  drivers/staging/media/Kconfig                      |   4 -
>  drivers/staging/media/Makefile                     |   2 -
>  drivers/staging/media/s5p-cec/Kconfig              |   9 --
>  drivers/staging/media/s5p-cec/TODO                 |   7 --
>  drivers/staging/media/st-cec/Kconfig               |   8 --
>  drivers/staging/media/st-cec/TODO                  |   7 --
>  include/media/cec-edid.h                           |  17 ++-
>  include/media/cec-notifier.h                       |  93 +++++++++++++++++
>  include/media/cec.h                                |   6 ++
>  37 files changed, 421 insertions(+), 71 deletions(-)
>  create mode 100644 drivers/media/cec-notifier.c
>  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%)
>  rename drivers/{staging/media/st-cec => media/platform/sti/cec}/Makefile (100%)
>  rename drivers/{staging/media/st-cec => media/platform/sti/cec}/stih-cec.c (93%)
>  delete mode 100644 drivers/staging/media/s5p-cec/Kconfig
>  delete mode 100644 drivers/staging/media/s5p-cec/TODO
>  delete mode 100644 drivers/staging/media/st-cec/Kconfig
>  delete mode 100644 drivers/staging/media/st-cec/TODO
>  create mode 100644 include/media/cec-notifier.h
> 
> -- 
> 2.11.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 00/11] video/exynos/sti/cec: add CEC notifier & use in drivers
  2017-03-29 17:47   ` Daniel Vetter
@ 2017-03-29 19:59     ` Hans Verkuil
  -1 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 19:59 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: linux-media, linux-samsung-soc, Russell King,
	Krzysztof Kozlowski, Javier Martinez Canillas, dri-devel,
	Daniel Vetter, Marek Szyprowski

Hi Daniel,

On 29/03/17 19:47, Daniel Vetter wrote:
> On Wed, Mar 29, 2017 at 04:15:32PM +0200, Hans Verkuil wrote:
>> From: Hans Verkuil <hans.verkuil@cisco.com>
>>
>> This patch series adds the CEC physical address notifier code, based on
>> Russell's code:
>>
>> https://patchwork.kernel.org/patch/9277043/
>>
>> It adds support for it to the exynos_hdmi drm driver, adds support for
>> it to the CEC framework and finally adds support to the s5p-cec driver,
>> which now can be moved out of staging.
>>
>> Also included is similar code for the STI platform, contributed by
>> Benjamin Gaignard.
>>
>> Tested the exynos code with my Odroid U3 exynos4 devboard.
>>
>> After discussions with Daniel Vetter and Russell King I have removed
>> the EDID/ELD/HPD connect/disconnect events from the notifier and now
>> just use it to report the CEC physical address. This also means that
>> it is now renamed to CEC notifier instead of HPD notifier and that
>> it is now in drivers/media. The block_notifier was dropped as well
>> and instead a simple callback is registered. This means that the
>> relationship between HDMI and CEC is now 1:1 and no longer 1:n, but
>> should this be needed in the future, then that can easily be added
>> back.
>>
>> Daniel, regarding your suggestions here:
>>
>> http://www.spinics.net/lists/dri-devel/msg133907.html
>>
>> this patch series maps to your mail above as follows:
>>
>> struct cec_pin == struct cec_notifier
>> cec_(un)register_pin == cec_notifier_get/put
>> cec_set_address == cec_notifier_set_phys_addr
>> cec_(un)register_callbacks == cec_notifier_(un)register
>>
>> Comments are welcome. I'd like to get this in for the 4.12 kernel as
>> this is a missing piece needed to integrate CEC drivers.
>>
>> Regards,
>>
>> 	Hans
>>
>> Changes since v4:
>> - Dropped EDID/ELD/connect/disconnect support. Instead, just report the
>>   CEC physical address (and use INVALID when disconnecting).
>> - Since this is now completely CEC specific, move it to drivers/media
>>   and rename to cec-notifier.
>> - Drop block_notifier. Instead just set a callback for the notifier.
>> - Use 'hdmi-phandle' in the bindings for both exynos and sti. So no
>>   vendor prefix and 'hdmi-phandle' instead of 'hdmi-handle'.
>> - Make struct cec_notifier opaque. Add a helper function to get the
>>   physical address from a cec_notifier struct.
>> - Provide dummy functions in cec-notifier.h so it can be used when
>>   CONFIG_MEDIA_CEC_NOTIFIER is undefined.
>> - Don't select the CEC notifier in the HDMI drivers. It should only
>>   be enabled by actual CEC drivers.
> 
> I just quickly scaned through it, but this seems to address all my
> concerns fully. Thanks for respinning. On the entire pile (or just the
> core cec notifier bits):
> 
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Fantastic! Thank you very much for your comments.

One last question: the patches for drivers/gpu/drm: can they go through
the media subsystem or do you want to take them? They do depend on the first
two patches of this series (cec-edid and cec-notifier), so it is a bit more
coordination if they have to go through the drm subsystem.

Regards,

	Hans

> 
>>
>> Changes since v3:
>> - Added the STI patches
>> - Split the exynos4 binding patches in one for documentation and one
>>   for the dts change itself, also use the correct subject and CC to
>>   the correct mailinglists (I hope  )
>>
>> Changes since v2:
>> - Split off the dts changes of the s5p-cec patch into a separate patch
>> - Renamed HPD_NOTIFIERS to HPD_NOTIFIER to be consistent with the name
>>   of the source.
>>
>> Changes since v1:
>>
>> Renamed HDMI notifier to HPD (hotplug detect) notifier since this code is
>> not HDMI specific, but is interesting for any video source that has to
>> deal with hotplug detect and EDID/ELD (HDMI, DVI, VGA, DP, ....).
>> Only the use with CEC adapters is HDMI specific, but the HPD notifier
>> is more generic.
>>
>>
>>
>>
>> Benjamin Gaignard (4):
>>   sti: hdmi: add CEC notifier support
>>   stih-cec.txt: document new hdmi phandle
>>   stih-cec: add CEC notifier support
>>   arm: sti: update sti-cec for CEC notifier support
>>
>> Hans Verkuil (7):
>>   cec-edid: rename cec_get_edid_phys_addr
>>   media: add CEC notifier support
>>   cec: integrate CEC notifier support
>>   exynos_hdmi: add CEC notifier support
>>   ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi
>>   s5p-cec.txt: document the HDMI controller phandle
>>   s5p-cec: add cec-notifier support, move out of staging
>>
>>  .../devicetree/bindings/media/s5p-cec.txt          |   2 +
>>  .../devicetree/bindings/media/stih-cec.txt         |   2 +
>>  MAINTAINERS                                        |   4 +-
>>  arch/arm/boot/dts/exynos4.dtsi                     |   1 +
>>  arch/arm/boot/dts/stih407-family.dtsi              |  12 ---
>>  arch/arm/boot/dts/stih410.dtsi                     |  13 +++
>>  drivers/gpu/drm/exynos/exynos_hdmi.c               |  20 +++-
>>  drivers/gpu/drm/sti/sti_hdmi.c                     |  11 ++
>>  drivers/gpu/drm/sti/sti_hdmi.h                     |   3 +
>>  drivers/media/Kconfig                              |   3 +
>>  drivers/media/Makefile                             |   4 +
>>  drivers/media/cec-edid.c                           |  15 ++-
>>  drivers/media/cec-notifier.c                       | 116 +++++++++++++++++++++
>>  drivers/media/cec/cec-core.c                       |  21 ++++
>>  drivers/media/i2c/adv7511.c                        |   5 +-
>>  drivers/media/i2c/adv7604.c                        |   3 +-
>>  drivers/media/i2c/adv7842.c                        |   2 +-
>>  drivers/media/platform/Kconfig                     |  28 +++++
>>  drivers/media/platform/Makefile                    |   2 +
>>  .../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 +
>>  .../st-cec => media/platform/sti/cec}/Makefile     |   0
>>  .../st-cec => media/platform/sti/cec}/stih-cec.c   |  31 +++++-
>>  drivers/media/platform/vivid/vivid-vid-cap.c       |   3 +-
>>  drivers/staging/media/Kconfig                      |   4 -
>>  drivers/staging/media/Makefile                     |   2 -
>>  drivers/staging/media/s5p-cec/Kconfig              |   9 --
>>  drivers/staging/media/s5p-cec/TODO                 |   7 --
>>  drivers/staging/media/st-cec/Kconfig               |   8 --
>>  drivers/staging/media/st-cec/TODO                  |   7 --
>>  include/media/cec-edid.h                           |  17 ++-
>>  include/media/cec-notifier.h                       |  93 +++++++++++++++++
>>  include/media/cec.h                                |   6 ++
>>  37 files changed, 421 insertions(+), 71 deletions(-)
>>  create mode 100644 drivers/media/cec-notifier.c
>>  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%)
>>  rename drivers/{staging/media/st-cec => media/platform/sti/cec}/Makefile (100%)
>>  rename drivers/{staging/media/st-cec => media/platform/sti/cec}/stih-cec.c (93%)
>>  delete mode 100644 drivers/staging/media/s5p-cec/Kconfig
>>  delete mode 100644 drivers/staging/media/s5p-cec/TODO
>>  delete mode 100644 drivers/staging/media/st-cec/Kconfig
>>  delete mode 100644 drivers/staging/media/st-cec/TODO
>>  create mode 100644 include/media/cec-notifier.h
>>
>> -- 
>> 2.11.0
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 00/11] video/exynos/sti/cec: add CEC notifier & use in drivers
@ 2017-03-29 19:59     ` Hans Verkuil
  0 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-29 19:59 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: linux-samsung-soc, Russell King, dri-devel,
	Javier Martinez Canillas, Krzysztof Kozlowski, Daniel Vetter,
	Marek Szyprowski, linux-media

Hi Daniel,

On 29/03/17 19:47, Daniel Vetter wrote:
> On Wed, Mar 29, 2017 at 04:15:32PM +0200, Hans Verkuil wrote:
>> From: Hans Verkuil <hans.verkuil@cisco.com>
>>
>> This patch series adds the CEC physical address notifier code, based on
>> Russell's code:
>>
>> https://patchwork.kernel.org/patch/9277043/
>>
>> It adds support for it to the exynos_hdmi drm driver, adds support for
>> it to the CEC framework and finally adds support to the s5p-cec driver,
>> which now can be moved out of staging.
>>
>> Also included is similar code for the STI platform, contributed by
>> Benjamin Gaignard.
>>
>> Tested the exynos code with my Odroid U3 exynos4 devboard.
>>
>> After discussions with Daniel Vetter and Russell King I have removed
>> the EDID/ELD/HPD connect/disconnect events from the notifier and now
>> just use it to report the CEC physical address. This also means that
>> it is now renamed to CEC notifier instead of HPD notifier and that
>> it is now in drivers/media. The block_notifier was dropped as well
>> and instead a simple callback is registered. This means that the
>> relationship between HDMI and CEC is now 1:1 and no longer 1:n, but
>> should this be needed in the future, then that can easily be added
>> back.
>>
>> Daniel, regarding your suggestions here:
>>
>> http://www.spinics.net/lists/dri-devel/msg133907.html
>>
>> this patch series maps to your mail above as follows:
>>
>> struct cec_pin == struct cec_notifier
>> cec_(un)register_pin == cec_notifier_get/put
>> cec_set_address == cec_notifier_set_phys_addr
>> cec_(un)register_callbacks == cec_notifier_(un)register
>>
>> Comments are welcome. I'd like to get this in for the 4.12 kernel as
>> this is a missing piece needed to integrate CEC drivers.
>>
>> Regards,
>>
>> 	Hans
>>
>> Changes since v4:
>> - Dropped EDID/ELD/connect/disconnect support. Instead, just report the
>>   CEC physical address (and use INVALID when disconnecting).
>> - Since this is now completely CEC specific, move it to drivers/media
>>   and rename to cec-notifier.
>> - Drop block_notifier. Instead just set a callback for the notifier.
>> - Use 'hdmi-phandle' in the bindings for both exynos and sti. So no
>>   vendor prefix and 'hdmi-phandle' instead of 'hdmi-handle'.
>> - Make struct cec_notifier opaque. Add a helper function to get the
>>   physical address from a cec_notifier struct.
>> - Provide dummy functions in cec-notifier.h so it can be used when
>>   CONFIG_MEDIA_CEC_NOTIFIER is undefined.
>> - Don't select the CEC notifier in the HDMI drivers. It should only
>>   be enabled by actual CEC drivers.
> 
> I just quickly scaned through it, but this seems to address all my
> concerns fully. Thanks for respinning. On the entire pile (or just the
> core cec notifier bits):
> 
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Fantastic! Thank you very much for your comments.

One last question: the patches for drivers/gpu/drm: can they go through
the media subsystem or do you want to take them? They do depend on the first
two patches of this series (cec-edid and cec-notifier), so it is a bit more
coordination if they have to go through the drm subsystem.

Regards,

	Hans

> 
>>
>> Changes since v3:
>> - Added the STI patches
>> - Split the exynos4 binding patches in one for documentation and one
>>   for the dts change itself, also use the correct subject and CC to
>>   the correct mailinglists (I hope  )
>>
>> Changes since v2:
>> - Split off the dts changes of the s5p-cec patch into a separate patch
>> - Renamed HPD_NOTIFIERS to HPD_NOTIFIER to be consistent with the name
>>   of the source.
>>
>> Changes since v1:
>>
>> Renamed HDMI notifier to HPD (hotplug detect) notifier since this code is
>> not HDMI specific, but is interesting for any video source that has to
>> deal with hotplug detect and EDID/ELD (HDMI, DVI, VGA, DP, ....).
>> Only the use with CEC adapters is HDMI specific, but the HPD notifier
>> is more generic.
>>
>>
>>
>>
>> Benjamin Gaignard (4):
>>   sti: hdmi: add CEC notifier support
>>   stih-cec.txt: document new hdmi phandle
>>   stih-cec: add CEC notifier support
>>   arm: sti: update sti-cec for CEC notifier support
>>
>> Hans Verkuil (7):
>>   cec-edid: rename cec_get_edid_phys_addr
>>   media: add CEC notifier support
>>   cec: integrate CEC notifier support
>>   exynos_hdmi: add CEC notifier support
>>   ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi
>>   s5p-cec.txt: document the HDMI controller phandle
>>   s5p-cec: add cec-notifier support, move out of staging
>>
>>  .../devicetree/bindings/media/s5p-cec.txt          |   2 +
>>  .../devicetree/bindings/media/stih-cec.txt         |   2 +
>>  MAINTAINERS                                        |   4 +-
>>  arch/arm/boot/dts/exynos4.dtsi                     |   1 +
>>  arch/arm/boot/dts/stih407-family.dtsi              |  12 ---
>>  arch/arm/boot/dts/stih410.dtsi                     |  13 +++
>>  drivers/gpu/drm/exynos/exynos_hdmi.c               |  20 +++-
>>  drivers/gpu/drm/sti/sti_hdmi.c                     |  11 ++
>>  drivers/gpu/drm/sti/sti_hdmi.h                     |   3 +
>>  drivers/media/Kconfig                              |   3 +
>>  drivers/media/Makefile                             |   4 +
>>  drivers/media/cec-edid.c                           |  15 ++-
>>  drivers/media/cec-notifier.c                       | 116 +++++++++++++++++++++
>>  drivers/media/cec/cec-core.c                       |  21 ++++
>>  drivers/media/i2c/adv7511.c                        |   5 +-
>>  drivers/media/i2c/adv7604.c                        |   3 +-
>>  drivers/media/i2c/adv7842.c                        |   2 +-
>>  drivers/media/platform/Kconfig                     |  28 +++++
>>  drivers/media/platform/Makefile                    |   2 +
>>  .../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 +
>>  .../st-cec => media/platform/sti/cec}/Makefile     |   0
>>  .../st-cec => media/platform/sti/cec}/stih-cec.c   |  31 +++++-
>>  drivers/media/platform/vivid/vivid-vid-cap.c       |   3 +-
>>  drivers/staging/media/Kconfig                      |   4 -
>>  drivers/staging/media/Makefile                     |   2 -
>>  drivers/staging/media/s5p-cec/Kconfig              |   9 --
>>  drivers/staging/media/s5p-cec/TODO                 |   7 --
>>  drivers/staging/media/st-cec/Kconfig               |   8 --
>>  drivers/staging/media/st-cec/TODO                  |   7 --
>>  include/media/cec-edid.h                           |  17 ++-
>>  include/media/cec-notifier.h                       |  93 +++++++++++++++++
>>  include/media/cec.h                                |   6 ++
>>  37 files changed, 421 insertions(+), 71 deletions(-)
>>  create mode 100644 drivers/media/cec-notifier.c
>>  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%)
>>  rename drivers/{staging/media/st-cec => media/platform/sti/cec}/Makefile (100%)
>>  rename drivers/{staging/media/st-cec => media/platform/sti/cec}/stih-cec.c (93%)
>>  delete mode 100644 drivers/staging/media/s5p-cec/Kconfig
>>  delete mode 100644 drivers/staging/media/s5p-cec/TODO
>>  delete mode 100644 drivers/staging/media/st-cec/Kconfig
>>  delete mode 100644 drivers/staging/media/st-cec/TODO
>>  create mode 100644 include/media/cec-notifier.h
>>
>> -- 
>> 2.11.0
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 11/11] arm: sti: update sti-cec for CEC notifier support
  2017-03-29 14:15 ` [PATCHv5 11/11] arm: sti: update sti-cec for " Hans Verkuil
@ 2017-03-30  7:41     ` Benjamin Gaignard
  0 siblings, 0 replies; 40+ messages in thread
From: Benjamin Gaignard @ 2017-03-30  7:41 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: devicetree, moderated list:ARM/S5P EXYNOS AR...,
	Russell King, Krzysztof Kozlowski, Patrice.chotard,
	Javier Martinez Canillas, Hans Verkuil, dri-devel, Daniel Vetter,
	Marek Szyprowski, linux-media

+ Patrice for sti DT

2017-03-29 16:15 GMT+02:00 Hans Verkuil <hverkuil@xs4all.nl>:
> From: Benjamin Gaignard <benjamin.gaignard@linaro.org>
>
> To use CEC notifier sti CEC driver needs to get phandle
> of the hdmi device.
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> CC: devicetree@vger.kernel.org
> ---
>  arch/arm/boot/dts/stih407-family.dtsi | 12 ------------
>  arch/arm/boot/dts/stih410.dtsi        | 13 +++++++++++++
>  2 files changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/arch/arm/boot/dts/stih407-family.dtsi b/arch/arm/boot/dts/stih407-family.dtsi
> index d753ac36788f..044184580326 100644
> --- a/arch/arm/boot/dts/stih407-family.dtsi
> +++ b/arch/arm/boot/dts/stih407-family.dtsi
> @@ -742,18 +742,6 @@
>                                  <&clk_s_c0_flexgen CLK_ETH_PHY>;
>                 };
>
> -               cec: sti-cec@094a087c {
> -                       compatible = "st,stih-cec";
> -                       reg = <0x94a087c 0x64>;
> -                       clocks = <&clk_sysin>;
> -                       clock-names = "cec-clk";
> -                       interrupts = <GIC_SPI 140 IRQ_TYPE_NONE>;
> -                       interrupt-names = "cec-irq";
> -                       pinctrl-names = "default";
> -                       pinctrl-0 = <&pinctrl_cec0_default>;
> -                       resets = <&softreset STIH407_LPM_SOFTRESET>;
> -               };
> -
>                 rng10: rng@08a89000 {
>                         compatible      = "st,rng";
>                         reg             = <0x08a89000 0x1000>;
> diff --git a/arch/arm/boot/dts/stih410.dtsi b/arch/arm/boot/dts/stih410.dtsi
> index 3c9672c5b09f..21fe72b183d8 100644
> --- a/arch/arm/boot/dts/stih410.dtsi
> +++ b/arch/arm/boot/dts/stih410.dtsi
> @@ -281,5 +281,18 @@
>                                  <&clk_s_c0_flexgen CLK_ST231_DMU>,
>                                  <&clk_s_c0_flexgen CLK_FLASH_PROMIP>;
>                 };
> +
> +               sti-cec@094a087c {
> +                       compatible = "st,stih-cec";
> +                       reg = <0x94a087c 0x64>;
> +                       clocks = <&clk_sysin>;
> +                       clock-names = "cec-clk";
> +                       interrupts = <GIC_SPI 140 IRQ_TYPE_NONE>;
> +                       interrupt-names = "cec-irq";
> +                       pinctrl-names = "default";
> +                       pinctrl-0 = <&pinctrl_cec0_default>;
> +                       resets = <&softreset STIH407_LPM_SOFTRESET>;
> +                       hdmi-phandle = <&sti_hdmi>;
> +               };
>         };
>  };
> --
> 2.11.0
>



-- 
Benjamin Gaignard

Graphic Study Group

Linaro.org │ Open source software for ARM SoCs

Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 11/11] arm: sti: update sti-cec for CEC notifier support
@ 2017-03-30  7:41     ` Benjamin Gaignard
  0 siblings, 0 replies; 40+ messages in thread
From: Benjamin Gaignard @ 2017-03-30  7:41 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: linux-media, Daniel Vetter, Russell King, dri-devel,
	moderated list:ARM/S5P EXYNOS AR...,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Hans Verkuil, devicetree,
	Patrice.chotard

+ Patrice for sti DT

2017-03-29 16:15 GMT+02:00 Hans Verkuil <hverkuil@xs4all.nl>:
> From: Benjamin Gaignard <benjamin.gaignard@linaro.org>
>
> To use CEC notifier sti CEC driver needs to get phandle
> of the hdmi device.
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> CC: devicetree@vger.kernel.org
> ---
>  arch/arm/boot/dts/stih407-family.dtsi | 12 ------------
>  arch/arm/boot/dts/stih410.dtsi        | 13 +++++++++++++
>  2 files changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/arch/arm/boot/dts/stih407-family.dtsi b/arch/arm/boot/dts/stih407-family.dtsi
> index d753ac36788f..044184580326 100644
> --- a/arch/arm/boot/dts/stih407-family.dtsi
> +++ b/arch/arm/boot/dts/stih407-family.dtsi
> @@ -742,18 +742,6 @@
>                                  <&clk_s_c0_flexgen CLK_ETH_PHY>;
>                 };
>
> -               cec: sti-cec@094a087c {
> -                       compatible = "st,stih-cec";
> -                       reg = <0x94a087c 0x64>;
> -                       clocks = <&clk_sysin>;
> -                       clock-names = "cec-clk";
> -                       interrupts = <GIC_SPI 140 IRQ_TYPE_NONE>;
> -                       interrupt-names = "cec-irq";
> -                       pinctrl-names = "default";
> -                       pinctrl-0 = <&pinctrl_cec0_default>;
> -                       resets = <&softreset STIH407_LPM_SOFTRESET>;
> -               };
> -
>                 rng10: rng@08a89000 {
>                         compatible      = "st,rng";
>                         reg             = <0x08a89000 0x1000>;
> diff --git a/arch/arm/boot/dts/stih410.dtsi b/arch/arm/boot/dts/stih410.dtsi
> index 3c9672c5b09f..21fe72b183d8 100644
> --- a/arch/arm/boot/dts/stih410.dtsi
> +++ b/arch/arm/boot/dts/stih410.dtsi
> @@ -281,5 +281,18 @@
>                                  <&clk_s_c0_flexgen CLK_ST231_DMU>,
>                                  <&clk_s_c0_flexgen CLK_FLASH_PROMIP>;
>                 };
> +
> +               sti-cec@094a087c {
> +                       compatible = "st,stih-cec";
> +                       reg = <0x94a087c 0x64>;
> +                       clocks = <&clk_sysin>;
> +                       clock-names = "cec-clk";
> +                       interrupts = <GIC_SPI 140 IRQ_TYPE_NONE>;
> +                       interrupt-names = "cec-irq";
> +                       pinctrl-names = "default";
> +                       pinctrl-0 = <&pinctrl_cec0_default>;
> +                       resets = <&softreset STIH407_LPM_SOFTRESET>;
> +                       hdmi-phandle = <&sti_hdmi>;
> +               };
>         };
>  };
> --
> 2.11.0
>



-- 
Benjamin Gaignard

Graphic Study Group

Linaro.org │ Open source software for ARM SoCs

Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 00/11] video/exynos/sti/cec: add CEC notifier & use in drivers
  2017-03-29 19:59     ` Hans Verkuil
@ 2017-03-30  7:47       ` Daniel Vetter
  -1 siblings, 0 replies; 40+ messages in thread
From: Daniel Vetter @ 2017-03-30  7:47 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: Daniel Vetter, linux-media, linux-samsung-soc, Russell King,
	Krzysztof Kozlowski, Javier Martinez Canillas, dri-devel,
	Daniel Vetter, Marek Szyprowski

On Wed, Mar 29, 2017 at 09:59:34PM +0200, Hans Verkuil wrote:
> Hi Daniel,
> 
> On 29/03/17 19:47, Daniel Vetter wrote:
> > On Wed, Mar 29, 2017 at 04:15:32PM +0200, Hans Verkuil wrote:
> >> From: Hans Verkuil <hans.verkuil@cisco.com>
> >>
> >> This patch series adds the CEC physical address notifier code, based on
> >> Russell's code:
> >>
> >> https://patchwork.kernel.org/patch/9277043/
> >>
> >> It adds support for it to the exynos_hdmi drm driver, adds support for
> >> it to the CEC framework and finally adds support to the s5p-cec driver,
> >> which now can be moved out of staging.
> >>
> >> Also included is similar code for the STI platform, contributed by
> >> Benjamin Gaignard.
> >>
> >> Tested the exynos code with my Odroid U3 exynos4 devboard.
> >>
> >> After discussions with Daniel Vetter and Russell King I have removed
> >> the EDID/ELD/HPD connect/disconnect events from the notifier and now
> >> just use it to report the CEC physical address. This also means that
> >> it is now renamed to CEC notifier instead of HPD notifier and that
> >> it is now in drivers/media. The block_notifier was dropped as well
> >> and instead a simple callback is registered. This means that the
> >> relationship between HDMI and CEC is now 1:1 and no longer 1:n, but
> >> should this be needed in the future, then that can easily be added
> >> back.
> >>
> >> Daniel, regarding your suggestions here:
> >>
> >> http://www.spinics.net/lists/dri-devel/msg133907.html
> >>
> >> this patch series maps to your mail above as follows:
> >>
> >> struct cec_pin == struct cec_notifier
> >> cec_(un)register_pin == cec_notifier_get/put
> >> cec_set_address == cec_notifier_set_phys_addr
> >> cec_(un)register_callbacks == cec_notifier_(un)register
> >>
> >> Comments are welcome. I'd like to get this in for the 4.12 kernel as
> >> this is a missing piece needed to integrate CEC drivers.
> >>
> >> Regards,
> >>
> >> 	Hans
> >>
> >> Changes since v4:
> >> - Dropped EDID/ELD/connect/disconnect support. Instead, just report the
> >>   CEC physical address (and use INVALID when disconnecting).
> >> - Since this is now completely CEC specific, move it to drivers/media
> >>   and rename to cec-notifier.
> >> - Drop block_notifier. Instead just set a callback for the notifier.
> >> - Use 'hdmi-phandle' in the bindings for both exynos and sti. So no
> >>   vendor prefix and 'hdmi-phandle' instead of 'hdmi-handle'.
> >> - Make struct cec_notifier opaque. Add a helper function to get the
> >>   physical address from a cec_notifier struct.
> >> - Provide dummy functions in cec-notifier.h so it can be used when
> >>   CONFIG_MEDIA_CEC_NOTIFIER is undefined.
> >> - Don't select the CEC notifier in the HDMI drivers. It should only
> >>   be enabled by actual CEC drivers.
> > 
> > I just quickly scaned through it, but this seems to address all my
> > concerns fully. Thanks for respinning. On the entire pile (or just the
> > core cec notifier bits):
> > 
> > Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> Fantastic! Thank you very much for your comments.
> 
> One last question: the patches for drivers/gpu/drm: can they go through
> the media subsystem or do you want to take them? They do depend on the first
> two patches of this series (cec-edid and cec-notifier), so it is a bit more
> coordination if they have to go through the drm subsystem.

Doesn't seem to touch anything where I expect conflicts, so as long as it
shows up in linux-next timely I think that's good. Please poke driver
maintainers for their ack though, but if they fail to respond within a few
days you can take my ack for merging the entire pile through media.

Cheers, Daniel

> 
> Regards,
> 
> 	Hans
> 
> > 
> >>
> >> Changes since v3:
> >> - Added the STI patches
> >> - Split the exynos4 binding patches in one for documentation and one
> >>   for the dts change itself, also use the correct subject and CC to
> >>   the correct mailinglists (I hope  )
> >>
> >> Changes since v2:
> >> - Split off the dts changes of the s5p-cec patch into a separate patch
> >> - Renamed HPD_NOTIFIERS to HPD_NOTIFIER to be consistent with the name
> >>   of the source.
> >>
> >> Changes since v1:
> >>
> >> Renamed HDMI notifier to HPD (hotplug detect) notifier since this code is
> >> not HDMI specific, but is interesting for any video source that has to
> >> deal with hotplug detect and EDID/ELD (HDMI, DVI, VGA, DP, ....).
> >> Only the use with CEC adapters is HDMI specific, but the HPD notifier
> >> is more generic.
> >>
> >>
> >>
> >>
> >> Benjamin Gaignard (4):
> >>   sti: hdmi: add CEC notifier support
> >>   stih-cec.txt: document new hdmi phandle
> >>   stih-cec: add CEC notifier support
> >>   arm: sti: update sti-cec for CEC notifier support
> >>
> >> Hans Verkuil (7):
> >>   cec-edid: rename cec_get_edid_phys_addr
> >>   media: add CEC notifier support
> >>   cec: integrate CEC notifier support
> >>   exynos_hdmi: add CEC notifier support
> >>   ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi
> >>   s5p-cec.txt: document the HDMI controller phandle
> >>   s5p-cec: add cec-notifier support, move out of staging
> >>
> >>  .../devicetree/bindings/media/s5p-cec.txt          |   2 +
> >>  .../devicetree/bindings/media/stih-cec.txt         |   2 +
> >>  MAINTAINERS                                        |   4 +-
> >>  arch/arm/boot/dts/exynos4.dtsi                     |   1 +
> >>  arch/arm/boot/dts/stih407-family.dtsi              |  12 ---
> >>  arch/arm/boot/dts/stih410.dtsi                     |  13 +++
> >>  drivers/gpu/drm/exynos/exynos_hdmi.c               |  20 +++-
> >>  drivers/gpu/drm/sti/sti_hdmi.c                     |  11 ++
> >>  drivers/gpu/drm/sti/sti_hdmi.h                     |   3 +
> >>  drivers/media/Kconfig                              |   3 +
> >>  drivers/media/Makefile                             |   4 +
> >>  drivers/media/cec-edid.c                           |  15 ++-
> >>  drivers/media/cec-notifier.c                       | 116 +++++++++++++++++++++
> >>  drivers/media/cec/cec-core.c                       |  21 ++++
> >>  drivers/media/i2c/adv7511.c                        |   5 +-
> >>  drivers/media/i2c/adv7604.c                        |   3 +-
> >>  drivers/media/i2c/adv7842.c                        |   2 +-
> >>  drivers/media/platform/Kconfig                     |  28 +++++
> >>  drivers/media/platform/Makefile                    |   2 +
> >>  .../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 +
> >>  .../st-cec => media/platform/sti/cec}/Makefile     |   0
> >>  .../st-cec => media/platform/sti/cec}/stih-cec.c   |  31 +++++-
> >>  drivers/media/platform/vivid/vivid-vid-cap.c       |   3 +-
> >>  drivers/staging/media/Kconfig                      |   4 -
> >>  drivers/staging/media/Makefile                     |   2 -
> >>  drivers/staging/media/s5p-cec/Kconfig              |   9 --
> >>  drivers/staging/media/s5p-cec/TODO                 |   7 --
> >>  drivers/staging/media/st-cec/Kconfig               |   8 --
> >>  drivers/staging/media/st-cec/TODO                  |   7 --
> >>  include/media/cec-edid.h                           |  17 ++-
> >>  include/media/cec-notifier.h                       |  93 +++++++++++++++++
> >>  include/media/cec.h                                |   6 ++
> >>  37 files changed, 421 insertions(+), 71 deletions(-)
> >>  create mode 100644 drivers/media/cec-notifier.c
> >>  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%)
> >>  rename drivers/{staging/media/st-cec => media/platform/sti/cec}/Makefile (100%)
> >>  rename drivers/{staging/media/st-cec => media/platform/sti/cec}/stih-cec.c (93%)
> >>  delete mode 100644 drivers/staging/media/s5p-cec/Kconfig
> >>  delete mode 100644 drivers/staging/media/s5p-cec/TODO
> >>  delete mode 100644 drivers/staging/media/st-cec/Kconfig
> >>  delete mode 100644 drivers/staging/media/st-cec/TODO
> >>  create mode 100644 include/media/cec-notifier.h
> >>
> >> -- 
> >> 2.11.0
> >>
> >> _______________________________________________
> >> dri-devel mailing list
> >> dri-devel@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> > 
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 00/11] video/exynos/sti/cec: add CEC notifier & use in drivers
@ 2017-03-30  7:47       ` Daniel Vetter
  0 siblings, 0 replies; 40+ messages in thread
From: Daniel Vetter @ 2017-03-30  7:47 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: linux-samsung-soc, Russell King, Krzysztof Kozlowski,
	Javier Martinez Canillas, dri-devel, Daniel Vetter,
	Marek Szyprowski, linux-media

On Wed, Mar 29, 2017 at 09:59:34PM +0200, Hans Verkuil wrote:
> Hi Daniel,
> 
> On 29/03/17 19:47, Daniel Vetter wrote:
> > On Wed, Mar 29, 2017 at 04:15:32PM +0200, Hans Verkuil wrote:
> >> From: Hans Verkuil <hans.verkuil@cisco.com>
> >>
> >> This patch series adds the CEC physical address notifier code, based on
> >> Russell's code:
> >>
> >> https://patchwork.kernel.org/patch/9277043/
> >>
> >> It adds support for it to the exynos_hdmi drm driver, adds support for
> >> it to the CEC framework and finally adds support to the s5p-cec driver,
> >> which now can be moved out of staging.
> >>
> >> Also included is similar code for the STI platform, contributed by
> >> Benjamin Gaignard.
> >>
> >> Tested the exynos code with my Odroid U3 exynos4 devboard.
> >>
> >> After discussions with Daniel Vetter and Russell King I have removed
> >> the EDID/ELD/HPD connect/disconnect events from the notifier and now
> >> just use it to report the CEC physical address. This also means that
> >> it is now renamed to CEC notifier instead of HPD notifier and that
> >> it is now in drivers/media. The block_notifier was dropped as well
> >> and instead a simple callback is registered. This means that the
> >> relationship between HDMI and CEC is now 1:1 and no longer 1:n, but
> >> should this be needed in the future, then that can easily be added
> >> back.
> >>
> >> Daniel, regarding your suggestions here:
> >>
> >> http://www.spinics.net/lists/dri-devel/msg133907.html
> >>
> >> this patch series maps to your mail above as follows:
> >>
> >> struct cec_pin == struct cec_notifier
> >> cec_(un)register_pin == cec_notifier_get/put
> >> cec_set_address == cec_notifier_set_phys_addr
> >> cec_(un)register_callbacks == cec_notifier_(un)register
> >>
> >> Comments are welcome. I'd like to get this in for the 4.12 kernel as
> >> this is a missing piece needed to integrate CEC drivers.
> >>
> >> Regards,
> >>
> >> 	Hans
> >>
> >> Changes since v4:
> >> - Dropped EDID/ELD/connect/disconnect support. Instead, just report the
> >>   CEC physical address (and use INVALID when disconnecting).
> >> - Since this is now completely CEC specific, move it to drivers/media
> >>   and rename to cec-notifier.
> >> - Drop block_notifier. Instead just set a callback for the notifier.
> >> - Use 'hdmi-phandle' in the bindings for both exynos and sti. So no
> >>   vendor prefix and 'hdmi-phandle' instead of 'hdmi-handle'.
> >> - Make struct cec_notifier opaque. Add a helper function to get the
> >>   physical address from a cec_notifier struct.
> >> - Provide dummy functions in cec-notifier.h so it can be used when
> >>   CONFIG_MEDIA_CEC_NOTIFIER is undefined.
> >> - Don't select the CEC notifier in the HDMI drivers. It should only
> >>   be enabled by actual CEC drivers.
> > 
> > I just quickly scaned through it, but this seems to address all my
> > concerns fully. Thanks for respinning. On the entire pile (or just the
> > core cec notifier bits):
> > 
> > Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> Fantastic! Thank you very much for your comments.
> 
> One last question: the patches for drivers/gpu/drm: can they go through
> the media subsystem or do you want to take them? They do depend on the first
> two patches of this series (cec-edid and cec-notifier), so it is a bit more
> coordination if they have to go through the drm subsystem.

Doesn't seem to touch anything where I expect conflicts, so as long as it
shows up in linux-next timely I think that's good. Please poke driver
maintainers for their ack though, but if they fail to respond within a few
days you can take my ack for merging the entire pile through media.

Cheers, Daniel

> 
> Regards,
> 
> 	Hans
> 
> > 
> >>
> >> Changes since v3:
> >> - Added the STI patches
> >> - Split the exynos4 binding patches in one for documentation and one
> >>   for the dts change itself, also use the correct subject and CC to
> >>   the correct mailinglists (I hope  )
> >>
> >> Changes since v2:
> >> - Split off the dts changes of the s5p-cec patch into a separate patch
> >> - Renamed HPD_NOTIFIERS to HPD_NOTIFIER to be consistent with the name
> >>   of the source.
> >>
> >> Changes since v1:
> >>
> >> Renamed HDMI notifier to HPD (hotplug detect) notifier since this code is
> >> not HDMI specific, but is interesting for any video source that has to
> >> deal with hotplug detect and EDID/ELD (HDMI, DVI, VGA, DP, ....).
> >> Only the use with CEC adapters is HDMI specific, but the HPD notifier
> >> is more generic.
> >>
> >>
> >>
> >>
> >> Benjamin Gaignard (4):
> >>   sti: hdmi: add CEC notifier support
> >>   stih-cec.txt: document new hdmi phandle
> >>   stih-cec: add CEC notifier support
> >>   arm: sti: update sti-cec for CEC notifier support
> >>
> >> Hans Verkuil (7):
> >>   cec-edid: rename cec_get_edid_phys_addr
> >>   media: add CEC notifier support
> >>   cec: integrate CEC notifier support
> >>   exynos_hdmi: add CEC notifier support
> >>   ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi
> >>   s5p-cec.txt: document the HDMI controller phandle
> >>   s5p-cec: add cec-notifier support, move out of staging
> >>
> >>  .../devicetree/bindings/media/s5p-cec.txt          |   2 +
> >>  .../devicetree/bindings/media/stih-cec.txt         |   2 +
> >>  MAINTAINERS                                        |   4 +-
> >>  arch/arm/boot/dts/exynos4.dtsi                     |   1 +
> >>  arch/arm/boot/dts/stih407-family.dtsi              |  12 ---
> >>  arch/arm/boot/dts/stih410.dtsi                     |  13 +++
> >>  drivers/gpu/drm/exynos/exynos_hdmi.c               |  20 +++-
> >>  drivers/gpu/drm/sti/sti_hdmi.c                     |  11 ++
> >>  drivers/gpu/drm/sti/sti_hdmi.h                     |   3 +
> >>  drivers/media/Kconfig                              |   3 +
> >>  drivers/media/Makefile                             |   4 +
> >>  drivers/media/cec-edid.c                           |  15 ++-
> >>  drivers/media/cec-notifier.c                       | 116 +++++++++++++++++++++
> >>  drivers/media/cec/cec-core.c                       |  21 ++++
> >>  drivers/media/i2c/adv7511.c                        |   5 +-
> >>  drivers/media/i2c/adv7604.c                        |   3 +-
> >>  drivers/media/i2c/adv7842.c                        |   2 +-
> >>  drivers/media/platform/Kconfig                     |  28 +++++
> >>  drivers/media/platform/Makefile                    |   2 +
> >>  .../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 +
> >>  .../st-cec => media/platform/sti/cec}/Makefile     |   0
> >>  .../st-cec => media/platform/sti/cec}/stih-cec.c   |  31 +++++-
> >>  drivers/media/platform/vivid/vivid-vid-cap.c       |   3 +-
> >>  drivers/staging/media/Kconfig                      |   4 -
> >>  drivers/staging/media/Makefile                     |   2 -
> >>  drivers/staging/media/s5p-cec/Kconfig              |   9 --
> >>  drivers/staging/media/s5p-cec/TODO                 |   7 --
> >>  drivers/staging/media/st-cec/Kconfig               |   8 --
> >>  drivers/staging/media/st-cec/TODO                  |   7 --
> >>  include/media/cec-edid.h                           |  17 ++-
> >>  include/media/cec-notifier.h                       |  93 +++++++++++++++++
> >>  include/media/cec.h                                |   6 ++
> >>  37 files changed, 421 insertions(+), 71 deletions(-)
> >>  create mode 100644 drivers/media/cec-notifier.c
> >>  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%)
> >>  rename drivers/{staging/media/st-cec => media/platform/sti/cec}/Makefile (100%)
> >>  rename drivers/{staging/media/st-cec => media/platform/sti/cec}/stih-cec.c (93%)
> >>  delete mode 100644 drivers/staging/media/s5p-cec/Kconfig
> >>  delete mode 100644 drivers/staging/media/s5p-cec/TODO
> >>  delete mode 100644 drivers/staging/media/st-cec/Kconfig
> >>  delete mode 100644 drivers/staging/media/st-cec/TODO
> >>  create mode 100644 include/media/cec-notifier.h
> >>
> >> -- 
> >> 2.11.0
> >>
> >> _______________________________________________
> >> dri-devel mailing list
> >> dri-devel@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> > 
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 11/11] arm: sti: update sti-cec for CEC notifier support
  2017-03-30  7:41     ` Benjamin Gaignard
@ 2017-03-30  9:30         ` Patrice CHOTARD
  -1 siblings, 0 replies; 40+ messages in thread
From: Patrice CHOTARD @ 2017-03-30  9:30 UTC (permalink / raw)
  To: Benjamin Gaignard, Hans Verkuil
  Cc: linux-media-u79uwXL29TY76Z2rM5mHXA, Daniel Vetter, Russell King,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	moderated list:ARM/S5P EXYNOS AR...,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Hans Verkuil,
	devicetree-u79uwXL29TY76Z2rM5mHXA

Hi Benjamin

On 03/30/2017 09:41 AM, Benjamin Gaignard wrote:
> + Patrice for sti DT

In order to be coherent with all previous STi DT patches,

can you update the commit message with "ARM: dts: STiH410: update 
sti-cec for CEC notifier support"

Thanks

Patrice

>
> 2017-03-29 16:15 GMT+02:00 Hans Verkuil <hverkuil@xs4all.nl>:
>> From: Benjamin Gaignard <benjamin.gaignard@linaro.org>
>>
>> To use CEC notifier sti CEC driver needs to get phandle
>> of the hdmi device.
>>
>> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
>> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
>> CC: devicetree@vger.kernel.org
>> ---
>>  arch/arm/boot/dts/stih407-family.dtsi | 12 ------------
>>  arch/arm/boot/dts/stih410.dtsi        | 13 +++++++++++++
>>  2 files changed, 13 insertions(+), 12 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/stih407-family.dtsi b/arch/arm/boot/dts/stih407-family.dtsi
>> index d753ac36788f..044184580326 100644
>> --- a/arch/arm/boot/dts/stih407-family.dtsi
>> +++ b/arch/arm/boot/dts/stih407-family.dtsi
>> @@ -742,18 +742,6 @@
>>                                  <&clk_s_c0_flexgen CLK_ETH_PHY>;
>>                 };
>>
>> -               cec: sti-cec@094a087c {
>> -                       compatible = "st,stih-cec";
>> -                       reg = <0x94a087c 0x64>;
>> -                       clocks = <&clk_sysin>;
>> -                       clock-names = "cec-clk";
>> -                       interrupts = <GIC_SPI 140 IRQ_TYPE_NONE>;
>> -                       interrupt-names = "cec-irq";
>> -                       pinctrl-names = "default";
>> -                       pinctrl-0 = <&pinctrl_cec0_default>;
>> -                       resets = <&softreset STIH407_LPM_SOFTRESET>;
>> -               };
>> -
>>                 rng10: rng@08a89000 {
>>                         compatible      = "st,rng";
>>                         reg             = <0x08a89000 0x1000>;
>> diff --git a/arch/arm/boot/dts/stih410.dtsi b/arch/arm/boot/dts/stih410.dtsi
>> index 3c9672c5b09f..21fe72b183d8 100644
>> --- a/arch/arm/boot/dts/stih410.dtsi
>> +++ b/arch/arm/boot/dts/stih410.dtsi
>> @@ -281,5 +281,18 @@
>>                                  <&clk_s_c0_flexgen CLK_ST231_DMU>,
>>                                  <&clk_s_c0_flexgen CLK_FLASH_PROMIP>;
>>                 };
>> +
>> +               sti-cec@094a087c {
>> +                       compatible = "st,stih-cec";
>> +                       reg = <0x94a087c 0x64>;
>> +                       clocks = <&clk_sysin>;
>> +                       clock-names = "cec-clk";
>> +                       interrupts = <GIC_SPI 140 IRQ_TYPE_NONE>;
>> +                       interrupt-names = "cec-irq";
>> +                       pinctrl-names = "default";
>> +                       pinctrl-0 = <&pinctrl_cec0_default>;
>> +                       resets = <&softreset STIH407_LPM_SOFTRESET>;
>> +                       hdmi-phandle = <&sti_hdmi>;
>> +               };
>>         };
>>  };
>> --
>> 2.11.0
>>
>
>
>

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 11/11] arm: sti: update sti-cec for CEC notifier support
@ 2017-03-30  9:30         ` Patrice CHOTARD
  0 siblings, 0 replies; 40+ messages in thread
From: Patrice CHOTARD @ 2017-03-30  9:30 UTC (permalink / raw)
  To: Benjamin Gaignard, Hans Verkuil
  Cc: linux-media, Daniel Vetter, Russell King, dri-devel,
	moderated list:ARM/S5P EXYNOS AR...,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Hans Verkuil, devicetree

Hi Benjamin

On 03/30/2017 09:41 AM, Benjamin Gaignard wrote:
> + Patrice for sti DT

In order to be coherent with all previous STi DT patches,

can you update the commit message with "ARM: dts: STiH410: update 
sti-cec for CEC notifier support"

Thanks

Patrice

>
> 2017-03-29 16:15 GMT+02:00 Hans Verkuil <hverkuil@xs4all.nl>:
>> From: Benjamin Gaignard <benjamin.gaignard@linaro.org>
>>
>> To use CEC notifier sti CEC driver needs to get phandle
>> of the hdmi device.
>>
>> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
>> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
>> CC: devicetree@vger.kernel.org
>> ---
>>  arch/arm/boot/dts/stih407-family.dtsi | 12 ------------
>>  arch/arm/boot/dts/stih410.dtsi        | 13 +++++++++++++
>>  2 files changed, 13 insertions(+), 12 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/stih407-family.dtsi b/arch/arm/boot/dts/stih407-family.dtsi
>> index d753ac36788f..044184580326 100644
>> --- a/arch/arm/boot/dts/stih407-family.dtsi
>> +++ b/arch/arm/boot/dts/stih407-family.dtsi
>> @@ -742,18 +742,6 @@
>>                                  <&clk_s_c0_flexgen CLK_ETH_PHY>;
>>                 };
>>
>> -               cec: sti-cec@094a087c {
>> -                       compatible = "st,stih-cec";
>> -                       reg = <0x94a087c 0x64>;
>> -                       clocks = <&clk_sysin>;
>> -                       clock-names = "cec-clk";
>> -                       interrupts = <GIC_SPI 140 IRQ_TYPE_NONE>;
>> -                       interrupt-names = "cec-irq";
>> -                       pinctrl-names = "default";
>> -                       pinctrl-0 = <&pinctrl_cec0_default>;
>> -                       resets = <&softreset STIH407_LPM_SOFTRESET>;
>> -               };
>> -
>>                 rng10: rng@08a89000 {
>>                         compatible      = "st,rng";
>>                         reg             = <0x08a89000 0x1000>;
>> diff --git a/arch/arm/boot/dts/stih410.dtsi b/arch/arm/boot/dts/stih410.dtsi
>> index 3c9672c5b09f..21fe72b183d8 100644
>> --- a/arch/arm/boot/dts/stih410.dtsi
>> +++ b/arch/arm/boot/dts/stih410.dtsi
>> @@ -281,5 +281,18 @@
>>                                  <&clk_s_c0_flexgen CLK_ST231_DMU>,
>>                                  <&clk_s_c0_flexgen CLK_FLASH_PROMIP>;
>>                 };
>> +
>> +               sti-cec@094a087c {
>> +                       compatible = "st,stih-cec";
>> +                       reg = <0x94a087c 0x64>;
>> +                       clocks = <&clk_sysin>;
>> +                       clock-names = "cec-clk";
>> +                       interrupts = <GIC_SPI 140 IRQ_TYPE_NONE>;
>> +                       interrupt-names = "cec-irq";
>> +                       pinctrl-names = "default";
>> +                       pinctrl-0 = <&pinctrl_cec0_default>;
>> +                       resets = <&softreset STIH407_LPM_SOFTRESET>;
>> +                       hdmi-phandle = <&sti_hdmi>;
>> +               };
>>         };
>>  };
>> --
>> 2.11.0
>>
>
>
>

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 11/11] arm: sti: update sti-cec for CEC notifier support
  2017-03-30  9:30         ` Patrice CHOTARD
  (?)
@ 2017-03-30  9:32         ` Hans Verkuil
  -1 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-30  9:32 UTC (permalink / raw)
  To: Patrice CHOTARD, Benjamin Gaignard, Hans Verkuil
  Cc: linux-media, Daniel Vetter, Russell King, dri-devel,
	moderated list:ARM/S5P EXYNOS AR...,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Hans Verkuil, devicetree

On 03/30/2017 11:30 AM, Patrice CHOTARD wrote:
> Hi Benjamin
> 
> On 03/30/2017 09:41 AM, Benjamin Gaignard wrote:
>> + Patrice for sti DT
> 
> In order to be coherent with all previous STi DT patches,
> 
> can you update the commit message with "ARM: dts: STiH410: update 
> sti-cec for CEC notifier support"

Done.

Regards,

	Hans

> 
> Thanks
> 
> Patrice
> 
>>
>> 2017-03-29 16:15 GMT+02:00 Hans Verkuil <hverkuil@xs4all.nl>:
>>> From: Benjamin Gaignard <benjamin.gaignard@linaro.org>
>>>
>>> To use CEC notifier sti CEC driver needs to get phandle
>>> of the hdmi device.
>>>
>>> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
>>> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
>>> CC: devicetree@vger.kernel.org
>>> ---
>>>  arch/arm/boot/dts/stih407-family.dtsi | 12 ------------
>>>  arch/arm/boot/dts/stih410.dtsi        | 13 +++++++++++++
>>>  2 files changed, 13 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/arch/arm/boot/dts/stih407-family.dtsi b/arch/arm/boot/dts/stih407-family.dtsi
>>> index d753ac36788f..044184580326 100644
>>> --- a/arch/arm/boot/dts/stih407-family.dtsi
>>> +++ b/arch/arm/boot/dts/stih407-family.dtsi
>>> @@ -742,18 +742,6 @@
>>>                                  <&clk_s_c0_flexgen CLK_ETH_PHY>;
>>>                 };
>>>
>>> -               cec: sti-cec@094a087c {
>>> -                       compatible = "st,stih-cec";
>>> -                       reg = <0x94a087c 0x64>;
>>> -                       clocks = <&clk_sysin>;
>>> -                       clock-names = "cec-clk";
>>> -                       interrupts = <GIC_SPI 140 IRQ_TYPE_NONE>;
>>> -                       interrupt-names = "cec-irq";
>>> -                       pinctrl-names = "default";
>>> -                       pinctrl-0 = <&pinctrl_cec0_default>;
>>> -                       resets = <&softreset STIH407_LPM_SOFTRESET>;
>>> -               };
>>> -
>>>                 rng10: rng@08a89000 {
>>>                         compatible      = "st,rng";
>>>                         reg             = <0x08a89000 0x1000>;
>>> diff --git a/arch/arm/boot/dts/stih410.dtsi b/arch/arm/boot/dts/stih410.dtsi
>>> index 3c9672c5b09f..21fe72b183d8 100644
>>> --- a/arch/arm/boot/dts/stih410.dtsi
>>> +++ b/arch/arm/boot/dts/stih410.dtsi
>>> @@ -281,5 +281,18 @@
>>>                                  <&clk_s_c0_flexgen CLK_ST231_DMU>,
>>>                                  <&clk_s_c0_flexgen CLK_FLASH_PROMIP>;
>>>                 };
>>> +
>>> +               sti-cec@094a087c {
>>> +                       compatible = "st,stih-cec";
>>> +                       reg = <0x94a087c 0x64>;
>>> +                       clocks = <&clk_sysin>;
>>> +                       clock-names = "cec-clk";
>>> +                       interrupts = <GIC_SPI 140 IRQ_TYPE_NONE>;
>>> +                       interrupt-names = "cec-irq";
>>> +                       pinctrl-names = "default";
>>> +                       pinctrl-0 = <&pinctrl_cec0_default>;
>>> +                       resets = <&softreset STIH407_LPM_SOFTRESET>;
>>> +                       hdmi-phandle = <&sti_hdmi>;
>>> +               };
>>>         };
>>>  };
>>> --
>>> 2.11.0
>>>
>>
>>
>>
> 

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 00/11] video/exynos/sti/cec: add CEC notifier & use in drivers
  2017-03-30  7:47       ` Daniel Vetter
  (?)
@ 2017-03-30 20:29       ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 40+ messages in thread
From: Krzysztof Kozlowski @ 2017-03-30 20:29 UTC (permalink / raw)
  To: Hans Verkuil, Daniel Vetter
  Cc: linux-media, linux-samsung-soc, Russell King,
	Javier Martinez Canillas, dri-devel, Daniel Vetter,
	Marek Szyprowski

On Thu, Mar 30, 2017 at 09:47:00AM +0200, Daniel Vetter wrote:
> On Wed, Mar 29, 2017 at 09:59:34PM +0200, Hans Verkuil wrote:
> > Hi Daniel,
> > 
> > On 29/03/17 19:47, Daniel Vetter wrote:
> > > On Wed, Mar 29, 2017 at 04:15:32PM +0200, Hans Verkuil wrote:
> > >> From: Hans Verkuil <hans.verkuil@cisco.com>
> > >>
> > >> This patch series adds the CEC physical address notifier code, based on
> > >> Russell's code:
> > >>
> > >> https://patchwork.kernel.org/patch/9277043/
> > >>
> > >> It adds support for it to the exynos_hdmi drm driver, adds support for
> > >> it to the CEC framework and finally adds support to the s5p-cec driver,
> > >> which now can be moved out of staging.
> > >>
> > >> Also included is similar code for the STI platform, contributed by
> > >> Benjamin Gaignard.
> > >>
> > >> Tested the exynos code with my Odroid U3 exynos4 devboard.
> > >>
> > >> After discussions with Daniel Vetter and Russell King I have removed
> > >> the EDID/ELD/HPD connect/disconnect events from the notifier and now
> > >> just use it to report the CEC physical address. This also means that
> > >> it is now renamed to CEC notifier instead of HPD notifier and that
> > >> it is now in drivers/media. The block_notifier was dropped as well
> > >> and instead a simple callback is registered. This means that the
> > >> relationship between HDMI and CEC is now 1:1 and no longer 1:n, but
> > >> should this be needed in the future, then that can easily be added
> > >> back.
> > >>
> > >> Daniel, regarding your suggestions here:
> > >>
> > >> http://www.spinics.net/lists/dri-devel/msg133907.html
> > >>
> > >> this patch series maps to your mail above as follows:
> > >>
> > >> struct cec_pin == struct cec_notifier
> > >> cec_(un)register_pin == cec_notifier_get/put
> > >> cec_set_address == cec_notifier_set_phys_addr
> > >> cec_(un)register_callbacks == cec_notifier_(un)register
> > >>
> > >> Comments are welcome. I'd like to get this in for the 4.12 kernel as
> > >> this is a missing piece needed to integrate CEC drivers.
> > >>
> > >> Regards,
> > >>
> > >> 	Hans
> > >>
> > >> Changes since v4:
> > >> - Dropped EDID/ELD/connect/disconnect support. Instead, just report the
> > >>   CEC physical address (and use INVALID when disconnecting).
> > >> - Since this is now completely CEC specific, move it to drivers/media
> > >>   and rename to cec-notifier.
> > >> - Drop block_notifier. Instead just set a callback for the notifier.
> > >> - Use 'hdmi-phandle' in the bindings for both exynos and sti. So no
> > >>   vendor prefix and 'hdmi-phandle' instead of 'hdmi-handle'.
> > >> - Make struct cec_notifier opaque. Add a helper function to get the
> > >>   physical address from a cec_notifier struct.
> > >> - Provide dummy functions in cec-notifier.h so it can be used when
> > >>   CONFIG_MEDIA_CEC_NOTIFIER is undefined.
> > >> - Don't select the CEC notifier in the HDMI drivers. It should only
> > >>   be enabled by actual CEC drivers.
> > > 
> > > I just quickly scaned through it, but this seems to address all my
> > > concerns fully. Thanks for respinning. On the entire pile (or just the
> > > core cec notifier bits):
> > > 
> > > Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > 
> > Fantastic! Thank you very much for your comments.
> > 
> > One last question: the patches for drivers/gpu/drm: can they go through
> > the media subsystem or do you want to take them? They do depend on the first
> > two patches of this series (cec-edid and cec-notifier), so it is a bit more
> > coordination if they have to go through the drm subsystem.
> 
> Doesn't seem to touch anything where I expect conflicts, so as long as it
> shows up in linux-next timely I think that's good. Please poke driver
> maintainers for their ack though, but if they fail to respond within a few
> days you can take my ack for merging the entire pile through media.
> 
> Cheers, Daniel

Hi Hans,

I will take the exynos DTS patch through samsung-soc. If anyone needs it
for bisectability, I can provide a tag.

For the drm and media exynos code, I am not the one to ack.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 05/11] ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi
  2017-03-29 14:15 ` [PATCHv5 05/11] ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi Hans Verkuil
@ 2017-03-30 21:34   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 40+ messages in thread
From: Krzysztof Kozlowski @ 2017-03-30 21:34 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: linux-media, Daniel Vetter, Russell King, dri-devel,
	linux-samsung-soc, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil,
	devicetree

On Wed, Mar 29, 2017 at 04:15:37PM +0200, Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> Add the new hdmi phandle to exynos4.dtsi. This phandle is needed by the
> s5p-cec driver to initialize the CEC notifier framework.
> 
> Tested with my Odroid U3.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> CC: linux-samsung-soc@vger.kernel.org
> CC: devicetree@vger.kernel.org
> CC: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  arch/arm/boot/dts/exynos4.dtsi | 1 +
>  1 file changed, 1 insertion(+)
>

Thanks, applied. Now I noticed that you need it for maintaining the
bisectability for this driver (although it is a staging driver). In that
case, if anyone needs this as well then:


The following changes since commit c1ae3cfa0e89fa1a7ecc4c99031f5e9ae99d9201:

  Linux 4.11-rc1 (2017-03-05 12:59:56 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux.git tags/samsung-dt-hdmi-cec-4.12

for you to fetch changes up to 192c1df4a75499a6ab70aca38c6a7e5e40013d77:

  ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi (2017-03-31 00:21:18 +0300)

----------------------------------------------------------------
Add to hdmi-cec node a phandle to hdmi node for new hdmi-cec notifier.

----------------------------------------------------------------
Hans Verkuil (1):
      ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi

 arch/arm/boot/dts/exynos4.dtsi | 1 +
 1 file changed, 1 insertion(+)


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 04/11] exynos_hdmi: add CEC notifier support
  2017-03-29 14:15   ` Hans Verkuil
  (?)
@ 2017-03-30 21:37   ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 40+ messages in thread
From: Krzysztof Kozlowski @ 2017-03-30 21:37 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: linux-media, Daniel Vetter, Russell King, dri-devel,
	linux-samsung-soc, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil

On Wed, Mar 29, 2017 at 04:15:36PM +0200, Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> Implement the CEC notifier support to allow CEC drivers to
> be informed when there is a new physical address.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/gpu/drm/exynos/exynos_hdmi.c | 20 ++++++++++++++++++--
>  1 file changed, 18 insertions(+), 2 deletions(-)
> 

Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
(you still need Exynos DRM maintainer ack)

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 06/11] s5p-cec.txt: document the HDMI controller phandle
  2017-03-29 14:15   ` Hans Verkuil
  (?)
@ 2017-03-30 21:37   ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 40+ messages in thread
From: Krzysztof Kozlowski @ 2017-03-30 21:37 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: linux-media, Daniel Vetter, Russell King, dri-devel,
	linux-samsung-soc, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil,
	devicetree

On Wed, Mar 29, 2017 at 04:15:38PM +0200, Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> Update the bindings documenting the new hdmi phandle.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> CC: linux-samsung-soc@vger.kernel.org
> CC: devicetree@vger.kernel.org
> CC: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  Documentation/devicetree/bindings/media/s5p-cec.txt | 2 ++
>  1 file changed, 2 insertions(+)
> 

Acked-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 07/11] s5p-cec: add cec-notifier support, move out of staging
  2017-03-29 14:15 ` [PATCHv5 07/11] s5p-cec: add cec-notifier support, move out of staging Hans Verkuil
@ 2017-03-30 21:38   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 40+ messages in thread
From: Krzysztof Kozlowski @ 2017-03-30 21:38 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: linux-media, Daniel Vetter, Russell King, dri-devel,
	linux-samsung-soc, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil

On Wed, Mar 29, 2017 at 04:15:39PM +0200, Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
> 
> By using the CEC 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 <hans.verkuil@cisco.com>
> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> CC: linux-samsung-soc@vger.kernel.org
> CC: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  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 -----
>  12 files changed, 52 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
> 

Acked-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 04/11] exynos_hdmi: add CEC notifier support
  2017-03-29 14:15   ` Hans Verkuil
  (?)
  (?)
@ 2017-03-30 22:35   ` Russell King - ARM Linux
  2017-03-31  8:05       ` Hans Verkuil
  -1 siblings, 1 reply; 40+ messages in thread
From: Russell King - ARM Linux @ 2017-03-30 22:35 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: linux-media, Daniel Vetter, dri-devel, linux-samsung-soc,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil

On Wed, Mar 29, 2017 at 04:15:36PM +0200, Hans Verkuil wrote:
> +	cec_notifier_set_phys_addr(hdata->notifier,
> +				   cec_get_edid_phys_addr(edid));

This pattern causes problems - can we have the notifier taking the EDID
please, and stubs in cec-notifier.h to stub that out?

Maybe something like cec_notifier_set_phys_addr_from_edid(edid) ?

Having converted the tda998x code over to your new notifier, the 0-day
builder reported this tonight:

>> ERROR: "cec_get_edid_phys_addr" [drivers/gpu/drm/i2c/tda998x.ko] undefined!

which is caused exactly by this problem.  I can add #ifdefs into the
tda998x driver, but as you're already stubbing out
cec_notifier_set_phys_addr() in cec-notifier.h, it would be stupid to
have to resort to #ifdefs in driver code to solve this issue.

Thanks.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 04/11] exynos_hdmi: add CEC notifier support
  2017-03-30 22:35   ` Russell King - ARM Linux
@ 2017-03-31  8:05       ` Hans Verkuil
  0 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-31  8:05 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: linux-media, Daniel Vetter, dri-devel, linux-samsung-soc,
	Krzysztof Kozlowski, Inki Dae, Marek Szyprowski,
	Javier Martinez Canillas, Benjamin Gaignard, Hans Verkuil

On 31/03/17 00:35, Russell King - ARM Linux wrote:
> On Wed, Mar 29, 2017 at 04:15:36PM +0200, Hans Verkuil wrote:
>> +	cec_notifier_set_phys_addr(hdata->notifier,
>> +				   cec_get_edid_phys_addr(edid));
> 
> This pattern causes problems - can we have the notifier taking the EDID
> please, and stubs in cec-notifier.h to stub that out?
> 
> Maybe something like cec_notifier_set_phys_addr_from_edid(edid) ?

Good point. I've added this, and as an extra bonus this allowed me to drop
the first cec-edid patch.

> 
> Having converted the tda998x code over to your new notifier, the 0-day
> builder reported this tonight:
> 
>>> ERROR: "cec_get_edid_phys_addr" [drivers/gpu/drm/i2c/tda998x.ko] undefined!
> 
> which is caused exactly by this problem.  I can add #ifdefs into the
> tda998x driver, but as you're already stubbing out
> cec_notifier_set_phys_addr() in cec-notifier.h, it would be stupid to
> have to resort to #ifdefs in driver code to solve this issue.

Will post a new series today. Thanks for pointing this out.

A general note: I am considering merging cec-notifier and cec-edid into the
CEC module itself. However, I want to get this series in first before I start
moving things around. It's been delayed long enough already.

Regards,

	Hans

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCHv5 04/11] exynos_hdmi: add CEC notifier support
@ 2017-03-31  8:05       ` Hans Verkuil
  0 siblings, 0 replies; 40+ messages in thread
From: Hans Verkuil @ 2017-03-31  8:05 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: linux-samsung-soc, Krzysztof Kozlowski, Javier Martinez Canillas,
	Hans Verkuil, dri-devel, Daniel Vetter, Marek Szyprowski,
	linux-media

On 31/03/17 00:35, Russell King - ARM Linux wrote:
> On Wed, Mar 29, 2017 at 04:15:36PM +0200, Hans Verkuil wrote:
>> +	cec_notifier_set_phys_addr(hdata->notifier,
>> +				   cec_get_edid_phys_addr(edid));
> 
> This pattern causes problems - can we have the notifier taking the EDID
> please, and stubs in cec-notifier.h to stub that out?
> 
> Maybe something like cec_notifier_set_phys_addr_from_edid(edid) ?

Good point. I've added this, and as an extra bonus this allowed me to drop
the first cec-edid patch.

> 
> Having converted the tda998x code over to your new notifier, the 0-day
> builder reported this tonight:
> 
>>> ERROR: "cec_get_edid_phys_addr" [drivers/gpu/drm/i2c/tda998x.ko] undefined!
> 
> which is caused exactly by this problem.  I can add #ifdefs into the
> tda998x driver, but as you're already stubbing out
> cec_notifier_set_phys_addr() in cec-notifier.h, it would be stupid to
> have to resort to #ifdefs in driver code to solve this issue.

Will post a new series today. Thanks for pointing this out.

A general note: I am considering merging cec-notifier and cec-edid into the
CEC module itself. However, I want to get this series in first before I start
moving things around. It's been delayed long enough already.

Regards,

	Hans
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2017-03-31  8:05 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-29 14:15 [PATCHv5 00/11] video/exynos/sti/cec: add CEC notifier & use in drivers Hans Verkuil
2017-03-29 14:15 ` Hans Verkuil
2017-03-29 14:15 ` [PATCHv5 01/11] cec-edid: rename cec_get_edid_phys_addr Hans Verkuil
2017-03-29 14:15 ` [PATCHv5 02/11] media: add CEC notifier support Hans Verkuil
2017-03-29 14:15 ` [PATCHv5 03/11] cec: integrate " Hans Verkuil
2017-03-29 15:44   ` [PATCHv5.1 " Hans Verkuil
2017-03-29 15:44     ` Hans Verkuil
2017-03-29 14:15 ` [PATCHv5 04/11] exynos_hdmi: add " Hans Verkuil
2017-03-29 14:15   ` Hans Verkuil
2017-03-30 21:37   ` Krzysztof Kozlowski
2017-03-30 22:35   ` Russell King - ARM Linux
2017-03-31  8:05     ` Hans Verkuil
2017-03-31  8:05       ` Hans Verkuil
2017-03-29 14:15 ` [PATCHv5 05/11] ARM: dts: exynos: add HDMI controller phandle to exynos4.dtsi Hans Verkuil
2017-03-30 21:34   ` Krzysztof Kozlowski
2017-03-29 14:15 ` [PATCHv5 06/11] s5p-cec.txt: document the HDMI controller phandle Hans Verkuil
2017-03-29 14:15   ` Hans Verkuil
2017-03-30 21:37   ` Krzysztof Kozlowski
2017-03-29 14:15 ` [PATCHv5 07/11] s5p-cec: add cec-notifier support, move out of staging Hans Verkuil
2017-03-30 21:38   ` Krzysztof Kozlowski
2017-03-29 14:15 ` [PATCHv5 08/11] sti: hdmi: add CEC notifier support Hans Verkuil
2017-03-29 14:15   ` Hans Verkuil
2017-03-29 14:15 ` [PATCHv5 09/11] stih-cec.txt: document new hdmi phandle Hans Verkuil
2017-03-29 14:15 ` [PATCHv5 10/11] stih-cec: add CEC notifier support Hans Verkuil
2017-03-29 14:15   ` Hans Verkuil
2017-03-29 14:15 ` [PATCHv5 11/11] arm: sti: update sti-cec for " Hans Verkuil
2017-03-30  7:41   ` Benjamin Gaignard
2017-03-30  7:41     ` Benjamin Gaignard
     [not found]     ` <CA+M3ks442wftNR8+dctdSkKMCPSw9Rd2CH5UG-VEP7XySGjCjw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-03-30  9:30       ` Patrice CHOTARD
2017-03-30  9:30         ` Patrice CHOTARD
2017-03-30  9:32         ` Hans Verkuil
2017-03-29 15:55 ` [PATCHv5 00/11] video/exynos/sti/cec: add CEC notifier & use in drivers Benjamin Gaignard
2017-03-29 15:55   ` Benjamin Gaignard
2017-03-29 17:47 ` Daniel Vetter
2017-03-29 17:47   ` Daniel Vetter
2017-03-29 19:59   ` Hans Verkuil
2017-03-29 19:59     ` Hans Verkuil
2017-03-30  7:47     ` Daniel Vetter
2017-03-30  7:47       ` Daniel Vetter
2017-03-30 20:29       ` Krzysztof Kozlowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.