Re: [PATCH v4 1/3] drm/bridge: add support for sn65dsi86 bridge driver
Hi Sandeep, Thank you for the patch! Yet something to improve: [auto build test ERROR on drm/drm-next] [also build test ERROR on v4.17-rc3 next-20180426] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Sandeep-Panda/Add-suppport-for-sn65dsi86-bridge-chip-and-Innolux-2k-edp-panel/20180430-035839 base: git://people.freedesktop.org/~airlied/linux.git drm-next config: openrisc-allyesconfig (attached as .config) compiler: or1k-linux-gcc (GCC) 6.0.0 20160327 (experimental) reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=openrisc All errors (new ones prefixed by >>): drivers/gpu/drm/bridge/ti-sn65dsi86.c: In function 'ti_sn_bridge_connector_get_modes': >> drivers/gpu/drm/bridge/ti-sn65dsi86.c:173:2: error: implicit declaration of >> function 'drm_edid_to_eld' [-Werror=implicit-function-declaration] drm_edid_to_eld(connector, edid); ^~~ cc1: some warnings being treated as errors vim +/drm_edid_to_eld +173 drivers/gpu/drm/bridge/ti-sn65dsi86.c 148 149 static int ti_sn_bridge_connector_get_modes(struct drm_connector *connector) 150 { 151 struct ti_sn_bridge *pdata = connector_to_ti_sn_bridge(connector); 152 struct drm_panel *panel = pdata->panel; 153 struct edid *edid; 154 155 if (panel) { 156 DRM_DEBUG("get mode from connected drm_panel\n"); 157 pdata->num_modes = drm_panel_get_modes(panel); 158 return pdata->num_modes; 159 } 160 161 /* get from EDID */ 162 if (!pdata->ddc) 163 return 0; 164 165 ti_sn_bridge_power_ctrl(pdata, true); 166 edid = drm_get_edid(connector, pdata->ddc); 167 ti_sn_bridge_power_ctrl(pdata, false); 168 if (!edid) 169 return 0; 170 171 drm_mode_connector_update_edid_property(connector, edid); 172 pdata->num_modes = drm_add_edid_modes(connector, edid); > 173 drm_edid_to_eld(connector, edid); 174 kfree(edid); 175 176 return pdata->num_modes; 177 } 178 --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v4 1/3] drm/bridge: add support for sn65dsi86 bridge driver
Hi Sandeep, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on drm/drm-next] [also build test WARNING on v4.17-rc3 next-20180426] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Sandeep-Panda/Add-suppport-for-sn65dsi86-bridge-chip-and-Innolux-2k-edp-panel/20180430-035839 base: git://people.freedesktop.org/~airlied/linux.git drm-next coccinelle warnings: (new ones prefixed by >>) >> drivers/gpu/drm/bridge/ti-sn65dsi86.c:711:3-8: No need to set .owner here. >> The core will do it. Please review and possibly fold the followup patch. --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v4 1/3] drm/bridge: add support for sn65dsi86 bridge driver
Hi Sandeep, Thank you for the patch! Yet something to improve: [auto build test ERROR on drm/drm-next] [also build test ERROR on v4.17-rc3 next-20180426] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Sandeep-Panda/Add-suppport-for-sn65dsi86-bridge-chip-and-Innolux-2k-edp-panel/20180430-035839 base: git://people.freedesktop.org/~airlied/linux.git drm-next config: x86_64-allmodconfig (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): drivers/gpu/drm/bridge/ti-sn65dsi86.c:173:9: sparse: undefined identifier 'drm_edid_to_eld' drivers/gpu/drm/bridge/ti-sn65dsi86.c:400:5: sparse: symbol 'ti_sn_bridge_ref_clk_table' was not declared. Should it be static? drivers/gpu/drm/bridge/ti-sn65dsi86.c:553:6: sparse: symbol 'ti_sn_bridge_pre_enable' was not declared. Should it be static? drivers/gpu/drm/bridge/ti-sn65dsi86.c:563:6: sparse: symbol 'ti_sn_bridge_post_disable' was not declared. Should it be static? drivers/gpu/drm/bridge/ti-sn65dsi86.c:173:24: sparse: call with no type! drivers/gpu/drm/bridge/ti-sn65dsi86.c: In function 'ti_sn_bridge_connector_get_modes': >> drivers/gpu/drm/bridge/ti-sn65dsi86.c:173:2: error: implicit declaration of >> function 'drm_edid_to_eld'; did you mean 'drm_edid_to_sad'? >> [-Werror=implicit-function-declaration] drm_edid_to_eld(connector, edid); ^~~ drm_edid_to_sad cc1: some warnings being treated as errors sparse warnings: (new ones prefixed by >>) drivers/gpu/drm/bridge/ti-sn65dsi86.c:173:9: sparse: undefined identifier 'drm_edid_to_eld' >> drivers/gpu/drm/bridge/ti-sn65dsi86.c:400:5: sparse: symbol >> 'ti_sn_bridge_ref_clk_table' was not declared. Should it be static? >> drivers/gpu/drm/bridge/ti-sn65dsi86.c:553:6: sparse: symbol >> 'ti_sn_bridge_pre_enable' was not declared. Should it be static? >> drivers/gpu/drm/bridge/ti-sn65dsi86.c:563:6: sparse: symbol >> 'ti_sn_bridge_post_disable' was not declared. Should it be static? >> drivers/gpu/drm/bridge/ti-sn65dsi86.c:173:24: sparse: call with no type! drivers/gpu/drm/bridge/ti-sn65dsi86.c: In function 'ti_sn_bridge_connector_get_modes': drivers/gpu/drm/bridge/ti-sn65dsi86.c:173:2: error: implicit declaration of function 'drm_edid_to_eld'; did you mean 'drm_edid_to_sad'? [-Werror=implicit-function-declaration] drm_edid_to_eld(connector, edid); ^~~ drm_edid_to_sad cc1: some warnings being treated as errors vim +173 drivers/gpu/drm/bridge/ti-sn65dsi86.c 148 149 static int ti_sn_bridge_connector_get_modes(struct drm_connector *connector) 150 { 151 struct ti_sn_bridge *pdata = connector_to_ti_sn_bridge(connector); 152 struct drm_panel *panel = pdata->panel; 153 struct edid *edid; 154 155 if (panel) { 156 DRM_DEBUG("get mode from connected drm_panel\n"); 157 pdata->num_modes = drm_panel_get_modes(panel); 158 return pdata->num_modes; 159 } 160 161 /* get from EDID */ 162 if (!pdata->ddc) 163 return 0; 164 165 ti_sn_bridge_power_ctrl(pdata, true); 166 edid = drm_get_edid(connector, pdata->ddc); 167 ti_sn_bridge_power_ctrl(pdata, false); 168 if (!edid) 169 return 0; 170 171 drm_mode_connector_update_edid_property(connector, edid); 172 pdata->num_modes = drm_add_edid_modes(connector, edid); > 173 drm_edid_to_eld(connector, edid); 174 kfree(edid); 175 176 return pdata->num_modes; 177 } 178 --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: application/gzip ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v4 1/3] drm/bridge: add support for sn65dsi86 bridge driver
Add support for TI's sn65dsi86 dsi2edp bridge chip. The chip converts DSI transmitted signal to eDP signal, which is fed to the connected eDP panel. This chip can be controlled via either i2c interface or dsi interface. Currently in driver all the control registers are being accessed through i2c interface only. Also as of now HPD support has not been added to bridge chip driver. Changes in v1: - Split the dt-bindings and the driver support into separate patches (Andrzej Hajda). - Use of gpiod APIs to parse and configure gpios instead of obsolete ones (Andrzej Hajda). - Use macros to define the register offsets (Andrzej Hajda). Changes in v2: - Separate out edp panel specific HW resource handling from bridge driver and create a separate edp panel drivers to handle panel specific mode information and HW resources (Sean Paul). - Replace pr_* APIs to DRM_* APIs to log error or debug information (Sean Paul). - Remove some of the unnecessary structure/variable from driver (Sean Paul). - Rename the function and structure prefix "sn65dsi86" to "ti_sn_bridge" (Sean Paul / Rob Herring). - Remove most of the hard-coding and modified the bridge init sequence based on current mode (Sean Paul). - Remove the existing function to retrieve the EDID data and implemented this as an i2c_adapter and use drm_get_edid() (Sean Paul). - Remove the dummy irq handler implementation, will add back the proper irq handling later (Sean Paul). - Capture the required enable gpios in a single array based on dt entry instead of having individual descriptor for each gpio (Sean Paul). Changes in v3: - Remove usage of irq_gpio and replace it as "interrupts" property (Rob Herring). - Remove the unnecessary header file inclusions (Sean Paul). - Rearrange the header files in alphabetical order (Sean Paul). - Use regmap interface to perform i2c transactions. - Update Copyright/License field and address other review comments (Jordan Crouse). Changes in v4: - Update License/Copyright (Sean Paul). - Add Kconfig and Makefile changes (Sean Paul). - Drop i2c gpio handling from this bridge driver, since i2c sda/scl gpios will be handled by i2c master. - Remove unnecessary goto statements (Sean Paul). - Add mutex lock to power_ctrl API to avoid race conditions (Sean Paul). - Add support to parse reference clk frequency from dt(optional). - Update the bridge chip enable/disable sequence. Signed-off-by: Sandeep Panda--- drivers/gpu/drm/bridge/Kconfig| 9 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/ti-sn65dsi86.c | 721 ++ 3 files changed, 731 insertions(+) create mode 100644 drivers/gpu/drm/bridge/ti-sn65dsi86.c diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index 3b99d5a..8153150 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -108,6 +108,15 @@ config DRM_TI_TFP410 ---help--- Texas Instruments TFP410 DVI/HDMI Transmitter driver +config DRM_TI_SN65DSI86 + tristate "TI SN65DSI86 DSI to eDP bridge" + depends on OF + select DRM_KMS_HELPER + select REGMAP_I2C + select DRM_PANEL + ---help--- + Texas Instruments SN65DSI86 DSI to eDP Bridge driver + source "drivers/gpu/drm/bridge/analogix/Kconfig" source "drivers/gpu/drm/bridge/adv7511/Kconfig" diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile index 373eb28..3711be8 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -12,4 +12,5 @@ obj-$(CONFIG_DRM_TOSHIBA_TC358767) += tc358767.o obj-$(CONFIG_DRM_ANALOGIX_DP) += analogix/ obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/ obj-$(CONFIG_DRM_TI_TFP410) += ti-tfp410.o +obj-$(CONFIG_DRM_TI_SN65DSI86) += ti-sn65dsi86.o obj-y += synopsys/ diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c new file mode 100644 index 000..28a4be8 --- /dev/null +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -0,0 +1,721 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2018, The Linux Foundation. All rights reserved. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define SN_BRIDGE_REVISION_ID 0x2 + +/* Link Training specific registers */ +#define SN_DEVICE_REV_REG 0x08 +#define SN_REFCLK_FREQ_REG 0x0A +#define SN_DSI_LANES_REG 0x10 +#define SN_DSIA_CLK_FREQ_REG 0x12 +#define SN_ENH_FRAME_REG 0x5A +#define SN_SSC_CONFIG_REG 0x93 +#define SN_DATARATE_CONFIG_REG 0x94 +#define SN_PLL_ENABLE_REG 0x0D +#define SN_SCRAMBLE_CONFIG_REG 0x95 +#define SN_AUX_WDATA0_REG 0x64 +#define