LVDS Controller Support for SAM9X75 SoC
Subsystems (7)
Dharma Balasubiramani
maintainerv7 cover LVDS Controller Support for SAM9X75 SoC
This patch series introduces LVDS controller support for the SAM9X75 SoC. The LVDS controller is designed to work with Microchip's sam9x7 series System-on-Chip (SoC) devices, providing Low Voltage Differential Signaling capabilities.
Patch series Changelog:
- Include configs: at91: Enable LVDS serializer
- include all necessary To/Cc entries.
The Individual Changelogs are available on the respective patches.
Dharma Balasubiramani (4):
dt-bindings: display: bridge: add sam9x75-lvds binding drm/bridge: add lvds controller support for sam9x7
MAINTAINERS: add SAM9X7 SoC's LVDS controller
ARM: configs: at91: Enable LVDS serializer support
.../bridge/microchip,sam9x75-lvds.yaml | 55 +++++ MAINTAINERS | 8 + arch/arm/configs/at91_dt_defconfig | 1 + drivers/gpu/drm/bridge/Kconfig | 7 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/microchip-lvds.c | 229 ++++++++++++++++++ 6 files changed, 301 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/microchip,sam9x75-lvds.yaml create mode 100644 drivers/gpu/drm/bridge/microchip-lvds.c
Signature · 1 line
2.25.1
Dharma Balasubiramani
maintainerPATCH v7 1/4 dt-bindings: display: bridge: add sam9x75-lvds binding
Add the 'sam9x75-lvds' compatible binding, which describes the Low Voltage Differential Signaling (LVDS) Controller found on some Microchip's sam9x7 series System-on-Chip (SoC) devices. This binding will be used to define the properties and configuration for the LVDS Controller in DT.
---
Changelog
v6 -> v7
- No Changes.
v5 -> v6
- No Changes.
v4 -> v5
- No changes.
v3 -> v4
- Rephrase the commit subject.
v2 -> v3
- No changes.
v1 -> v2
- Remove '|' in description, as there is no formatting to preserve.
- Remove 'gclk' from clock-names as there is only one clock(pclk).
- Remove the unused headers and include only used ones.
- Change the compatible name specific to SoC (sam9x75) instead of entire series.
- Change file name to match the compatible name.
.../bridge/microchip,sam9x75-lvds.yaml | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/bridge/microchip,sam9x75-lvds.yaml
Documentation/devicetree/bindings/display/bridge/microchip,sam9x75-lvds.yaml new file +55 -0
@@ -0,0 +1,55 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/bridge/microchip,sam9x75-lvds.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Microchip SAM9X75 LVDS Controller + +maintainers: + - Dharma Balasubiramani <[email protected]> + +description: + The Low Voltage Differential Signaling Controller (LVDSC) manages data + format conversion from the LCD Controller internal DPI bus to OpenLDI + LVDS output signals. LVDSC functions include bit mapping, balanced mode + management, and serializer. + +properties: + compatible: + const: microchip,sam9x75-lvds + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + items: + - description: Peripheral Bus Clock + + clock-names: + items: + - const: pclk + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + #include <dt-bindings/clock/at91.h> + lvds-controller@f8060000 { + compatible = "microchip,sam9x75-lvds"; + reg = <0xf8060000 0x100>; + interrupts = <56 IRQ_TYPE_LEVEL_HIGH 0>; + clocks = <&pmc PMC_TYPE_PERIPHERAL 56>; + clock-names = "pclk"; + };
Signature · 1 line
2.25.1
Dharma Balasubiramani
maintainerPATCH v7 2/4 drm/bridge: add lvds controller support for sam9x7
In reply to Dharma BalasubiramaniAdd a new LVDS controller driver for sam9x7 which does the following:
- Prepares and enables the LVDS Peripheral clock
- Defines its connector type as DRM_MODE_CONNECTOR_LVDS and adds itself to the global bridge list.
- Identifies its output endpoint as panel and adds it to the encoder display pipeline
- Enables the LVDS serializer
---
Changelog
v6 -> v7
- Remove setting encoder type from bridge driver.
- Drop clk_disable() from pm_runtime_get_sync() error handling.
- Use devm_clk_get() instead of prepared version.
- Hence use clk_prepare_enable() and clk_disable_unprepare().
- Use devm_drm_of_get_bridge() instead of devm_drm_panel_bridge_add().
- Add error check for devm_pm_runtime_enable().
- Use dev_err() instead of DRM_DEV_ERROR() as it is deprecated.
- Add missing Acked-by tag.
v5 -> v6
- No Changes.
v4 -> v5
- Drop the unused variable 'format'.
- Use DRM wrapper for dev_err() to maintain uniformity.
- return -ENODEV instead of -EINVAL to maintain consistency with other DRM bridge drivers.
v3 -> v4
- No changes.
v2 ->v3
- Correct Typo error "serializer".
- Consolidate get() and prepare() functions and use devm_clk_get_prepared().
- Remove unused variable 'ret' in probe().
- Use devm_pm_runtime_enable() and drop the mchp_lvds_remove(). v1 -> v2
- Drop 'res' variable and combine two lines into one.
- Handle deferred probe properly, use dev_err_probe().
- Don't print anything on deferred probe. Dropped print.
- Remove the MODULE_ALIAS and add MODULE_DEVICE_TABLE().
- symbol 'mchp_lvds_driver' was not declared. It should be static.
--- drivers/gpu/drm/bridge/Kconfig | 7 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/microchip-lvds.c | 229 ++++++++++++++++++++++++ 3 files changed, 237 insertions(+) create mode 100644 drivers/gpu/drm/bridge/microchip-lvds.c
drivers/gpu/drm/bridge/Kconfig +7 -0
@@ -190,6 +190,13 @@ config DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW to DP++. This is used with the i.MX6 imx-ldb driver. You are likely to say N here. +config DRM_MICROCHIP_LVDS_SERIALIZER + tristate "Microchip LVDS serializer support" + depends on OF + depends on DRM_ATMEL_HLCDC + help + Support for Microchip's LVDS serializer. + config DRM_NWL_MIPI_DSI tristate "Northwest Logic MIPI DSI Host controller" depends on DRM
drivers/gpu/drm/bridge/Makefile +1 -0
@@ -13,6 +13,7 @@ obj-$(CONFIG_DRM_LONTIUM_LT9611) += lontium-lt9611.o obj-$(CONFIG_DRM_LONTIUM_LT9611UXC) += lontium-lt9611uxc.o obj-$(CONFIG_DRM_LVDS_CODEC) += lvds-codec.o obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v3-fw.o +obj-$(CONFIG_DRM_MICROCHIP_LVDS_SERIALIZER) += microchip-lvds.o obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o obj-$(CONFIG_DRM_PARADE_PS8640) += parade-ps8640.o
drivers/gpu/drm/bridge/microchip-lvds.c new file +229 -0
229 lines not on this page · raw message
Signature · 1 line
2.25.1
kernel test robot
build botRe: [PATCH v7 2/4] drm/bridge: add lvds controller support for sam9x7
kernel test robot noticed the following build warnings:
Hi Dharma,
kernel test robot noticed the following build warnings:
[auto build test WARNING on drm-misc/drm-misc-next]
[also build test WARNING on linus/master v6.9-rc4 next-20240419] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Dharma-Balasubiramani/dt-bindings-display-bridge-add-sam9x75-lvds-binding/20240418-170157 base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next patch link: https://lore.kernel.org/r/20240418085725.373797-3-dharma.b%40microchip.com patch subject: [PATCH v7 2/4] drm/bridge: add lvds controller support for sam9x7 config: arm-at91_dt_defconfig (https://download.01.org/0day-ci/archive/20240421/[email protected]/config) compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 7089c359a3845323f6f30c44a47dd901f2edfe63) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240421/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
In file included from drivers/gpu/drm/bridge/microchip-lvds.c:17:
In file included from include/linux/phy/phy.h:17:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:21:
In file included from include/linux/mm.h:2208:
include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
>> drivers/gpu/drm/bridge/microchip-lvds.c:199:6: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
199 | if (ret < 0) {
| ^~~
drivers/gpu/drm/bridge/microchip-lvds.c:154:9: note: initialize the variable 'ret' to silence this warning
154 | int ret;
| ^
| = 02 warnings generated.
vim +/ret +199 drivers/gpu/drm/bridge/microchip-lvds.c
148
149 static int mchp_lvds_probe(struct platform_device *pdev)
150 {
151 struct device *dev = &pdev->dev;
152 struct mchp_lvds *lvds;
153 struct device_node *port;
154 int ret;
155
156 if (!dev->of_node)
157 return -ENODEV;
158
159 lvds = devm_kzalloc(&pdev->dev, sizeof(*lvds), GFP_KERNEL);
160 if (!lvds)
161 return -ENOMEM;
162
163 lvds->dev = dev;
164
165 lvds->regs = devm_ioremap_resource(lvds->dev,
166 platform_get_resource(pdev, IORESOURCE_MEM, 0));
167 if (IS_ERR(lvds->regs))
168 return PTR_ERR(lvds->regs);
169
170 lvds->pclk = devm_clk_get(lvds->dev, "pclk");
171 if (IS_ERR(lvds->pclk))
172 return dev_err_probe(lvds->dev, PTR_ERR(lvds->pclk),
173 "could not get pclk_lvds\n");
174
175 port = of_graph_get_remote_node(dev->of_node, 1, 0);
176 if (!port) {
177 dev_err(dev,
178 "can't find port point, please init lvds panel port!\n");
179 return -ENODEV;
180 }
181
182 lvds->panel = of_drm_find_panel(port);
183 of_node_put(port);
184
185 if (IS_ERR(lvds->panel))
186 return -EPROBE_DEFER;
187
188 lvds->panel_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0);
189
190 if (IS_ERR(lvds->panel_bridge))
191 return PTR_ERR(lvds->panel_bridge);
192
193 lvds->bridge.of_node = dev->of_node;
194 lvds->bridge.type = DRM_MODE_CONNECTOR_LVDS;
195 lvds->bridge.funcs = &mchp_lvds_bridge_funcs;
196
197 dev_set_drvdata(dev, lvds);
198 devm_pm_runtime_enable(dev);
> 199 if (ret < 0) { 200 dev_err(lvds->dev, "failed to enable pm runtime: %d\n", ret);
201 return ret;
202 }
203
204 drm_bridge_add(&lvds->bridge);
205
206 return 0;
207 }
208
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Dharma Balasubiramani
maintainerPATCH v7 3/4 MAINTAINERS: add SAM9X7 SoC's LVDS controller
In reply to Dharma BalasubiramaniAdd the newly added LVDS controller for the SAM9X7 SoC to the existing MAINTAINERS entry.
---
Changelog
v6 -> v7
- No changes.
v5 -> v6
- Correct the file name sam9x7-lvds.yaml -> sam9x75-lvds.yaml. v4 -> v5
v3 -> v4
- No changes.
v2 -> v3
- Move the entry before "MICROCHIP SAMA5D2-COMPATIBLE ADC DRIVER". v1 -> v2
- No Changes.
--- MAINTAINERS | 8 ++++++++ 1 file changed, 8 insertions(+)
MAINTAINERS +8 -0
@@ -14563,6 +14563,14 @@ S: Supported F: Documentation/devicetree/bindings/pwm/atmel,at91sam-pwm.yaml F: drivers/pwm/pwm-atmel.c +MICROCHIP SAM9x7-COMPATIBLE LVDS CONTROLLER +M: Manikandan Muralidharan <[email protected]> +M: Dharma Balasubiramani <[email protected]> +L: [email protected] +S: Supported +F: Documentation/devicetree/bindings/display/bridge/microchip,sam9x75-lvds.yaml +F: drivers/gpu/drm/bridge/microchip-lvds.c + MICROCHIP SAMA5D2-COMPATIBLE ADC DRIVER M: Eugen Hristev <[email protected]> L: [email protected]
Signature · 1 line
2.25.1
Dharma Balasubiramani
maintainerPATCH v7 4/4 ARM: configs: at91: Enable LVDS serializer support
In reply to Dharma BalasubiramaniEnable LVDS serializer support for display pipeline.
---
Changelog
v6 -> v7
v5 -> v6
v4 -> v5
v3 -> v4
v2 -> v3
- No Changes.
--- arch/arm/configs/at91_dt_defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm/configs/at91_dt_defconfig +1 -0
@@ -143,6 +143,7 @@ CONFIG_VIDEO_OV2640=m CONFIG_VIDEO_OV7740=m CONFIG_DRM=y CONFIG_DRM_ATMEL_HLCDC=y +CONFIG_DRM_MICROCHIP_LVDS_SERIALIZER=y CONFIG_DRM_PANEL_SIMPLE=y CONFIG_DRM_PANEL_EDP=y CONFIG_FB_ATMEL=y
Signature · 1 line
2.25.1