Raspberry Pi Touchscreen bridge/panel drivers
Subsystems (7)
cover Raspberry Pi Touchscreen bridge/panel drivers
Here's the rewrite of the Raspberry Pi display support to split out a bridge driver representing the toshiba+atmel pair. It depends on the panel-bridge layer I've submitted.
The RPi DSI stack isn't completely working yet -- I've got some flickery pixels on the display where it seems some color values are unstable (on the default debian swirl desktop image, they're particularly visible as pink sparkles near the edge of the swirls). So far messing with clocks, not setting clocks at all, forcing the firmware's DSI timings, and a bunch of other hacks haven't managed to resolve it. Still, I think this driver stack is useful to have, and I assume that fixing this will be a small bugfix somewhere later.
Eric Anholt (4):
drm/vc4: Adjust modes in DSI to work around the integer PLL divider.
dt-bindings: Document the Raspberry Pi Touchscreen nodes. drm/bridge: Add support for the Raspberry Pi 7" Touchscreen. drm/panel: Add the Raspberry Pi 7" touchscreen's panel.
.../raspberrypi,7inch-touchscreen-bridge.txt | 68 +++ .../panel/raspberrypi,7inch-touchscreen-panel.txt | 7 + drivers/gpu/drm/bridge/Kconfig | 9 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/raspberrypi-touchscreen.c | 460 +++++++++++++++++++++ drivers/gpu/drm/panel/panel-simple.c | 30 ++ drivers/gpu/drm/vc4/vc4_dsi.c | 112 +++-- 7 files changed, 661 insertions(+), 26 deletions(-) create mode 100644 Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt create mode 100644 Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscreen-panel.txt create mode 100644 drivers/gpu/drm/bridge/raspberrypi-touchscreen.c
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/4 drm/vc4: Adjust modes in DSI to work around the integer PLL divider.
BCM2835's PLLD_DSI1 divider doesn't give us many choices for our pixel clocks, so to support panels on the Raspberry Pi we need to set a higher pixel clock rate than requested and adjust the mode we program to extend out the HFP so that the refresh rate matches.
--- drivers/gpu/drm/vc4/vc4_dsi.c | 112 ++++++++++++++++++++++++++++++++---------- 1 file changed, 86 insertions(+), 26 deletions(-)
drivers/gpu/drm/vc4/vc4_dsi.c +86 -26
@@ -519,7 +519,8 @@ struct vc4_dsi {/* DSI channel for the panel we're connected to. */ u32 channel;u32 lanes; -enum mipi_dsi_pixel_format format; +u32 format; +u32 divider;u32 mode_flags;/* Input clock from CPRMAN to the digital PHY, for the DSI
@@ -817,13 +818,67 @@ static void vc4_dsi_encoder_disable(struct drm_encoder *encoder)pm_runtime_put (dev); } +/* Extends the mode's blank intervals to handle BCM2835's integer-only +* DSI PLL divider. +* +* On 2835, PLLD is set to 2Ghz, and may not be changed by the display +* driver since most peripherals are hanging off of the PLLD_PER +* divider. PLLD_DSI1, which drives our DSI bit clock (and therefore +* the pixel clock), only has an integer divider off of DSI. +* +* To get our panel mode to refresh at the expected 60Hz, we need to +* extend the horizontal blank time. This means we drive a +* higher-than-expected clock rate to the panel, but that's what the +* firmware (which ) does too. +*/ +static bool vc4_dsi_encoder_mode_fixup (struct drm_encoder *encoder, +const struct drm_display_mode *mode, +struct drm_display_mode *adjusted_mode) +{ +struct vc4_dsi_encoder *vc4_encoder =to_vc4_dsi_encoder (encoder); +struct vc4_dsi *dsi = vc4_encoder->dsi; +struct clk *phy_parent =clk_get_parent (dsi->pll_phy_clock); +unsigned long parent_rate =clk_get_rate (phy_parent); +unsigned long pixel_clock_hz = mode->clock *1000 ; +unsigned long pll_clock = pixel_clock_hz * dsi->divider; +int divider; + +/* Find what divider gets us a faster clock than the requested +* pixel clock. +*/ +for (divider =1 ; divider <8 ; divider++) { +if (parent_rate / divider < pll_clock) { + divider--; +break ; + } + } + +/* Now that we've picked a PLL divider, calculate back to its +* pixel clock. +*/ + pll_clock = parent_rate / divider; + pixel_clock_hz = pll_clock / dsi->divider; + +/* Round up the clk_set_rate() request slightly, since +* PLLD_DSI1 is an integer divider and its rate selection will +* never round up. +*/ + adjusted_mode->clock = pixel_clock_hz /1000 +1 ; + +/* Given the new pixel clock, adjust HFP to keep vrefresh the same. */ + adjusted_mode->htotal = pixel_clock_hz / (mode->vrefresh * mode->vtotal); + adjusted_mode->hsync_end += adjusted_mode->htotal - mode->htotal; + adjusted_mode->hsync_start += adjusted_mode->htotal - mode->htotal; + +return true; +} +static void vc4_dsi_encoder_enable (struct drm_encoder *encoder) { -struct drm_display_mode *mode = &encoder->crtc->mode; +struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;struct vc4_dsi_encoder *vc4_encoder =to_vc4_dsi_encoder (encoder);struct vc4_dsi *dsi = vc4_encoder->dsi;struct device *dev = &dsi->pdev->dev; -u32 format =0 , divider =0 ;bool debug_dump_regs = false;unsigned long hs_clock;u32 ui_ns;
@@ -845,26 +900,7 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)vc4_dsi_dump_regs (dsi); } -switch (dsi->format) { -case MIPI_DSI_FMT_RGB888 : - format =DSI_PFORMAT_RGB888 ; - divider =24 / dsi->lanes; -break ; -case MIPI_DSI_FMT_RGB666 : - format =DSI_PFORMAT_RGB666 ; - divider =24 / dsi->lanes; -break ; -case MIPI_DSI_FMT_RGB666_PACKED : - format =DSI_PFORMAT_RGB666_PACKED ; - divider =18 / dsi->lanes; -break ; -case MIPI_DSI_FMT_RGB565 : - format =DSI_PFORMAT_RGB565 ; - divider =16 / dsi->lanes; -break ; - } - - phy_clock = pixel_clock_hz * divider; + phy_clock = pixel_clock_hz * dsi->divider; ret =clk_set_rate (dsi->pll_phy_clock, phy_clock);if (ret) { dev_err(&dsi->pdev->dev,
@@ -1049,8 +1085,9 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)if (dsi->mode_flags &MIPI_DSI_MODE_VIDEO ) { DSI_PORT_WRITE(DISP0_CTRL, - VC4_SET_FIELD(divider, DSI_DISP0_PIX_CLK_DIV) | - VC4_SET_FIELD(format, DSI_DISP0_PFORMAT) | + VC4_SET_FIELD(dsi->divider, + DSI_DISP0_PIX_CLK_DIV) | + VC4_SET_FIELD(dsi->format, DSI_DISP0_PFORMAT) | VC4_SET_FIELD(DSI_DISP0_LP_STOP_PERFRAME, DSI_DISP0_LP_STOP_CTRL) | DSI_DISP0_ST_END |
@@ -1255,9 +1292,31 @@ static int vc4_dsi_host_attach(struct mipi_dsi_host *host, dsi->lanes = device->lanes; dsi->channel = device->channel; - dsi->format = device->format; dsi->mode_flags = device->mode_flags; +switch (device->format) { +case MIPI_DSI_FMT_RGB888 : + dsi->format =DSI_PFORMAT_RGB888 ; + dsi->divider =24 / dsi->lanes; +break ; +case MIPI_DSI_FMT_RGB666 : + dsi->format =DSI_PFORMAT_RGB666 ; + dsi->divider =24 / dsi->lanes; +break ; +case MIPI_DSI_FMT_RGB666_PACKED : + dsi->format =DSI_PFORMAT_RGB666_PACKED ; + dsi->divider =18 / dsi->lanes; +break ; +case MIPI_DSI_FMT_RGB565 : + dsi->format =DSI_PFORMAT_RGB565 ; + dsi->divider =16 / dsi->lanes; +break ; +default : +dev_err (&dsi->pdev->dev,"Unknown DSI format: %d.\n" , + dsi->format); +return 0 ; + } +if (!(dsi->mode_flags &MIPI_DSI_MODE_VIDEO )) {dev_err (&dsi->pdev->dev,"Only VIDEO mode panels supported currently.\n" );
@@ -1304,6 +1363,7 @@ static const struct mipi_dsi_host_ops vc4_dsi_host_ops = {static const struct drm_encoder_helper_funcs vc4_dsi_encoder_helper_funcs = { .disable = vc4_dsi_encoder_disable, .enable = vc4_dsi_encoder_enable, + .mode_fixup = vc4_dsi_encoder_mode_fixup, };static const struct of_device_id vc4_dsi_dt_match[] = {
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/4 dt-bindings: Document the Raspberry Pi Touchscreen nodes.
In reply to Eric AnholtThe Raspberry Pi 7" Touchscreen is a DPI touchscreen panel with DSI->DPI bridge and touchscreen controller integrated, that connects to the Raspberry Pi through its 15-pin "DSI" connector (some lines are DSI, some lines are I2C).
This device is represented in the DT as three nodes (DSI device, I2C device, panel). Input will be left to a separate binding later, as it will be a basic I2C client device.
--- .../raspberrypi,7inch-touchscreen-bridge.txt | 68 ++++++++++++++++++++++ .../panel/raspberrypi,7inch-touchscreen-panel.txt | 7 +++ 2 files changed, 75 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt create mode 100644 Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscreen-panel.txt
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +68 -0
@@ -0,0 +1,68 @@ +Official 7" (800x480) Raspberry Pi touchscreen panel's bridge. + +This DSI panel contains: + +- TC358762 DSI->DPI bridge +- Atmel microcontroller on I2C for power sequencing the DSI bridge and + controlling backlight +- Touchscreen controller on I2C for touch input + +and this covers the TC358762 bridge and Atmel microcontroller, while +../panel/raspberrypi,7inch-touchscreen-panel.txt covers the panel. + +Required properties: +- compatible: Must be "raspberrypi,7inch-touchscreen-bridge" +- raspberrypi,touchscreen-bridge: + Handle to the I2C device for Atmel microcontroller + +Example: + +dsi1: dsi@7e700000 { + #address-cells = <1>; + #size-cells = <0>; + <...> + + lcd-bridge@0 { + compatible = "raspberrypi,7inch-touchscreen-bridge"; + reg = <0>; + + raspberrypi,touchscreen-bridge = <&pitouchscreen_bridge>; + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + pitouchscreen_bridge_port: endpoint { + remote-endpoint = <&pitouchscreen_panel_port>; + }; + }; + }; + }; +}; + +i2c_dsi: i2c { + compatible = "i2c-gpio"; + #address-cells = <1>; + #size-cells = <0>; + gpios = <&gpio 28 0 + &gpio 29 0>; + + pitouchscreen_bridge: bridge@45 { + compatible = "raspberrypi,touchscreen-bridge-i2c"; + reg = <0x45>; + }; +}; + +lcd { + compatible = "raspberrypi,7inch-touchscreen-panel"; + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + pitouchscreen_panel_port: endpoint { + remote-endpoint = <&pitouchscreen_bridge_port>; + }; + }; + }; +};
Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscreen-panel.txt new file +7 -0
@@ -0,0 +1,7 @@ +Official 7" (800x480) Raspberry Pi touchscreen panel's panel. + +This binding is compatible with the simple-panel binding, which is specified +in simple-panel.txt in this directory. + +Required properties: +- compatible: Must be "raspberrypi,7inch-touchscreen-panel"
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/4 drm/bridge: Add support for the Raspberry Pi 7" Touchscreen.
In reply to Eric AnholtThis driver communicates with the Atmel microcontroller for sequencing the poweron of the TC358762 DSI-DPI bridge and controlling the backlight PWM.
The following lines are required in config.txt, to keep the firmware from trying to bash our I2C lines and steal the DSI interrupts:
disable_touchscreen=1
ignore_lcd=2
mask_gpu_interrupt1=0x1000This means that the firmware won't power on the panel at boot time (no rainbow) and the touchscreen input won't work. A native input driver for the touchscreen still needs to be written.
--- drivers/gpu/drm/bridge/Kconfig | 9 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/raspberrypi-touchscreen.c | 460 +++++++++++++++++++++++ 3 files changed, 470 insertions(+) create mode 100644 drivers/gpu/drm/bridge/raspberrypi-touchscreen.c
drivers/gpu/drm/bridge/Kconfig +9 -0
@@ -76,6 +76,15 @@ config DRM_SIL_SII8620 help Silicon Image SII8620 HDMI/MHL bridge chip driver. +config DRM_RASPBERRYPI_TOUCHSCREEN_BRIDGE + tristate "Raspberry Pi 7-inch touchscreen bridge" + depends on OF + select DRM_KMS_HELPER + help + Say Y here if you want to enable support for the Raspberry + Pi 7" Touchscreen. To compile this driver as a module, + choose M here. + config DRM_SII902X tristate "Silicon Image sii902x RGB/HDMI bridge" depends on OF
drivers/gpu/drm/bridge/Makefile +1 -0
@@ -6,6 +6,7 @@ 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 obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o +obj-$(CONFIG_DRM_RASPBERRYPI_TOUCHSCREEN_BRIDGE) += raspberrypi-touchscreen.o obj-$(CONFIG_DRM_SIL_SII8620) += sil-sii8620.o obj-$(CONFIG_DRM_SII902X) += sii902x.o obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o
drivers/gpu/drm/bridge/raspberrypi-touchscreen.c new file +460 -0
460 lines not on this page · raw message
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 4/4 drm/panel: Add the Raspberry Pi 7" touchscreen's panel.
In reply to Eric AnholtThe timings are those that the firmware defines as the baseline, which will be modified by the bridge/host as necessary to get the clocking to work.
--- drivers/gpu/drm/panel/panel-simple.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
drivers/gpu/drm/panel/panel-simple.c +30 -0
@@ -1530,6 +1530,33 @@ static const struct panel_desc qd43003c0_40 = { .bus_format = MEDIA_BUS_FMT_RGB888_1X24, }; +static const struct drm_display_mode raspberrypi_7inch_mode = { +/* Modeline comes from the Raspberry Pi firmware, with HFP=1 +* plugged in and clock re-computed from that. +*/ + .clock =25979400 /1000 , + .hdisplay =800 , + .hsync_start =800 +1 , + .hsync_end =800 +1 +2 , + .htotal =800 +1 +2 +46 , + .vdisplay =480 , + .vsync_start =480 +7 , + .vsync_end =480 +7 +2 , + .vtotal =480 +7 +2 +21 , + .vrefresh =60 , +}; + +static const struct panel_desc raspberrypi_7inch = { + .modes = &raspberrypi_7inch_mode, + .num_modes =1 , + .bpc =8 , + .size = { + .width =154 , + .height =86 , + }, + .bus_format =MEDIA_BUS_FMT_RGB888_1X24 , +}; +static const struct drm_display_mode samsung_lsn122dl01_c01_mode = { .clock =271560 , .hdisplay =2560 ,
@@ -1996,6 +2023,9 @@ static const struct of_device_id platform_of_match[] = { .compatible = "qiaodian,qd43003c0-40", .data = &qd43003c0_40, }, { + .compatible = "raspberrypi,7inch-touchscreen-panel", + .data = &raspberrypi_7inch, + }, { .compatible = "samsung,lsn122dl01-c01", .data = &samsung_lsn122dl01_c01, }, {
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/4] drm/vc4: Adjust modes in DSI to work around the integer PLL divider.
In reply to Eric AnholtQuoted 6 lines · Eric Anholt
BCM2835's
PLLD_DSI1divider doesn't give us many choices for our pixel clocks, so to support panels on the Raspberry Pi we need to set a higher pixel clock rate than requested and adjust the mode we program to extend out the HFP so that the refresh rate matches.Signed-off-by Eric Anholt <[email protected]>
Yeah, this is what mode_fixup is for (or the fancier atomic_check, but no benefit with using that one here).
Quoted 176 lines
--- drivers/gpu/drm/vc4/vc4_dsi.c | 112 ++++++++++++++++++++++++++++++++---------- 1 file changed, 86 insertions(+), 26 deletions(-)drivers/gpu/drm/vc4/vc4_dsi.c +86
-26@@ -519,7 +519,8 @@ struct vc4_dsi {/* DSI channel for the panel we're connected to. */ u32 channel;u32 lanes; -enum mipi_dsi_pixel_format format; +u32 format; +u32 divider;u32 mode_flags;/* Input clock from CPRMAN to the digital PHY, for the DSI @@ -817,13 +818,67 @@ static void vc4_dsi_encoder_disable(struct drm_encoder *encoder)pm_runtime_put (dev); } +/* Extends the mode's blank intervals to handle BCM2835's integer-only +* DSI PLL divider. +* +* On 2835, PLLD is set to 2Ghz, and may not be changed by the display +* driver since most peripherals are hanging off of the PLLD_PER +* divider. PLLD_DSI1, which drives our DSI bit clock (and therefore +* the pixel clock), only has an integer divider off of DSI. +* +* To get our panel mode to refresh at the expected 60Hz, we need to +* extend the horizontal blank time. This means we drive a +* higher-than-expected clock rate to the panel, but that's what the +* firmware (which ) does too. +*/ +static bool vc4_dsi_encoder_mode_fixup (struct drm_encoder *encoder, +const struct drm_display_mode *mode, +struct drm_display_mode *adjusted_mode) +{ +struct vc4_dsi_encoder *vc4_encoder =to_vc4_dsi_encoder (encoder); +struct vc4_dsi *dsi = vc4_encoder->dsi; +struct clk *phy_parent =clk_get_parent (dsi->pll_phy_clock); +unsigned long parent_rate =clk_get_rate (phy_parent); +unsigned long pixel_clock_hz = mode->clock *1000 ; +unsigned long pll_clock = pixel_clock_hz * dsi->divider; +int divider; + +/* Find what divider gets us a faster clock than the requested +* pixel clock. +*/ +for (divider =1 ; divider <8 ; divider++) { +if (parent_rate / divider < pll_clock) { + divider--; +break ; + } + } + +/* Now that we've picked a PLL divider, calculate back to its +* pixel clock. +*/ + pll_clock = parent_rate / divider; + pixel_clock_hz = pll_clock / dsi->divider; + +/* Round up the clk_set_rate() request slightly, since +* PLLD_DSI1 is an integer divider and its rate selection will +* never round up. +*/ + adjusted_mode->clock = pixel_clock_hz /1000 +1 ; + +/* Given the new pixel clock, adjust HFP to keep vrefresh the same. */ + adjusted_mode->htotal = pixel_clock_hz / (mode->vrefresh * mode->vtotal); + adjusted_mode->hsync_end += adjusted_mode->htotal - mode->htotal; + adjusted_mode->hsync_start += adjusted_mode->htotal - mode->htotal; + +return true; +} +static void vc4_dsi_encoder_enable (struct drm_encoder *encoder) { -struct drm_display_mode *mode = &encoder->crtc->mode; +struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;struct vc4_dsi_encoder *vc4_encoder =to_vc4_dsi_encoder (encoder);struct vc4_dsi *dsi = vc4_encoder->dsi;struct device *dev = &dsi->pdev->dev; -u32 format =0 , divider =0 ;bool debug_dump_regs = false;unsigned long hs_clock;u32 ui_ns;@@ -845,26 +900,7 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)vc4_dsi_dump_regs (dsi); } -switch (dsi->format) { -case MIPI_DSI_FMT_RGB888 : - format =DSI_PFORMAT_RGB888 ; - divider =24 / dsi->lanes; -break ; -case MIPI_DSI_FMT_RGB666 : - format =DSI_PFORMAT_RGB666 ; - divider =24 / dsi->lanes; -break ; -case MIPI_DSI_FMT_RGB666_PACKED : - format =DSI_PFORMAT_RGB666_PACKED ; - divider =18 / dsi->lanes; -break ; -case MIPI_DSI_FMT_RGB565 : - format =DSI_PFORMAT_RGB565 ; - divider =16 / dsi->lanes; -break ; - } - - phy_clock = pixel_clock_hz * divider; + phy_clock = pixel_clock_hz * dsi->divider; ret =clk_set_rate (dsi->pll_phy_clock, phy_clock);if (ret) { dev_err(&dsi->pdev->dev,@@ -1049,8 +1085,9 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)if (dsi->mode_flags &MIPI_DSI_MODE_VIDEO ) { DSI_PORT_WRITE(DISP0_CTRL, - VC4_SET_FIELD(divider, DSI_DISP0_PIX_CLK_DIV) | - VC4_SET_FIELD(format, DSI_DISP0_PFORMAT) | + VC4_SET_FIELD(dsi->divider, + DSI_DISP0_PIX_CLK_DIV) | + VC4_SET_FIELD(dsi->format, DSI_DISP0_PFORMAT) | VC4_SET_FIELD(DSI_DISP0_LP_STOP_PERFRAME, DSI_DISP0_LP_STOP_CTRL) | DSI_DISP0_ST_END |@@ -1255,9 +1292,31 @@ static int vc4_dsi_host_attach(struct mipi_dsi_host *host, dsi->lanes = device->lanes; dsi->channel = device->channel; - dsi->format = device->format; dsi->mode_flags = device->mode_flags; +switch (device->format) { +case MIPI_DSI_FMT_RGB888 : + dsi->format =DSI_PFORMAT_RGB888 ; + dsi->divider =24 / dsi->lanes; +break ; +case MIPI_DSI_FMT_RGB666 : + dsi->format =DSI_PFORMAT_RGB666 ; + dsi->divider =24 / dsi->lanes; +break ; +case MIPI_DSI_FMT_RGB666_PACKED : + dsi->format =DSI_PFORMAT_RGB666_PACKED ; + dsi->divider =18 / dsi->lanes; +break ; +case MIPI_DSI_FMT_RGB565 : + dsi->format =DSI_PFORMAT_RGB565 ; + dsi->divider =16 / dsi->lanes; +break ; +default : +dev_err (&dsi->pdev->dev,"Unknown DSI format: %d.\n" , + dsi->format); +return 0 ; + } +if (!(dsi->mode_flags &MIPI_DSI_MODE_VIDEO )) {dev_err (&dsi->pdev->dev,"Only VIDEO mode panels supported currently.\n" );@@ -1304,6 +1363,7 @@ static const struct mipi_dsi_host_ops vc4_dsi_host_ops = {static const struct drm_encoder_helper_funcs vc4_dsi_encoder_helper_funcs = { .disable = vc4_dsi_encoder_disable, .enable = vc4_dsi_encoder_enable, + .mode_fixup = vc4_dsi_encoder_mode_fixup, };static const struct of_device_id vc4_dsi_dt_match[] = {Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/4] drm/vc4: Adjust modes in DSI to work around the integer PLL divider.
In reply to Eric AnholtDen 12.05.2017 01.56, skrev Eric Anholt:
Quoted 30 lines
BCM2835's
PLLD_DSI1divider doesn't give us many choices for our pixel clocks, so to support panels on the Raspberry Pi we need to set a higher pixel clock rate than requested and adjust the mode we program to extend out the HFP so that the refresh rate matches.Signed-off-by Eric Anholt <[email protected]>--- drivers/gpu/drm/vc4/vc4_dsi.c | 112 ++++++++++++++++++++++++++++++++---------- 1 file changed, 86 insertions(+), 26 deletions(-)drivers/gpu/drm/vc4/vc4_dsi.c +4
-1@@ -519,7 +519,8 @@ struct vc4_dsi {/* DSI channel for the panel we're connected to. */ u32 channel;u32 lanes; -enum mipi_dsi_pixel_format format; +u32 format; +u32 divider;u32 mode_flags;/* Input clock from CPRMAN to the digital PHY, for the DSI @@ -817,13 +818,67 @@ static void vc4_dsi_encoder_disable(struct drm_encoder *encoder)pm_runtime_put (dev); } +/* Extends the mode's blank intervals to handle BCM2835's integer-only +* DSI PLL divider.
drivers/gpu/drm/vc4/vc4_dsi.c static void vc4_dsi_encoder_disable(struct drm_encoder *encoder) · line 832
Quoted 10 lines
drivers/gpu/drm/vc4/vc4_dsi.c +10
-0+* +* On 2835, PLLD is set to 2Ghz, and may not be changed by the display +* driver since most peripherals are hanging off of the PLLD_PER +* divider. PLLD_DSI1, which drives our DSI bit clock (and therefore +* the pixel clock), only has an integer divider off of DSI. +* +* To get our panel mode to refresh at the expected 60Hz, we need to +* extend the horizontal blank time. This means we drive a +* higher-than-expected clock rate to the panel, but that's what the +* firmware (which ) does too.
Something missing in the comment here.
Noralf.
Quoted 128 lines
drivers/gpu/drm/vc4/vc4_dsi.c +71
-25+*/ +static bool vc4_dsi_encoder_mode_fixup (struct drm_encoder *encoder, +const struct drm_display_mode *mode, +struct drm_display_mode *adjusted_mode) +{ +struct vc4_dsi_encoder *vc4_encoder =to_vc4_dsi_encoder (encoder); +struct vc4_dsi *dsi = vc4_encoder->dsi; +struct clk *phy_parent =clk_get_parent (dsi->pll_phy_clock); +unsigned long parent_rate =clk_get_rate (phy_parent); +unsigned long pixel_clock_hz = mode->clock *1000 ; +unsigned long pll_clock = pixel_clock_hz * dsi->divider; +int divider; + +/* Find what divider gets us a faster clock than the requested +* pixel clock. +*/ +for (divider =1 ; divider <8 ; divider++) { +if (parent_rate / divider < pll_clock) { + divider--; +break ; + } + } + +/* Now that we've picked a PLL divider, calculate back to its +* pixel clock. +*/ + pll_clock = parent_rate / divider; + pixel_clock_hz = pll_clock / dsi->divider; + +/* Round up the clk_set_rate() request slightly, since +* PLLD_DSI1 is an integer divider and its rate selection will +* never round up. +*/ + adjusted_mode->clock = pixel_clock_hz /1000 +1 ; + +/* Given the new pixel clock, adjust HFP to keep vrefresh the same. */ + adjusted_mode->htotal = pixel_clock_hz / (mode->vrefresh * mode->vtotal); + adjusted_mode->hsync_end += adjusted_mode->htotal - mode->htotal; + adjusted_mode->hsync_start += adjusted_mode->htotal - mode->htotal; + +return true; +} +static void vc4_dsi_encoder_enable (struct drm_encoder *encoder) { -struct drm_display_mode *mode = &encoder->crtc->mode; +struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;struct vc4_dsi_encoder *vc4_encoder =to_vc4_dsi_encoder (encoder);struct vc4_dsi *dsi = vc4_encoder->dsi;struct device *dev = &dsi->pdev->dev; -u32 format =0 , divider =0 ;bool debug_dump_regs = false;unsigned long hs_clock;u32 ui_ns;@@ -845,26 +900,7 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)vc4_dsi_dump_regs (dsi); } -switch (dsi->format) { -case MIPI_DSI_FMT_RGB888 : - format =DSI_PFORMAT_RGB888 ; - divider =24 / dsi->lanes; -break ; -case MIPI_DSI_FMT_RGB666 : - format =DSI_PFORMAT_RGB666 ; - divider =24 / dsi->lanes; -break ; -case MIPI_DSI_FMT_RGB666_PACKED : - format =DSI_PFORMAT_RGB666_PACKED ; - divider =18 / dsi->lanes; -break ; -case MIPI_DSI_FMT_RGB565 : - format =DSI_PFORMAT_RGB565 ; - divider =16 / dsi->lanes; -break ; - } - - phy_clock = pixel_clock_hz * divider; + phy_clock = pixel_clock_hz * dsi->divider; ret =clk_set_rate (dsi->pll_phy_clock, phy_clock);if (ret) { dev_err(&dsi->pdev->dev,@@ -1049,8 +1085,9 @@ static void vc4_dsi_encoder_enable(struct drm_encoder *encoder)if (dsi->mode_flags &MIPI_DSI_MODE_VIDEO ) { DSI_PORT_WRITE(DISP0_CTRL, - VC4_SET_FIELD(divider, DSI_DISP0_PIX_CLK_DIV) | - VC4_SET_FIELD(format, DSI_DISP0_PFORMAT) | + VC4_SET_FIELD(dsi->divider, + DSI_DISP0_PIX_CLK_DIV) | + VC4_SET_FIELD(dsi->format, DSI_DISP0_PFORMAT) | VC4_SET_FIELD(DSI_DISP0_LP_STOP_PERFRAME, DSI_DISP0_LP_STOP_CTRL) | DSI_DISP0_ST_END |@@ -1255,9 +1292,31 @@ static int vc4_dsi_host_attach(struct mipi_dsi_host *host, dsi->lanes = device->lanes; dsi->channel = device->channel; - dsi->format = device->format; dsi->mode_flags = device->mode_flags; +switch (device->format) { +case MIPI_DSI_FMT_RGB888 : + dsi->format =DSI_PFORMAT_RGB888 ; + dsi->divider =24 / dsi->lanes; +break ; +case MIPI_DSI_FMT_RGB666 : + dsi->format =DSI_PFORMAT_RGB666 ; + dsi->divider =24 / dsi->lanes; +break ; +case MIPI_DSI_FMT_RGB666_PACKED : + dsi->format =DSI_PFORMAT_RGB666_PACKED ; + dsi->divider =18 / dsi->lanes; +break ; +case MIPI_DSI_FMT_RGB565 : + dsi->format =DSI_PFORMAT_RGB565 ; + dsi->divider =16 / dsi->lanes; +break ; +default : +dev_err (&dsi->pdev->dev,"Unknown DSI format: %d.\n" , + dsi->format); +return 0 ; + } +if (!(dsi->mode_flags &MIPI_DSI_MODE_VIDEO )) {dev_err (&dsi->pdev->dev,"Only VIDEO mode panels supported currently.\n" );
drivers/gpu/drm/vc4/vc4_dsi.c static const struct mipi_dsi_host_ops vc4_dsi_host_ops = { · line 1369
Quoted 7 lines
drivers/gpu/drm/vc4/vc4_dsi.c +1
-0@@ -1304,6 +1363,7 @@ static const struct mipi_dsi_host_ops vc4_dsi_host_ops = {static const struct drm_encoder_helper_funcs vc4_dsi_encoder_helper_funcs = { .disable = vc4_dsi_encoder_disable, .enable = vc4_dsi_encoder_enable, + .mode_fixup = vc4_dsi_encoder_mode_fixup, };static const struct of_device_id vc4_dsi_dt_match[] = {
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Rob Herring
maintainerRe: [PATCH 2/4] dt-bindings: Document the Raspberry Pi Touchscreen nodes.
In reply to Eric AnholtQuoted 23 lines · Eric Anholt
The Raspberry Pi 7" Touchscreen is a DPI touchscreen panel with
DSI->DPIbridge and touchscreen controller integrated, that connects to the Raspberry Pi through its 15-pin "DSI" connector (some lines are DSI, some lines are I2C).This device is represented in the DT as three nodes (DSI device, I2C device, panel). Input will be left to a separate binding later, as it will be a basic I2C client device.
Signed-off-by Eric Anholt <[email protected]>--- .../raspberrypi,7inch-touchscreen-bridge.txt | 68 ++++++++++++++++++++++ .../panel/raspberrypi,7inch-touchscreen-panel.txt | 7 +++ 2 files changed, 75 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt create mode 100644 Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscreen-panel.txtDocumentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +0
-0
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt line 8
Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +8
-0@@ -0,0 +1,68 @@ +Official 7" (800x480) Raspberry Pi touchscreen panel's bridge. + +This DSI panel contains: + +- TC358762 DSI->DPI bridge +- Atmel microcontroller on I2C for power sequencing the DSI bridge and + controlling backlight +- Touchscreen controller on I2C for touch input
This is 1 uC or 2?
Quoted 11 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +11
-0+ +and this covers the TC358762 bridge and Atmel microcontroller, while +../panel/raspberrypi,7inch-touchscreen-panel.txt covers the panel. + +Required properties: +- compatible: Must be "raspberrypi,7inch-touchscreen-bridge" +- raspberrypi,touchscreen-bridge: + Handle to the I2C device for Atmel microcontroller + +Example: +
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt line 29
Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +10
-0+dsi1: dsi@7e700000 { + #address-cells = <1>; + #size-cells = <0>; + <...> + + lcd-bridge@0 { + compatible = "raspberrypi,7inch-touchscreen-bridge"; + reg = <0>; + + raspberrypi,touchscreen-bridge = <&pitouchscreen_bridge>;
I think this should be a port with a graph connection from the DSI node to the i2c bridge device (and then to the panel).
It's also how other DSI bridges like the tc358767 are done.
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt line 34
Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +5
-0+ ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>;
BTW, you don't need this when there is only 1.
Quoted 54 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +34
-0+ pitouchscreen_bridge_port: endpoint { + remote-endpoint = <&pitouchscreen_panel_port>; + }; + }; + }; + }; +}; + +i2c_dsi: i2c { + compatible = "i2c-gpio"; + #address-cells = <1>; + #size-cells = <0>; + gpios = <&gpio 28 0 + &gpio 29 0>; + + pitouchscreen_bridge: bridge@45 { + compatible = "raspberrypi,touchscreen-bridge-i2c"; + reg = <0x45>; + }; +}; + +lcd { + compatible = "raspberrypi,7inch-touchscreen-panel"; + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + pitouchscreen_panel_port: endpoint { + remote-endpoint = <&pitouchscreen_bridge_port>; + }; + }; + }; +};Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscreen-panel.txt new file +7
-0@@ -0,0 +1,7 @@ +Official 7" (800x480) Raspberry Pi touchscreen panel's panel. + +This binding is compatible with the simple-panel binding, which is specified +in simple-panel.txt in this directory. + +Required properties: +- compatible: Must be "raspberrypi,7inch-touchscreen-panel"Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Laurent Pinchart
reviewerRe: [PATCH 2/4] dt-bindings: Document the Raspberry Pi Touchscreen nodes.
In reply to Eric AnholtHi Eric,
Thank you for the patch.
Quoted 31 lines · On Thursday 11 May 2017 16:56:23 Eric Anholt wrote:
The Raspberry Pi 7" Touchscreen is a DPI touchscreen panel with
DSI->DPIbridge and touchscreen controller integrated, that connects to the Raspberry Pi through its 15-pin "DSI" connector (some lines are DSI, some lines are I2C).This device is represented in the DT as three nodes (DSI device, I2C device, panel). Input will be left to a separate binding later, as it will be a basic I2C client device.
Signed-off-by Eric Anholt <[email protected]>--- .../raspberrypi,7inch-touchscreen-bridge.txt | 68 +++++++++++++++++++ .../panel/raspberrypi,7inch-touchscreen-panel.txt | 7 +++ 2 files changed, 75 insertions(+) create mode 100644
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt create mode 100644Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscreen-panel.txtdiff --git a/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchs creen-bridge.txt b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchs creen-bridge.txt new file mode 100644
index 000000000000..a5669beaf68f
---/dev/null
+++
b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchs creen-bridge.txt @@ -0,0 +1,68 @@Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +1
-0+Official 7" (800x480) Raspberry Pi touchscreen panel's bridge.
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt line 11
Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +10
-0+ +This DSI panel contains: + +- TC358762 DSI->DPI bridge +- Atmel microcontroller on I2C for power sequencing the DSI bridge and + controlling backlight +- Touchscreen controller on I2C for touch input + +and this covers the TC358762 bridge and Atmel microcontroller, while +../panel/raspberrypi,7inch-touchscreen-panel.txt covers the panel.
The TC358762 is a standalone bridge that doesn't depend on the ATTiny microcontroller used by the RPI. As it's usable standalone, I believe this binding should be split in two.
Quoted 14 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +14
-0+Required properties: +- compatible: Must be "raspberrypi,7inch-touchscreen-bridge" +- raspberrypi,touchscreen-bridge: + Handle to the I2C device for Atmel microcontroller + +Example: + +dsi1: dsi@7e700000 { + #address-cells = <1>; + #size-cells = <0>; + <...> + + lcd-bridge@0 { + compatible = "raspberrypi,7inch-touchscreen-bridge";
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt
Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +10
-0+ reg = <0>; + + raspberrypi,touchscreen-bridge = <&pitouchscreen_bridge>; + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + pitouchscreen_bridge_port: endpoint { + remote-endpoint =
<&pitouchscreen_panel_port>;
Quoted 18 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +18
-0+ }; + }; + }; + }; +}; + +i2c_dsi: i2c { + compatible = "i2c-gpio"; + #address-cells = <1>; + #size-cells = <0>; + gpios = <&gpio 28 0 + &gpio 29 0>; + + pitouchscreen_bridge: bridge@45 { + compatible = "raspberrypi,touchscreen-bridge-i2c"; + reg = <0x45>; + }; +};
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt
Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +10
-0+ +lcd { + compatible = "raspberrypi,7inch-touchscreen-panel"; + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + pitouchscreen_panel_port: endpoint { + remote-endpoint =
<&pitouchscreen_bridge_port>;
Quoted 21 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +4
-0+ }; + }; + }; +};diff --git a/Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchsc reen-panel.txt b/Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchsc reen-panel.txt new file mode 100644
index 000000000000..1e84f97b3b20
---/dev/null
+++
b/Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchsc reen-panel.txt @@ -0,0 +1,7 @@Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscreen-panel.txt new file +3
-0+Official 7" (800x480) Raspberry Pi touchscreen panel's panel. + +This binding is compatible with the simple-panel binding, which isspecified +in simple-panel.txt in this directory.
Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscreen-panel.txt new file +3
-0+ +Required properties: +- compatible: Must be "raspberrypi,7inch-touchscreen-panel"
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Laurent Pinchart
reviewerRe: [PATCH 2/4] dt-bindings: Document the Raspberry Pi Touchscreen nodes.
In reply to Rob HerringHi Rob,
Quoted 59 lines · On Monday 15 May 2017 15:44:57 Rob Herring wrote:
Quoted 31 lines · Eric Anholt
The Raspberry Pi 7" Touchscreen is a DPI touchscreen panel with
DSI->DPIbridge and touchscreen controller integrated, that connects to the Raspberry Pi through its 15-pin "DSI" connector (some lines are DSI, some lines are I2C).This device is represented in the DT as three nodes (DSI device, I2C device, panel). Input will be left to a separate binding later, as it will be a basic I2C client device.
Signed-off-by Eric Anholt <[email protected]>---
.../raspberrypi,7inch-touchscreen-bridge.txt | 68 ++++++++++++++++++++++ .../panel/raspberrypi,7inch-touchscreen-panel.txt | 7 +++ 2 files changed, 75 insertions(+) create mode 100644
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt create mode 100644Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscreen-panel.txt>
diff --git a/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touc hscreen-bridge.txt b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touc hscreen-bridge.txt new file mode 100644
index 000000000000..a5669beaf68f
---/dev/null
+++
b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touc hscreen-bridge.txt @@ -0,0 +1,68 @@Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt line 8
Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +8
-0+Official 7" (800x480) Raspberry Pi touchscreen panel's bridge. + +This DSI panel contains: + +- TC358762 DSI->DPI bridge +- Atmel microcontroller on I2C for power sequencing the DSI bridge and + controlling backlight +- Touchscreen controller on I2C for touch inputThis is 1 uC or 2?
Quoted 16 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +16
-0+ +and this covers the TC358762 bridge and Atmel microcontroller, while +../panel/raspberrypi,7inch-touchscreen-panel.txt covers the panel. + +Required properties: +- compatible: Must be "raspberrypi,7inch-touchscreen-bridge" +- raspberrypi,touchscreen-bridge: + Handle to the I2C device for Atmel microcontroller + +Example: + +dsi1: dsi@7e700000 { + #address-cells = <1>; + #size-cells = <0>; + <...> +
Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt line 29
Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +5
-0+ lcd-bridge@0 { + compatible = "raspberrypi,7inch-touchscreen-bridge"; + reg = <0>; + + raspberrypi,touchscreen-bridge = <&pitouchscreen_bridge>;I think this should be a port with a graph connection from the DSI node to the i2c bridge device (and then to the panel).
No, this should actually not exist :-) The property references the I2C device DT node corresponding to the microcontroller that controls the backlight (and, if I understand correctly, handles power sequencing). The DSI driver (in patch 3/4) then grabs the I2C device and talks to it. I don't think this is right, as commented separately on this patch, the bindings should be split, with a standalone binding for the TC358762 (and a separate standalone driver too).
Quoted 10 lines
It's also how other DSI bridges like the tc358767 are done.
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt line 34
Quoted 5 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +5
-0+ ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>;BTW, you don't need this when there is only 1.
Quoted 2 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ pitouchscreen_bridge_port: endpoint { + remote-endpoint =
<&pitouchscreen_panel_port>;
Quoted 20 lines
Quoted 20 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +20
-0+ }; + }; + }; + }; +}; + +i2c_dsi: i2c { + compatible = "i2c-gpio"; + #address-cells = <1>; + #size-cells = <0>; + gpios = <&gpio 28 0 + &gpio 29 0>; + + pitouchscreen_bridge: bridge@45 { + compatible = "raspberrypi,touchscreen-bridge-i2c"; + reg = <0x45>; + }; +}; + +lcd {
Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt
Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +8
-0+ compatible = "raspberrypi,7inch-touchscreen-panel"; + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + pitouchscreen_panel_port: endpoint { + remote-endpoint =
<&pitouchscreen_bridge_port>;
Quoted 21 lines
Quoted 21 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +4
-0+ }; + }; + }; +};diff --git a/Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touch screen-panel.txt b/Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touch screen-panel.txt new file mode 100644
index 000000000000..1e84f97b3b20
---/dev/null
+++
b/Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touch screen-panel.txt @@ -0,0 +1,7 @@Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscreen-panel.txt new file +3
-0+Official 7" (800x480) Raspberry Pi touchscreen panel's panel. + +This binding is compatible with the simple-panel binding, which isspecified +in simple-panel.txt in this directory.
Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscreen-panel.txt new file +3
-0+ +Required properties: +- compatible: Must be "raspberrypi,7inch-touchscreen-panel"
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 2/4] dt-bindings: Document the Raspberry Pi Touchscreen nodes.
In reply to Laurent PinchartQuoted 42 lines · Laurent Pinchart
Hi Eric,
Thank you for the patch.
Quoted 37 lines · On Thursday 11 May 2017 16:56:23 Eric Anholt wrote:
The Raspberry Pi 7" Touchscreen is a DPI touchscreen panel with
DSI->DPIbridge and touchscreen controller integrated, that connects to the Raspberry Pi through its 15-pin "DSI" connector (some lines are DSI, some lines are I2C).This device is represented in the DT as three nodes (DSI device, I2C device, panel). Input will be left to a separate binding later, as it will be a basic I2C client device.
Signed-off-by Eric Anholt <[email protected]>--- .../raspberrypi,7inch-touchscreen-bridge.txt | 68 +++++++++++++++++++ .../panel/raspberrypi,7inch-touchscreen-panel.txt | 7 +++ 2 files changed, 75 insertions(+) create mode 100644
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt create mode 100644Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscreen-panel.txtdiff --git a/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchs creen-bridge.txt b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchs creen-bridge.txt new file mode 100644
index 000000000000..a5669beaf68f
---/dev/null
+++
b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchs creen-bridge.txt @@ -0,0 +1,68 @@Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +7
-0+Official 7" (800x480) Raspberry Pi touchscreen panel's bridge. + +This DSI panel contains: + +- TC358762 DSI->DPI bridge +- Atmel microcontroller on I2C for power sequencing the DSI bridge and + controlling backlight
Quoted 8 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt line 11
Quoted 4 lines
+- Touchscreen controller on I2C for touch input
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +3
-0+ +and this covers the TC358762 bridge and Atmel microcontroller, while +../panel/raspberrypi,7inch-touchscreen-panel.txt covers the panel.The TC358762 is a standalone bridge that doesn't depend on the ATTiny microcontroller used by the RPI. As it's usable standalone, I believe this binding should be split in two.
Do you have a plan for how I would implement a driver on top of that binding change, though? Note that we don't program the Toshiba directly, we only send commands to the Atmel.
Re: [PATCH 2/4] dt-bindings: Document the Raspberry Pi Touchscreen nodes.
Quoted 53 lines · Eric Anholt
Quoted 42 lines · Laurent Pinchart
Hi Eric,
Thank you for the patch.
Quoted 37 lines · On Thursday 11 May 2017 16:56:23 Eric Anholt wrote:
The Raspberry Pi 7" Touchscreen is a DPI touchscreen panel with
DSI->DPIbridge and touchscreen controller integrated, that connects to the Raspberry Pi through its 15-pin "DSI" connector (some lines are DSI, some lines are I2C).This device is represented in the DT as three nodes (DSI device, I2C device, panel). Input will be left to a separate binding later, as it will be a basic I2C client device.
Signed-off-by Eric Anholt <[email protected]>--- .../raspberrypi,7inch-touchscreen-bridge.txt | 68 +++++++++++++++++++ .../panel/raspberrypi,7inch-touchscreen-panel.txt | 7 +++ 2 files changed, 75 insertions(+) create mode 100644
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt create mode 100644Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscreen-panel.txtdiff --git a/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchs creen-bridge.txt b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchs creen-bridge.txt new file mode 100644
index 000000000000..a5669beaf68f
---/dev/null
+++
b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchs creen-bridge.txt @@ -0,0 +1,68 @@Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +7
-0+Official 7" (800x480) Raspberry Pi touchscreen panel's bridge. + +This DSI panel contains: + +- TC358762 DSI->DPI bridge +- Atmel microcontroller on I2C for power sequencing the DSI bridge and + controlling backlightQuoted 8 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt line 11
Quoted 4 lines
+- Touchscreen controller on I2C for touch input
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +3
-0+ +and this covers the TC358762 bridge and Atmel microcontroller, while +../panel/raspberrypi,7inch-touchscreen-panel.txt covers the panel.The TC358762 is a standalone bridge that doesn't depend on the ATTiny microcontroller used by the RPI. As it's usable standalone, I believe this binding should be split in two.
Quoted 3 lines
Do you have a plan for how I would implement a driver on top of that binding change, though? Note that we don't program the Toshiba directly, we only send commands to the Atmel.
I agree. If it is a black box and the interface to the host is defined by the Atmel uC firmware, then that's what the DT should describe. Perhaps a diagram here or pointer to one would help and remove mentioning what kind of bridge chip it is.
Rob
Laurent Pinchart
reviewerRe: [PATCH 2/4] dt-bindings: Document the Raspberry Pi Touchscreen nodes.
In reply to Eric AnholtHi Eric,
Quoted 55 lines · On Monday 15 May 2017 17:03:29 Eric Anholt wrote:
Quoted 45 lines · Laurent Pinchart
Quoted 44 lines · On Thursday 11 May 2017 16:56:23 Eric Anholt wrote:
The Raspberry Pi 7" Touchscreen is a DPI touchscreen panel with
DSI->DPIbridge and touchscreen controller integrated, that connects to the Raspberry Pi through its 15-pin "DSI" connector (some lines are DSI, some lines are I2C).This device is represented in the DT as three nodes (DSI device, I2C device, panel). Input will be left to a separate binding later, as it will be a basic I2C client device.
Signed-off-by Eric Anholt <[email protected]>---
.../raspberrypi,7inch-touchscreen-bridge.txt | 68 +++++++++++++++ .../panel/raspberrypi,7inch-touchscreen-panel.txt | 7 +++ 2 files changed, 75 insertions(+) create mode 100644
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscr
een-bridge.txt create mode 100644Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscre
en-panel.txtdiff --git a/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touc hs
creen-bridge.txt b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touc hs
creen-bridge.txt new file mode 100644
index 000000000000..a5669beaf68f
---/dev/null
+++
b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touc hs
creen-bridge.txt @@ -0,0 +1,68 @@Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +7
-0+Official 7" (800x480) Raspberry Pi touchscreen panel's bridge. + +This DSI panel contains: + +- TC358762 DSI->DPI bridge +- Atmel microcontroller on I2C for power sequencing the DSI bridge and + controlling backlightQuoted 8 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt line 11
Quoted 4 lines
+- Touchscreen controller on I2C for touch input
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +3
-0+ +and this covers the TC358762 bridge and Atmel microcontroller, while +../panel/raspberrypi,7inch-touchscreen-panel.txt covers the panel.The TC358762 is a standalone bridge that doesn't depend on the ATTiny microcontroller used by the RPI. As it's usable standalone, I believe this binding should be split in two.
Quoted 3 lines
Do you have a plan for how I would implement a driver on top of that binding change, though? Note that we don't program the Toshiba directly, we only send commands to the Atmel.
I'm not too familiar with the hardware architecture, let me have a look. Is the schematics publicly available somewhere ?
Signature · 3 lines
Regards, Laurent Pinchart
Re: [PATCH 2/4] dt-bindings: Document the Raspberry Pi Touchscreen nodes.
In reply to Rob HerringQuoted 54 lines · Rob Herring
Quoted 53 lines · Eric Anholt
Quoted 50 lines · Laurent Pinchart
Hi Eric,
Thank you for the patch.
Quoted 31 lines · On Thursday 11 May 2017 16:56:23 Eric Anholt wrote:
The Raspberry Pi 7" Touchscreen is a DPI touchscreen panel with
DSI->DPIbridge and touchscreen controller integrated, that connects to the Raspberry Pi through its 15-pin "DSI" connector (some lines are DSI, some lines are I2C).This device is represented in the DT as three nodes (DSI device, I2C device, panel). Input will be left to a separate binding later, as it will be a basic I2C client device.
Signed-off-by Eric Anholt <[email protected]>--- .../raspberrypi,7inch-touchscreen-bridge.txt | 68 +++++++++++++++++++ .../panel/raspberrypi,7inch-touchscreen-panel.txt | 7 +++ 2 files changed, 75 insertions(+) create mode 100644
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt create mode 100644Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscreen-panel.txtdiff --git a/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchs creen-bridge.txt b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchs creen-bridge.txt new file mode 100644
index 000000000000..a5669beaf68f
---/dev/null
+++
b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchs creen-bridge.txt @@ -0,0 +1,68 @@Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +1
-0+Official 7" (800x480) Raspberry Pi touchscreen panel's bridge.Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt line 11
Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +10
-0+ +This DSI panel contains: + +- TC358762 DSI->DPI bridge +- Atmel microcontroller on I2C for power sequencing the DSI bridge and + controlling backlight +- Touchscreen controller on I2C for touch input + +and this covers the TC358762 bridge and Atmel microcontroller, while +../panel/raspberrypi,7inch-touchscreen-panel.txt covers the panel.The TC358762 is a standalone bridge that doesn't depend on the ATTiny microcontroller used by the RPI. As it's usable standalone, I believe this binding should be split in two.
Quoted 8 lines
Quoted 3 lines
Do you have a plan for how I would implement a driver on top of that binding change, though? Note that we don't program the Toshiba directly, we only send commands to the Atmel.
I agree. If it is a black box and the interface to the host is defined by the Atmel uC firmware, then that's what the DT should describe. Perhaps a diagram here or pointer to one would help and remove mentioning what kind of bridge chip it is.
It's a *very* black box. I have some non-public schematics that don't even say what panel is involved, and no documentation of the uc interface. The driver code is just replicating the firmware's programming sequence.
I would certainly love to be building a generic TC358762 driver, which would be a lot more satisfying. I just don't think it's doable for this panel. Given that, what do I need to do to the DT? Should I just drop mention of the Toshiba and talk about this being a bridge with a custom microcontroller firmware?
Laurent Pinchart
reviewerRe: [PATCH 2/4] dt-bindings: Document the Raspberry Pi Touchscreen nodes.
Hi Eric,
Quoted 71 lines · On Tuesday 16 May 2017 09:47:49 Eric Anholt wrote:
Quoted 56 lines · Rob Herring
Quoted 55 lines · Eric Anholt
Quoted 53 lines · Laurent Pinchart
Hi Eric,
Thank you for the patch.
Quoted 34 lines · On Thursday 11 May 2017 16:56:23 Eric Anholt wrote:
The Raspberry Pi 7" Touchscreen is a DPI touchscreen panel with
DSI->DPIbridge and touchscreen controller integrated, that connects to the Raspberry Pi through its 15-pin "DSI" connector (some lines are DSI, some lines are I2C).This device is represented in the DT as three nodes (DSI device, I2C device, panel). Input will be left to a separate binding later, as it will be a basic I2C client device.
Signed-off-by Eric Anholt <[email protected]>---
.../raspberrypi,7inch-touchscreen-bridge.txt | 68 ++++++++++++++ .../panel/raspberrypi,7inch-touchscreen-panel.txt | 7 +++ 2 files changed, 75 insertions(+) create mode 100644
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt create mode 100644Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscreen-panel.txtdiff --git a/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-to uchscreen-bridge.txt b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-to uchscreen-bridge.txt new file mode 100644
index 000000000000..a5669beaf68f
---/dev/null
+++
b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-to uchscreen-bridge.txtDocumentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +1
-0@@ -0,0 +1,68 @@ +Official 7" (800x480) Raspberry Pi touchscreen panel's bridge.Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt line 11
Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +10
-0+ +This DSI panel contains: + +- TC358762 DSI->DPI bridge +- Atmel microcontroller on I2C for power sequencing the DSI bridge and + controlling backlight +- Touchscreen controller on I2C for touch input + +and this covers the TC358762 bridge and Atmel microcontroller, while +../panel/raspberrypi,7inch-touchscreen-panel.txt covers the panel.The TC358762 is a standalone bridge that doesn't depend on the ATTiny microcontroller used by the RPI. As it's usable standalone, I believe this binding should be split in two.
Quoted 8 lines
Quoted 3 lines
Do you have a plan for how I would implement a driver on top of that binding change, though? Note that we don't program the Toshiba directly, we only send commands to the Atmel.
I agree. If it is a black box and the interface to the host is defined by the Atmel uC firmware, then that's what the DT should describe. Perhaps a diagram here or pointer to one would help and remove mentioning what kind of bridge chip it is.
It's a *very* black box. I have some non-public schematics that don't even say what panel is involved, and no documentation of the uc interface. The driver code is just replicating the firmware's programming sequence.
Quoted 5 lines
I would certainly love to be building a generic TC358762 driver, which would be a lot more satisfying. I just don't think it's doable for this panel. Given that, what do I need to do to the DT? Should I just drop mention of the Toshiba and talk about this being a bridge with a custom microcontroller firmware?
I think that would be best, yes. Could you share a simple block-diagram of the hardware ? It would help turning my random advices into semi-random advices :-)
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/4] dt-bindings: Document the Raspberry Pi Touchscreen nodes.
Quoted 80 lines · Laurent Pinchart
Hi Eric,
Quoted 71 lines · On Tuesday 16 May 2017 09:47:49 Eric Anholt wrote:
Quoted 56 lines · Rob Herring
Quoted 55 lines · Eric Anholt
Quoted 53 lines · Laurent Pinchart
Hi Eric,
Thank you for the patch.
Quoted 34 lines · On Thursday 11 May 2017 16:56:23 Eric Anholt wrote:
The Raspberry Pi 7" Touchscreen is a DPI touchscreen panel with
DSI->DPIbridge and touchscreen controller integrated, that connects to the Raspberry Pi through its 15-pin "DSI" connector (some lines are DSI, some lines are I2C).This device is represented in the DT as three nodes (DSI device, I2C device, panel). Input will be left to a separate binding later, as it will be a basic I2C client device.
Signed-off-by Eric Anholt <[email protected]>---
.../raspberrypi,7inch-touchscreen-bridge.txt | 68 ++++++++++++++ .../panel/raspberrypi,7inch-touchscreen-panel.txt | 7 +++ 2 files changed, 75 insertions(+) create mode 100644
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt create mode 100644Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscreen-panel.txtdiff --git a/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-to uchscreen-bridge.txt b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-to uchscreen-bridge.txt new file mode 100644
index 000000000000..a5669beaf68f
---/dev/null
+++
b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-to uchscreen-bridge.txtDocumentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +1
-0@@ -0,0 +1,68 @@ +Official 7" (800x480) Raspberry Pi touchscreen panel's bridge.Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt line 11
Quoted 10 lines
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt new file +10
-0+ +This DSI panel contains: + +- TC358762 DSI->DPI bridge +- Atmel microcontroller on I2C for power sequencing the DSI bridge and + controlling backlight +- Touchscreen controller on I2C for touch input + +and this covers the TC358762 bridge and Atmel microcontroller, while +../panel/raspberrypi,7inch-touchscreen-panel.txt covers the panel.The TC358762 is a standalone bridge that doesn't depend on the ATTiny microcontroller used by the RPI. As it's usable standalone, I believe this binding should be split in two.
Quoted 8 lines
Quoted 3 lines
Do you have a plan for how I would implement a driver on top of that binding change, though? Note that we don't program the Toshiba directly, we only send commands to the Atmel.
I agree. If it is a black box and the interface to the host is defined by the Atmel uC firmware, then that's what the DT should describe. Perhaps a diagram here or pointer to one would help and remove mentioning what kind of bridge chip it is.
It's a *very* black box. I have some non-public schematics that don't even say what panel is involved, and no documentation of the uc interface. The driver code is just replicating the firmware's programming sequence.
Quoted 5 lines
I would certainly love to be building a generic TC358762 driver, which would be a lot more satisfying. I just don't think it's doable for this panel. Given that, what do I need to do to the DT? Should I just drop mention of the Toshiba and talk about this being a bridge with a custom microcontroller firmware?
Quoted 3 lines
I think that would be best, yes. Could you share a simple block-diagram of the hardware ? It would help turning my random advices into semi-random advices :-)
In terms of physical connections:
[15-pin "DSI" connector on 2835]
| |
| I2C | DSI
| |
/ \ SPI |
[TS] [Atmel]------[TC358762]
\ |
\PWM |
\ | DPI[some backlight]------[some unknown panel]
The binding I'm trying to create is to expose what's necessary for a driver that talks I2C to the Atmel, which then controls the PWM and does the command sequence over SPI to the Toshiba that sets up its end of the DSI link.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/4] dt-bindings: Document the Raspberry Pi Touchscreen nodes.
Hi,
Quoted 97 lines · Eric Anholt
Quoted 80 lines · Laurent Pinchart
Hi Eric,
Quoted 71 lines · On Tuesday 16 May 2017 09:47:49 Eric Anholt wrote:
Quoted 56 lines · Rob Herring
Quoted 55 lines · Eric Anholt
Quoted 53 lines · Laurent Pinchart
Hi Eric,
Thank you for the patch.
Quoted 34 lines · On Thursday 11 May 2017 16:56:23 Eric Anholt wrote:
The Raspberry Pi 7" Touchscreen is a DPI touchscreen panel with
DSI->DPIbridge and touchscreen controller integrated, that connects to the Raspberry Pi through its 15-pin "DSI" connector (some lines are DSI, some lines are I2C).This device is represented in the DT as three nodes (DSI device, I2C device, panel). Input will be left to a separate binding later, as it will be a basic I2C client device.
Signed-off-by Eric Anholt <[email protected]>---
.../raspberrypi,7inch-touchscreen-bridge.txt | 68 ++++++++++++++ .../panel/raspberrypi,7inch-touchscreen-panel.txt | 7 +++ 2 files changed, 75 insertions(+) create mode 100644
Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-touchscreen-bridge.txt create mode 100644Documentation/devicetree/bindings/display/panel/raspberrypi,7inch-touchscreen-panel.txtdiff --git a/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-to uchscreen-bridge.txt b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-to uchscreen-bridge.txt new file mode 100644
index 000000000000..a5669beaf68f
---/dev/null
+++
b/Documentation/devicetree/bindings/display/bridge/raspberrypi,7inch-to uchscreen-bridge.txt(quoted diff) +1
-0@@ -0,0 +1,68 @@ +Official 7" (800x480) Raspberry Pi touchscreen panel's bridge.Review line 11
Quoted 10 lines
(quoted diff) +10
-0+ +This DSI panel contains: + +- TC358762 DSI->DPI bridge +- Atmel microcontroller on I2C for power sequencing the DSI bridge and + controlling backlight +- Touchscreen controller on I2C for touch input + +and this covers the TC358762 bridge and Atmel microcontroller, while +../panel/raspberrypi,7inch-touchscreen-panel.txt covers the panel.The TC358762 is a standalone bridge that doesn't depend on the ATTiny microcontroller used by the RPI. As it's usable standalone, I believe this binding should be split in two.
Quoted 8 lines
Quoted 3 lines
Do you have a plan for how I would implement a driver on top of that binding change, though? Note that we don't program the Toshiba directly, we only send commands to the Atmel.
I agree. If it is a black box and the interface to the host is defined by the Atmel uC firmware, then that's what the DT should describe. Perhaps a diagram here or pointer to one would help and remove mentioning what kind of bridge chip it is.
It's a *very* black box. I have some non-public schematics that don't even say what panel is involved, and no documentation of the uc interface. The driver code is just replicating the firmware's programming sequence.
Quoted 5 lines
I would certainly love to be building a generic TC358762 driver, which would be a lot more satisfying. I just don't think it's doable for this panel. Given that, what do I need to do to the DT? Should I just drop mention of the Toshiba and talk about this being a bridge with a custom microcontroller firmware?
Quoted 3 lines
I think that would be best, yes. Could you share a simple block-diagram of the hardware ? It would help turning my random advices into semi-random advices :-)
In terms of physical connections:
[15-pin "DSI" connector on 2835]
| | | I2C | DSI | | / \ SPI | [TS] [Atmel]------[TC358762] \ | \PWM | \ | DPI
Quoted 7 lines
[some backlight]------[some unknown panel]
The binding I'm trying to create is to expose what's necessary for a driver that talks I2C to the Atmel, which then controls the PWM and does the command sequence over SPI to the Toshiba that sets up its end of the DSI link.
The bridge (Atmel + TC358762 combination) here looks like it's primarily an i2c device (i.e, the control bus is i2c). Therefore, the drm-bridge driver here should be an i2c driver instead of a mipi_dsi_driver.
We have the facility to create a mipi DSI device without the need to have a corresponding node in DT. The ADV7533 and TC358767 drivers are examples of that.
The following is what the binding could look like, it's same as what Rob also mentioned previously in the thread.
Thanks,
Archit
dsi1: dsi@7e700000 {
#address-cells = <1>;
#size-cells = <0>;
<...>
/* The SoC's DSI input/output port */
ports {
#address-cells = <1>;
#size-cells = <0>;
/* port@0 if needed */
port@1 {
dsi_out_port: endpoint {
reg = <1>;
remote-endpoint = <&bridge_dsi_port>;
};
};
};
};i2c_dsi: i2c {
compatible = "i2c-gpio";
#address-cells = <1>;
#size-cells = <0>;
gpios = <&gpio 28 0
&gpio 29 0>;
/* the Atmel + TC35872 bridge */
pitouchscreen_bridge: bridge@45 {
compatible = "raspberrypi,touchscreen-bridge";
reg = <0x45>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
bridge_dsi_port: endpoint {
remote-endpoint = <&dsi_out_port>;
};
};
port@1 {
reg = <1>;
bridge_dpi_port: endpoint {
remote-endpoint = <&pitouchscreen_panel_port>;
};
};
};
};
};lcd {
compatible = "raspberrypi,7inch-touchscreen-panel";
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
pitouchscreen_panel_port: endpoint {
remote-endpoint = <&bridge_dpi_port>;
};
};
};
};Signature · 6 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Laurent Pinchart
reviewerRe: [PATCH 2/4] dt-bindings: Document the Raspberry Pi Touchscreen nodes.
In reply to Eric AnholtHi Eric,
On Tuesday 16 May 2017 11:46:36 Eric Anholt wrote:
[snip]
Quoted 10 lines
In terms of physical connections:
[15-pin "DSI" connector on 2835]
| I2C | DSI / \ SPI | [TS] [Atmel]------[TC358762] \ | \PWM | \ | DPI
Quoted 6 lines
[some backlight]------[some unknown panel]
The binding I'm trying to create is to expose what's necessary for a driver that talks I2C to the Atmel, which then controls the PWM and does the command sequence over SPI to the Toshiba that sets up its end of the DSI link.
According to the documentation I've been able to find, the TC358762 has an SPI master port through which it can output the commands DCS received from the DSI port, and an I2C slave port through which it can be configured by an external device. If the connection between the microcontroller and the TC358762 is indeed SPI and not I2C, I assume it's used by the microcontroller to receive the DCS commands and perform control of the backlight (and possibly other components) accordingly. By the way, is there any place where I can find a leaked version of the non-public panel schematics ? ;-)
As far as I can tell from your patch series, you don't need to send any command to the TC358762 over DSI. In that case I would model the panel in DT as an I2C device, as all control goes through the I2C bus. The DSI video data connection should then be modelled using the OF graph DT bindings. The result will be a black box panel with a custom black box panel driver, using a single DT node. There's no need for a separate bridge instance. That's the cleanest option I can come up with so far, and I agree that splitting TC358762 support into a standalone bridge driver makes no sense in this case.
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Laurent Pinchart
reviewerRe: [PATCH 2/4] dt-bindings: Document the Raspberry Pi Touchscreen nodes.
In reply to Archit TanejaHi Archit,
Quoted 1 line · On Thursday 18 May 2017 13:56:19 Archit Taneja wrote:
On 05/17/2017 12:16 AM, Eric Anholt wrote:
[snip]
Quoted 17 lines
Quoted 17 lines
In terms of physical connections:
[15-pin "DSI" connector on 2835]| I2C | DSI
/ \ SPI |
[TS] [Atmel]------[TC358762]
\ |
\PWM |
\ | DPI
[some backlight]------[some unknown panel]
Quoted 8 lines
Quoted 4 lines
The binding I'm trying to create is to expose what's necessary for a driver that talks I2C to the Atmel, which then controls the PWM and does the command sequence over SPI to the Toshiba that sets up its end of the DSI link.
The bridge (Atmel + TC358762 combination) here looks like it's primarily an i2c device (i.e, the control bus is i2c). Therefore, the drm-bridge driver here should be an i2c driver instead of a
mipi_dsi_driver.
Glad to see we agree, that's what I've proposed in a separate answer :-) I'd go one step further though, there should be no DRM bridge, just a DRM panel.
Quoted 31 lines
We have the facility to create a mipi DSI device without the need to have a corresponding node in DT. The ADV7533 and TC358767 drivers are examples of that.
The following is what the binding could look like, it's same as what Rob also mentioned previously in the thread.
Thanks,
Architdsi1: dsi@7e700000 { #address-cells = <1>; #size-cells = <0>; <...> /* The SoC's DSI input/output port */ ports { #address-cells = <1>; #size-cells = <0>; /* port@0 if needed */ port@1 { dsi_out_port: endpoint { reg = <1>; remote-endpoint = <&bridge_dsi_port>; }; }; }; };
Quoted 9 lines
i2c_dsi: i2c {
compatible = "i2c-gpio";
#address-cells = <1>;
#size-cells = <0>;
gpios = <&gpio 28 0
&gpio 29 0>;
/* the Atmel + TC35872 bridge */
pitouchscreen_bridge: bridge@45 {This should thus be lcd@45.
Quoted 1 line
compatible = "raspberrypi,touchscreen-bridge";
And this raspberrypi,7inch-touchscreen-panel. Shame we haven't standardized the vendor name prefix to rpi :-/
Quoted 9 lines
reg = <0x45>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
bridge_dsi_port: endpoint {This should be named panel_dsi_port.
Quoted 7 lines
remote-endpoint = <&dsi_out_port>;
};
};
port@1 {
reg = <1>;
bridge_dpi_port: endpoint {
remote-endpoint = <&pitouchscreen_panel_port>;
Quoted 2 lines
}; };
The second port is thus not needed.
Quoted 1 line
};
So we can simplify this to
port {
panel_dsi_port: endpoint {
remote-endpoint = <&dsi_out_port>;
};
};(no need for a ports node when there's a single port)
Quoted 16 lines
}; };lcd { compatible = "raspberrypi,7inch-touchscreen-panel"; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; pitouchscreen_panel_port: endpoint { remote-endpoint = <&bridge_dpi_port>; }; }; }; };
And this node can go away.
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/4] dt-bindings: Document the Raspberry Pi Touchscreen nodes.
Quoted 29 lines · Laurent Pinchart
Hi Archit,
Quoted 1 line · On Thursday 18 May 2017 13:56:19 Archit Taneja wrote:
On 05/17/2017 12:16 AM, Eric Anholt wrote:
[snip]
Quoted 22 lines
Quoted 21 lines
In terms of physical connections:
[15-pin "DSI" connector on 2835]| I2C | DSI
/ \ SPI |
[TS] [Atmel]------[TC358762]
\ |
\PWM |
\ | DPI
[some backlight]------[some unknown panel]
The binding I'm trying to create is to expose what's necessary for a driver that talks I2C to the Atmel, which then controls the PWM and does the command sequence over SPI to the Toshiba that sets up its end of the DSI link.
Quoted 6 lines
Quoted 3 lines
The bridge (Atmel + TC358762 combination) here looks like it's primarily an i2c device (i.e, the control bus is i2c). Therefore, the drm-bridge driver here should be an i2c driver instead of a
mipi_dsi_driver.Glad to see we agree, that's what I've proposed in a separate answer :-) I'd go one step further though, there should be no DRM bridge, just a DRM panel.
If the PCB containing the controller chips and the panel are part of a single casing, and the set up won't work with another panel, then yeah, I agree. If the bridge chips are on a separate adapter board, and there is a possibility to connect other panels, then maybe a separate DRM bridge and a DRM panel might be a safer bet.
Thanks,
Archit
Quoted 105 lines
Quoted 32 lines
We have the facility to create a mipi DSI device without the need to have a corresponding node in DT. The ADV7533 and TC358767 drivers are examples of that.
The following is what the binding could look like, it's same as what Rob also mentioned previously in the thread.
Thanks,
Architdsi1: dsi@7e700000 { #address-cells = <1>; #size-cells = <0>; <...> /* The SoC's DSI input/output port */ ports { #address-cells = <1>; #size-cells = <0>; /* port@0 if needed */ port@1 { dsi_out_port: endpoint { reg = <1>; remote-endpoint = <&bridge_dsi_port>; }; }; }; };Quoted 9 lines
i2c_dsi: i2c { compatible = "i2c-gpio"; #address-cells = <1>; #size-cells = <0>; gpios = <&gpio 28 0 &gpio 29 0>; /* the Atmel + TC35872 bridge */ pitouchscreen_bridge: bridge@45 {This should thus be lcd@45.
Quoted 1 line
compatible = "raspberrypi,touchscreen-bridge";And this raspberrypi,7inch-touchscreen-panel. Shame we haven't standardized the vendor name prefix to rpi :-/
Quoted 9 lines
reg = <0x45>; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; bridge_dsi_port: endpoint {This should be named
panel_dsi_port.Quoted 7 lines
remote-endpoint = <&dsi_out_port>; }; }; port@1 { reg = <1>; bridge_dpi_port: endpoint { remote-endpoint =<
&pitouchscreen_panel_port>;Quoted 2 lines
}; };The second port is thus not needed.
Quoted 1 line
};So we can simplify this to
port { panel_dsi_port: endpoint { remote-endpoint = <&dsi_out_port>; }; };(no need for a ports node when there's a single port)
Quoted 16 lines
}; };lcd { compatible = "raspberrypi,7inch-touchscreen-panel"; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; pitouchscreen_panel_port: endpoint { remote-endpoint = <&bridge_dpi_port>; }; }; }; };And this node can go away.
Signature · 6 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Laurent Pinchart
reviewerRe: [PATCH 2/4] dt-bindings: Document the Raspberry Pi Touchscreen nodes.
Hi Archit,
Quoted 30 lines · On Friday 19 May 2017 14:24:36 Archit Taneja wrote:
Quoted 21 lines · Laurent Pinchart
Quoted 1 line · On Thursday 18 May 2017 13:56:19 Archit Taneja wrote:
On 05/17/2017 12:16 AM, Eric Anholt wrote:
[snip]
Quoted 16 lines
Quoted 15 lines
In terms of physical connections:
[15-pin "DSI" connector on 2835]| I2C | DSI / \ SPI | [TS] [Atmel]------[TC358762] \ | \PWM | \ | DPI[some backlight]------[some unknown panel]
The binding I'm trying to create is to expose what's necessary for a driver that talks I2C to the Atmel, which then controls the PWM and does the command sequence over SPI to the Toshiba that sets up its end of the DSI link.
Quoted 7 lines
Quoted 3 lines
The bridge (Atmel + TC358762 combination) here looks like it's primarily an i2c device (i.e, the control bus is i2c). Therefore, the drm-bridge driver here should be an i2c driver instead of a
mipi_dsi_driver.Glad to see we agree, that's what I've proposed in a separate answer :-) I'd go one step further though, there should be no DRM bridge, just a DRM panel.
Quoted 5 lines
If the PCB containing the controller chips and the panel are part of a single casing, and the set up won't work with another panel, then yeah, I agree. If the bridge chips are on a separate adapter board, and there is a possibility to connect other panels, then maybe a separate DRM bridge and a DRM panel might be a safer bet.
I thought it was a single black box, but upon closer inspection there's a separate PCB with the Microcontroller and TC358762.
Eric, do you know if it's possible to exchange the panel for another one (and not just an model with identical features from another vendor, but another panel with a different mode for instance) without reprogramming the microcontroller, or is the bridge board tied to the panel model ?
Quoted 103 lines
Quoted 103 lines
Quoted 31 lines
We have the facility to create a mipi DSI device without the need to have a corresponding node in DT. The ADV7533 and TC358767 drivers are examples of that.
The following is what the binding could look like, it's same as what Rob also mentioned previously in the thread.
Thanks,
Architdsi1: dsi@7e700000 {
#address-cells = <1>; #size-cells = <0>; <...> /* The SoC's DSI input/output port */ ports { #address-cells = <1>; #size-cells = <0>; /* port@0 if needed */ port@1 { dsi_out_port: endpoint { reg = <1>; remote-endpoint = <&bridge_dsi_port>; }; }; }; };Quoted 9 lines
i2c_dsi: i2c { compatible = "i2c-gpio"; #address-cells = <1>; #size-cells = <0>; gpios = <&gpio 28 0 &gpio 29 0>; /* the Atmel + TC35872 bridge */ pitouchscreen_bridge: bridge@45 {This should thus be lcd@45.
Quoted 1 line
compatible = "raspberrypi,touchscreen-bridge";And this raspberrypi,7inch-touchscreen-panel. Shame we haven't standardized
the vendor name prefix to rpi :-/Quoted 8 lines
reg = <0x45>; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; bridge_dsi_port: endpoint {This should be named
panel_dsi_port.Quoted 7 lines
remote-endpoint = <&dsi_out_port>; }; }; port@1 { reg = <1>; bridge_dpi_port: endpoint { remote-endpoint =<
&pitouchscreen_panel_port>;Quoted 2 lines
}; };The second port is thus not needed.
Quoted 1 line
};So we can simplify this to
port { panel_dsi_port: endpoint { remote-endpoint = <&dsi_out_port>; }; };(no need for a ports node when there's a single port)
Quoted 16 lines
}; };lcd { compatible = "raspberrypi,7inch-touchscreen-panel"; ports { #address-cells = <1>; #size-cells = <0>; port@0 { reg = <0>; pitouchscreen_panel_port: endpoint { remote-endpoint = <&bridge_dpi_port>; }; }; }; };And this node can go away.
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/4] dt-bindings: Document the Raspberry Pi Touchscreen nodes.
In reply to Laurent PinchartQuoted 23 lines · Laurent Pinchart
Hi Eric,
On Tuesday 16 May 2017 11:46:36 Eric Anholt wrote:
[snip]
Quoted 10 lines
In terms of physical connections:
[15-pin "DSI" connector on 2835]
| I2C | DSI / \ SPI | [TS] [Atmel]------[TC358762] \ | \PWM | \ | DPIQuoted 6 lines
[some backlight]------[some unknown panel]
The binding I'm trying to create is to expose what's necessary for a driver that talks I2C to the Atmel, which then controls the PWM and does the command sequence over SPI to the Toshiba that sets up its end of the DSI link.
Quoted 8 lines
According to the documentation I've been able to find, the TC358762 has an SPI master port through which it can output the commands DCS received from the DSI port, and an I2C slave port through which it can be configured by an external device. If the connection between the microcontroller and the TC358762 is indeed SPI and not I2C, I assume it's used by the microcontroller to receive the DCS commands and perform control of the backlight (and possibly other components) accordingly. By the way, is there any place where I can find a leaked version of the non-public panel schematics ? ;-)
Not that I know of.
I don't know that you can control the backlight over DCS, given that I have no docs. We only send commands from Atmel to TC, not the other way around.
Quoted 8 lines
As far as I can tell from your patch series, you don't need to send any command to the TC358762 over DSI. In that case I would model the panel in DT as an I2C device, as all control goes through the I2C bus. The DSI video data connection should then be modelled using the OF graph DT bindings. The result will be a black box panel with a custom black box panel driver, using a single DT node. There's no need for a separate bridge instance. That's the cleanest option I can come up with so far, and I agree that splitting TC358762 support into a standalone bridge driver makes no sense in this case.
I agree, it's just that when I submitted to drm-panel I was told that it didn't make sense as a single driver, so I went to all of this work instead.
Re: [PATCH 2/4] dt-bindings: Document the Raspberry Pi Touchscreen nodes.
In reply to Laurent PinchartQuoted 39 lines · Laurent Pinchart
Hi Archit,
Quoted 30 lines · On Friday 19 May 2017 14:24:36 Archit Taneja wrote:
Quoted 21 lines · Laurent Pinchart
Quoted 1 line · On Thursday 18 May 2017 13:56:19 Archit Taneja wrote:
On 05/17/2017 12:16 AM, Eric Anholt wrote:
[snip]
Quoted 16 lines
Quoted 15 lines
In terms of physical connections:
[15-pin "DSI" connector on 2835]| I2C | DSI / \ SPI | [TS] [Atmel]------[TC358762] \ | \PWM | \ | DPI[some backlight]------[some unknown panel]
The binding I'm trying to create is to expose what's necessary for a driver that talks I2C to the Atmel, which then controls the PWM and does the command sequence over SPI to the Toshiba that sets up its end of the DSI link.
Quoted 7 lines
Quoted 3 lines
The bridge (Atmel + TC358762 combination) here looks like it's primarily an i2c device (i.e, the control bus is i2c). Therefore, the drm-bridge driver here should be an i2c driver instead of a
mipi_dsi_driver.Glad to see we agree, that's what I've proposed in a separate answer :-) I'd go one step further though, there should be no DRM bridge, just a DRM panel.
Quoted 5 lines
If the PCB containing the controller chips and the panel are part of a single casing, and the set up won't work with another panel, then yeah, I agree. If the bridge chips are on a separate adapter board, and there is a possibility to connect other panels, then maybe a separate DRM bridge and a DRM panel might be a safer bet.
Quoted 7 lines
I thought it was a single black box, but upon closer inspection there's a separate PCB with the Microcontroller and TC358762.
Eric, do you know if it's possible to exchange the panel for another one (and not just an model with identical features from another vendor, but another panel with a different mode for instance) without reprogramming the microcontroller, or is the bridge board tied to the panel model ?
Not without finding some other panel with equivalent non-standard connectors / doing your own soldering, at a minimum. And we don't know what kind of programming the microcontroller does, since it's a black box.