- rockchip,grf: phandle to the general register files syscon
-- rockchip,data-mapping: should be "vesa" or "jeida",
- This describes how the color bits are laid out in the
- serialized LVDS signal.
-- rockchip,data-width : should be <18> or <24>;
-- rockchip,output: should be "rgb", "lvds" or "duallvds",
- This describes the output face.
-
Optional properties
-- pinctrl-names: must contain a "default" entry.
+- pinctrl-names: must contain a "lcdc" entry.
- pinctrl-0: pin control group to be used for this controller.
-- pinctrl-1: pin control group to be used for gpio.
Required nodes:
- video port 0 for the VOP inputs
- video port 1 for either a panel or subsequent encoder
+the lvds panel described by
+ Documentation/devicetree/bindings/display/panel/simple-panel.txt
+
+- rockchip,data-mapping: should be "vesa" or "jeida",
+ This describes how the color bits are laid out in the
+ serialized LVDS signal.
+- rockchip,data-width : should be <18> or <24>;
+- rockchip,output: should be "rgb", "lvds" or "duallvds",
+ This describes the output face.
+- ports for remote LVDS output
+
Example:
+lvds_panel: lvds-panel {
+ status = "okay";
+ compatible = "simple-panel";
+ enable-gpios = <&gpio7 21 GPIO_ACTIVE_HIGH>;
+ rockchip,data-mapping = "jeida";
+ rockchip,data-width = <24>;
+ rockchip,output = "rgb";
+
+ ports {
+ panel_in_lvds: endpoint {
+ remote-endpoint = <&lvds_out_panel>;
+ };
+ };
+};
+
+
For Rockchip RK3288:
lvds: lvds@ff96c000 {
reg = <0xff96c000 0x4000>;
clocks = <&cru PCLK_LVDS_PHY>;
clock-names = "pclk_lvds";
+ pinctrl-names = "lcdc";
+ pinctrl-0 = <&lcdc_ctl>;
avdd1v0-supply = <&vdd10_lcd>;
avdd1v8-supply = <&vcc18_lcd>;
avdd3v3-supply = <&vcca_33>;
clock-names = "pclk_lvds", "pclk_lvds_ctl";
power-domains = <&power RK3368_PD_VIO>;
rockchip,grf = <&grf>;
- pinctrl-names = "lcdc", "gpio";
+ pinctrl-names = "lcdc";
pinctrl-0 = <&lcdc_lcdc>;
- pinctrl-1 = <&lcdc_gpio>;
ports {
reg = <0x0 0xff96c000 0x0 0x4000>;
clocks = <&cru PCLK_LVDS_PHY>;
clock-names = "pclk_lvds";
- pinctrl-names = "default";
- pinctrl-0 = <&lcdc0_ctl>;
+ pinctrl-names = "lcdc";
+ pinctrl-0 = <&lcdc_ctl>;
power-domains = <&power RK3288_PD_VIO>;
rockchip,grf = <&grf>;
status = "disabled";
};
};
- lcdc0 {
- lcdc0_ctl: lcdc0-ctl {
+ lcdc {
+ lcdc_ctl: lcdc-ctl {
rockchip,pins = <1 24 RK_FUNC_1 &pcfg_pull_none>,
<1 25 RK_FUNC_1 &pcfg_pull_none>,
<1 26 RK_FUNC_1 &pcfg_pull_none>,
u32 val;
int ret;
+ /* iomux to LCD data/sync mode */
+ if (lvds->output == DISPLAY_OUTPUT_RGB)
+ if (lvds->pins && !IS_ERR(lvds->pins->default_state))
+ pinctrl_select_state(lvds->pins->p,
+ lvds->pins->default_state);
if (LVDS_CHIP(lvds) == RK3288_LVDS) {
val = lvds->format;
if (lvds->output == DISPLAY_OUTPUT_DUAL_LVDS)
}
} else if (LVDS_CHIP(lvds) == RK336X_LVDS) {
if (lvds->output == DISPLAY_OUTPUT_RGB) {
- /* iomux to lcdc */
- if (lvds->pins && !IS_ERR(lvds->pins->default_state))
- pinctrl_select_state(lvds->pins->p,
- lvds->pins->default_state);
-
/* enable lvds mode */
val = v_RK336X_LVDSMODE_EN(0) |
v_RK336X_MIPIPHY_TTL_EN(1) |
dev_err(dev, "could not get pclk_ctrl\n");
lvds->pclk_ctrl = NULL;
}
- lvds->pins = devm_kzalloc(lvds->dev, sizeof(*lvds->pins),
- GFP_KERNEL);
- if (!lvds->pins)
- return -ENOMEM;
-
- lvds->pins->p = devm_pinctrl_get(lvds->dev);
- if (IS_ERR(lvds->pins->p)) {
- dev_info(lvds->dev, "no pinctrl handle\n");
- devm_kfree(lvds->dev, lvds->pins);
- lvds->pins = NULL;
- } else {
- lvds->pins->default_state =
- pinctrl_lookup_state(lvds->pins->p, "lcdc");
- if (IS_ERR(lvds->pins->default_state)) {
- dev_info(lvds->dev, "no default pinctrl state\n");
- devm_kfree(lvds->dev, lvds->pins);
- lvds->pins = NULL;
- }
- }
}
lvds->pclk = devm_clk_get(&pdev->dev, "pclk_lvds");
if (IS_ERR(lvds->pclk)) {
dev_err(dev, "could not get pclk_lvds\n");
return PTR_ERR(lvds->pclk);
}
+
+ lvds->pins = devm_kzalloc(lvds->dev, sizeof(*lvds->pins),
+ GFP_KERNEL);
+ if (!lvds->pins)
+ return -ENOMEM;
+
+ lvds->pins->p = devm_pinctrl_get(lvds->dev);
+ if (IS_ERR(lvds->pins->p)) {
+ dev_info(lvds->dev, "no pinctrl handle\n");
+ devm_kfree(lvds->dev, lvds->pins);
+ lvds->pins = NULL;
+ } else {
+ lvds->pins->default_state =
+ pinctrl_lookup_state(lvds->pins->p, "lcdc");
+ if (IS_ERR(lvds->pins->default_state)) {
+ dev_info(lvds->dev, "no lcdc pinctrl state\n");
+ devm_kfree(lvds->dev, lvds->pins);
+ lvds->pins = NULL;
+ }
+ }
+
lvds->grf = syscon_regmap_lookup_by_phandle(dev->of_node,
"rockchip,grf");
if (IS_ERR(lvds->grf)) {