Skip to contentSkip to conversation

IT6505 cover letter

PATCH Superseded allen 3 participants 7 messages Jan 20, 2020 – Jan 21, 2020

Subsystems (7)

v6 of 9 Superseded Latest is v9 →

lore
Share & tools
lore

allen

author
#0 lore raw

v6 cover IT6505 cover letter

The IT6505 is a high-performance DisplayPort 1.1a transmitter, fully compliant with DisplayPort 1.1a, HDCP 1.3 specifications. The IT6505 supports color depth of up to 36 bits (12 bits/color) and ensures robust transmission of high-quality uncompressed video content, along with uncompressed and compressed digital audio content.

This series contains document bindings, revert commit, add vendor prefix, Kconfig to control the function enable or not.

Allen Chen (1):
WIP: drm/bridge: add it6505 driver

allen (3):
dt-bindings: Add vendor prefix for ITE Tech. Inc. Revert "drm/tegra: Move drm_dp_link helpers to Tegra DRM"
WIP: dt-bindings: Add binding for IT6505.

 .../bindings/display/bridge/ite,it6505.yaml        |   89 +
 .../devicetree/bindings/vendor-prefixes.yaml       |    2 +
 drivers/gpu/drm/bridge/Kconfig                     |    7 +
 drivers/gpu/drm/bridge/Makefile                    |    1 +
 drivers/gpu/drm/bridge/ite-it6505.c                | 2698 ++++++++++++++++++++
 drivers/gpu/drm/drm_dp_helper.c                    |  128 +
 drivers/gpu/drm/tegra/Makefile                     |    1 -
 drivers/gpu/drm/tegra/dp.c                         |  876 -------
 drivers/gpu/drm/tegra/dp.h                         |  177 --
 drivers/gpu/drm/tegra/dpaux.c                      |    1 -
 drivers/gpu/drm/tegra/sor.c                        |    1 -
 include/drm/drm_dp_helper.h                        |   16 +
 12 files changed, 2941 insertions(+), 1056 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/ite,it6505.yaml
 create mode 100644 drivers/gpu/drm/bridge/ite-it6505.c
 delete mode 100644 drivers/gpu/drm/tegra/dp.c
 delete mode 100644 drivers/gpu/drm/tegra/dp.h
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v6 1/4 dt-bindings: Add vendor prefix for ITE Tech. Inc.

ITE Tech. Inc. (abbreviated as ITE ) is a professional fabless IC design house. ITE's core technology includes PC and NB Controller chips, Super I/O, High Speed Serial Interface, Video Codec, Touch Sensing, Surveillance, OFDM, Sensor Fusion, and so on.

more information on: http://www.ite.com.tw/

---
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 6046f45..552f5ef 100644
@@ -463,6 +463,8 @@ patternProperties:
     description: Intersil
   "^issi,.*":
     description: Integrated Silicon Solutions Inc.
+  "^ite,.*":
+    description: ITE Tech. Inc.
   "^itead,.*":
     description: ITEAD Intelligent Systems Co.Ltd
   "^iwave,.*":
Signature · 1 line
1.9.1
author
#2 lore raw

PATCH v6 2/4 Revert "drm/tegra: Move drm_dp_link helpers to Tegra DRM"

In reply to allen

IT6505 driver ite-it6505.c file using drm_dp_link helpers, so revert. This reverts commit 9a42c7c647a9ad0f7ebb147a52eda3dcb7c84292.

---
 drivers/gpu/drm/drm_dp_helper.c | 128 ++++++
 drivers/gpu/drm/tegra/Makefile  |   1 -
 drivers/gpu/drm/tegra/dp.c      | 876 ----------------------------------------
 drivers/gpu/drm/tegra/dp.h      | 177 --------
 drivers/gpu/drm/tegra/dpaux.c   |   1 -
 drivers/gpu/drm/tegra/sor.c     |   1 -
 include/drm/drm_dp_helper.h     |  16 +
 7 files changed, 144 insertions(+), 1056 deletions(-)
 delete mode 100644 drivers/gpu/drm/tegra/dp.c
 delete mode 100644 drivers/gpu/drm/tegra/dp.h
drivers/gpu/drm/drm_dp_helper.c +128 -0
index 2c7870a..f567141 100644
@@ -352,6 +352,134 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
 EXPORT_SYMBOL(drm_dp_dpcd_read_link_status);
 
 /**
+ * drm_dp_link_probe() - probe a DisplayPort link for capabilities
+ * @aux: DisplayPort AUX channel
+ * @link: pointer to structure in which to return link capabilities
+ *
+ * The structure filled in by this function can usually be passed directly
+ * into drm_dp_link_power_up() and drm_dp_link_configure() to power up and
+ * configure the link based on the link's capabilities.
+ *
+ * Returns 0 on success or a negative error code on failure.
+ */
+int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link)
+{
+	u8 values[3];
+	int err;
+
+	memset(link, 0, sizeof(*link));
+
+	err = drm_dp_dpcd_read(aux, DP_DPCD_REV, values, sizeof(values));
+	if (err < 0)
+		return err;
+
+	link->revision = values[0];
+	link->rate = drm_dp_bw_code_to_link_rate(values[1]);
+	link->num_lanes = values[2] & DP_MAX_LANE_COUNT_MASK;
+
+	if (values[2] & DP_ENHANCED_FRAME_CAP)
+		link->capabilities |= DP_LINK_CAP_ENHANCED_FRAMING;
+
+	return 0;
+}
+EXPORT_SYMBOL(drm_dp_link_probe);
+
+/**
+ * drm_dp_link_power_up() - power up a DisplayPort link
+ * @aux: DisplayPort AUX channel
+ * @link: pointer to a structure containing the link configuration
+ *
+ * Returns 0 on success or a negative error code on failure.
+ */
+int drm_dp_link_power_up(struct drm_dp_aux *aux, struct drm_dp_link *link)
+{
+	u8 value;
+	int err;
+
+	/* DP_SET_POWER register is only available on DPCD v1.1 and later */
+	if (link->revision < 0x11)
+		return 0;
+
+	err = drm_dp_dpcd_readb(aux, DP_SET_POWER, &value);
+	if (err < 0)
+		return err;
+
+	value &= ~DP_SET_POWER_MASK;
+	value |= DP_SET_POWER_D0;
+
+	err = drm_dp_dpcd_writeb(aux, DP_SET_POWER, value);
+	if (err < 0)
+		return err;
+
+	/*
+	 * According to the DP 1.1 specification, a "Sink Device must exit the
+	 * power saving state within 1 ms" (Section 2.5.3.1, Table 5-52, "Sink
+	 * Control Field" (register 0x600).
+	 */
+	usleep_range(1000, 2000);
+
+	return 0;
+}
+EXPORT_SYMBOL(drm_dp_link_power_up);
+
+/**
+ * drm_dp_link_power_down() - power down a DisplayPort link
+ * @aux: DisplayPort AUX channel
+ * @link: pointer to a structure containing the link configuration
+ *
+ * Returns 0 on success or a negative error code on failure.
+ */
+int drm_dp_link_power_down(struct drm_dp_aux *aux, struct drm_dp_link *link)
+{
+	u8 value;
+	int err;
+
+	/* DP_SET_POWER register is only available on DPCD v1.1 and later */
+	if (link->revision < 0x11)
+		return 0;
+
+	err = drm_dp_dpcd_readb(aux, DP_SET_POWER, &value);
+	if (err < 0)
+		return err;
+
+	value &= ~DP_SET_POWER_MASK;
+	value |= DP_SET_POWER_D3;
+
+	err = drm_dp_dpcd_writeb(aux, DP_SET_POWER, value);
+	if (err < 0)
+		return err;
+
+	return 0;
+}
+EXPORT_SYMBOL(drm_dp_link_power_down);
+
+/**
+ * drm_dp_link_configure() - configure a DisplayPort link
+ * @aux: DisplayPort AUX channel
+ * @link: pointer to a structure containing the link configuration
+ *
+ * Returns 0 on success or a negative error code on failure.
+ */
+int drm_dp_link_configure(struct drm_dp_aux *aux, struct drm_dp_link *link)
+{
+	u8 values[2];
+	int err;
+
+	values[0] = drm_dp_link_rate_to_bw_code(link->rate);
+	values[1] = link->num_lanes;
+
+	if (link->capabilities & DP_LINK_CAP_ENHANCED_FRAMING)
+		values[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN;
+
+	err = drm_dp_dpcd_write(aux, DP_LINK_BW_SET, values, sizeof(values));
+	if (err < 0)
+		return err;
+
+	return 0;
+}
+EXPORT_SYMBOL(drm_dp_link_configure);
+
+/**
  * drm_dp_downstream_max_clock() - extract branch device max
  *                                 pixel rate for legacy VGA
  *                                 converter or max TMDS clock
drivers/gpu/drm/tegra/Makefile +0 -1
index d6cf202..33c463e 100644
@@ -5,7 +5,6 @@ tegra-drm-y := \
 	drm.o \
 	gem.o \
 	fb.o \
-	dp.o \
 	hub.o \
 	plane.o \
 	dc.o \
drivers/gpu/drm/tegra/dp.c deleted +0 -876

876 lines not on this page · raw message

drivers/gpu/drm/tegra/dp.h deleted +0 -177

177 lines not on this page · raw message

drivers/gpu/drm/tegra/dpaux.c +0 -1
index 622cdf1..066177a 100644
@@ -23,7 +23,6 @@
 #include <drm/drm_dp_helper.h>
 #include <drm/drm_panel.h>
 
-#include "dp.h"
 #include "dpaux.h"
 #include "drm.h"
 #include "trace.h"
drivers/gpu/drm/tegra/sor.c +0 -1
index 615cb31..29c3ae8 100644
@@ -25,7 +25,6 @@
 #include <drm/drm_scdc_helper.h>
 
 #include "dc.h"
-#include "dp.h"
 #include "drm.h"
 #include "hda.h"
 #include "sor.h"
include/drm/drm_dp_helper.h +16 -0
index 51ecb51..04f6c0b 100644
@@ -1455,6 +1455,22 @@ static inline ssize_t drm_dp_dpcd_writeb(struct drm_dp_aux *aux,
 int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
 				 u8 status[DP_LINK_STATUS_SIZE]);
 
+/*
+ * DisplayPort link
+ */
+#define DP_LINK_CAP_ENHANCED_FRAMING (1 << 0)
+
+struct drm_dp_link {
+	unsigned char revision;
+	unsigned int rate;
+	unsigned int num_lanes;
+	unsigned long capabilities;
+};
+
+int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link);
+int drm_dp_link_power_up(struct drm_dp_aux *aux, struct drm_dp_link *link);
+int drm_dp_link_power_down(struct drm_dp_aux *aux, struct drm_dp_link *link);
+int drm_dp_link_configure(struct drm_dp_aux *aux, struct drm_dp_link *link);
 int drm_dp_downstream_max_clock(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
 				const u8 port_cap[4]);
 int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
Signature · 1 line
1.9.1
Reviewed-by Daniel Vetter on v6 2/4
#3 lore raw

Re: [PATCH v6 2/4] Revert "drm/tegra: Move drm_dp_link helpers to Tegra DRM"

Quoted 4 lines · allen

IT6505 driver ite-it6505.c file using drm_dp_link helpers, so revert. This reverts commit 9a42c7c647a9ad0f7ebb147a52eda3dcb7c84292.

Quoted 11 lines
---
 drivers/gpu/drm/drm_dp_helper.c | 128 ++++++
 drivers/gpu/drm/tegra/Makefile  |   1 -
 drivers/gpu/drm/tegra/dp.c      | 876 ----------------------------------------
 drivers/gpu/drm/tegra/dp.h      | 177 --------
 drivers/gpu/drm/tegra/dpaux.c   |   1 -
 drivers/gpu/drm/tegra/sor.c     |   1 -
 include/drm/drm_dp_helper.h     |  16 +
 7 files changed, 144 insertions(+), 1056 deletions(-)
 delete mode 100644 drivers/gpu/drm/tegra/dp.c
 delete mode 100644 drivers/gpu/drm/tegra/dp.h

Sorry, but no. Please just duplicate whatever information you need from these helpers into your driver. The decision was made recently to remove these helpers because they were a premature generalization and unlikely to be useful very widely. See this commit:

commit 9a42c7c647a9ad0f7ebb147a52eda3dcb7c84292

Author: Thierry Reding <[email protected]>
Date:   Mon Oct 21 16:34:37 2019 +0200

drm/tegra: Move drm_dp_link helpers to Tegra DRM

During the discussion of patches that enhance the drm_dp_link helpers it was concluded that these helpers aren't very useful to begin with. After all other drivers have been converted not to use these helpers anymore, move these helpers into the last remaining user: Tegra DRM.

If at some point these helpers are deemed more widely useful, they can be moved out into the DRM DP helpers again.

Your new driver here doesn't change that, in my opinion, so just follow what we did for other drivers and duplicate the corresponding code into the driver.

Thierry

author
#4 lore raw

PATCH v6 3/4 dt-bindings: Add binding for IT6505.

In reply to allen

Add a DT binding documentation for IT6505.

---
 .../bindings/display/bridge/ite,it6505.yaml        | 89 ++++++++++++++++++++++
 1 file changed, 89 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/ite,it6505.yaml
Documentation/devicetree/bindings/display/bridge/ite,it6505.yaml new file +89 -0
new file mode 100644
index 00000000..5c152ca8
@@ -0,0 +1,89 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/ite,it6505.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ITE it6505 Device Tree Bindings
+
+maintainers:
+  - Allen Chen <[email protected]>
+
+description: |
+  The IT6505 is a high-performance DisplayPort 1.1a transmitter,
+  fully compliant with DisplayPort 1.1a, HDCP 1.3 specifications.
+  The IT6505 supports color depth of up to 36 bits (12 bits/color)
+  and ensures robust transmission of high-quality uncompressed video
+  content, along with uncompressed and compressed digital audio content.
+
+  Aside from the various video output formats supported, the IT6505
+  also encodes and transmits up to 8 channels of I2S digital audio,
+  with sampling rate up to 192kHz and sample size up to 24 bits.
+  In addition, an S/PDIF input port takes in compressed audio of up to
+  192kHz frame rate.
+
+  Each IT6505 chip comes preprogrammed with an unique HDCP key,
+  in compliance with the HDCP 1.3 standard so as to provide secure
+  transmission of high-definition content. Users of the IT6505 need not
+  purchase any HDCP keys or ROMs.
+
+properties:
+  compatible:
+    const: ite,it6505
+
+  reg:
+    maxItems: 1
+    description: i2c address of the bridge
+
+  ovdd-supply:
+    maxItems: 1
+    description: I/O voltage
+
+  pwr18-supply:
+    maxItems: 1
+    description: core voltage
+
+  interrupts:
+    maxItems: 1
+    description: interrupt specifier of INT pin
+
+  reset-gpios:
+    maxItems: 1
+    description: gpio specifier of RESET pin
+
+  extcon:
+    maxItems: 1
+    description: extcon specifier for the Power Delivery
+
+  port:
+    type: object
+    description: A port node pointing to DPI host port node
+
+required:
+  - compatible
+  - reg
+  - ovdd-supply
+  - pwr18-supply
+  - interrupts
+  - reset-gpios
+  - extcon
+
+examples:
+  - |
+    dp-bridge@5c {
+        compatible = "ite,it6505";
+        interrupts = <152 IRQ_TYPE_EDGE_RISING 152 0>;
+        reg = <0x5c>;
+        pinctrl-names = "default";
+        pinctrl-0 = <&it6505_pins>;
+        ovdd-supply = <&mt6358_vsim1_reg>;
+        pwr18-supply = <&it6505_pp18_reg>;
+        reset-gpios = <&pio 179 1>;
+        extcon = <&usbc_extcon>;
+
+        port {
+            it6505_in: endpoint {
+                remote-endpoint = <&dpi_out>;
+            };
+        };
+    };
Signature · 1 line
1.9.1
maintainer
#5 lore raw

Re: [PATCH v6 3/4] dt-bindings: Add binding for IT6505.

Quoted 10 lines · allen

Add a DT binding documentation for IT6505.

---
 .../bindings/display/bridge/ite,it6505.yaml        | 89 ++++++++++++++++++++++
 1 file changed, 89 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/display/bridge/ite,it6505.yaml

My bot found errors running 'make dt_binding_check' on your patch:

Error: Documentation/devicetree/bindings/display/bridge/ite,it6505.example.dts:19.31-32 syntax error
FATAL ERROR: Unable to parse input tree
scripts/Makefile.lib:300: recipe for target 'Documentation/devicetree/bindings/display/bridge/ite,it6505.example.dt.yaml' failed make[1]: *** [Documentation/devicetree/bindings/display/bridge/ite,it6505.example.dt.yaml] Error 1 Makefile:1263: recipe for target 'dt_binding_check' failed
make: *** [dt_binding_check] Error 2

See https://patchwork.ozlabs.org/patch/1225618
Please check and re-submit.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#6 lore raw

PATCH v6 4/4 drm/bridge: add it6505 driver

In reply to allen

From: Allen Chen <[email protected]>

This adds support for the iTE IT6505.
This device can convert DPI signal to DP output.

---
 drivers/gpu/drm/bridge/Kconfig      |    7 +
 drivers/gpu/drm/bridge/Makefile     |    1 +
 drivers/gpu/drm/bridge/ite-it6505.c | 2698 +++++++++++++++++++++++++++++++++++
 3 files changed, 2706 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/ite-it6505.c
drivers/gpu/drm/bridge/Kconfig +7 -0
index 3436297..c8cfaf7 100644
@@ -45,6 +45,13 @@ config DRM_DUMB_VGA_DAC
 	  Support for non-programmable RGB to VGA DAC bridges, such as ADI
 	  ADV7123, TI THS8134 and THS8135 or passive resistor ladder DACs.
 
+config DRM_ITE_IT6505
+	tristate "ITE IT6505 DP bridge"
+	depends on OF
+	select DRM_KMS_HELPER
+	help
+	  ITE IT6505 DP bridge chip driver.
+
 config DRM_LVDS_ENCODER
 	tristate "Transparent parallel to LVDS encoder support"
 	depends on OF
drivers/gpu/drm/bridge/Makefile +1 -0
index 4934fcf..f5abca5 100644
@@ -2,6 +2,7 @@
 obj-$(CONFIG_DRM_ANALOGIX_ANX78XX) += analogix-anx78xx.o
 obj-$(CONFIG_DRM_CDNS_DSI) += cdns-dsi.o
 obj-$(CONFIG_DRM_DUMB_VGA_DAC) += dumb-vga-dac.o
+obj-$(CONFIG_DRM_ITE_IT6505) += ite-it6505.o
 obj-$(CONFIG_DRM_LVDS_ENCODER) += lvds-encoder.o
 obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v3-fw.o
 obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o
drivers/gpu/drm/bridge/ite-it6505.c new file +2698 -0

2,698 lines not on this page · raw message

Signature · 7 lines
1.9.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel