Lines Matching +full:panel +full:- +full:specific

1 // SPDX-License-Identifier: GPL-2.0
3 * Sharp LS037V7DW01 LCD Panel Driver
7 * Based on the omapdrm-specific panel-sharp-ls037v7dw01 driver
25 struct drm_panel panel; member
37 container_of(p, struct ls037v7dw01_panel, panel)
39 static int ls037v7dw01_disable(struct drm_panel *panel) in ls037v7dw01_disable() argument
41 struct ls037v7dw01_panel *lcd = to_ls037v7dw01_device(panel); in ls037v7dw01_disable()
43 gpiod_set_value_cansleep(lcd->ini_gpio, 0); in ls037v7dw01_disable()
44 gpiod_set_value_cansleep(lcd->resb_gpio, 0); in ls037v7dw01_disable()
52 static int ls037v7dw01_unprepare(struct drm_panel *panel) in ls037v7dw01_unprepare() argument
54 struct ls037v7dw01_panel *lcd = to_ls037v7dw01_device(panel); in ls037v7dw01_unprepare()
56 regulator_disable(lcd->vdd); in ls037v7dw01_unprepare()
60 static int ls037v7dw01_prepare(struct drm_panel *panel) in ls037v7dw01_prepare() argument
62 struct ls037v7dw01_panel *lcd = to_ls037v7dw01_device(panel); in ls037v7dw01_prepare()
65 ret = regulator_enable(lcd->vdd); in ls037v7dw01_prepare()
67 dev_err(&lcd->pdev->dev, "%s: failed to enable regulator\n", in ls037v7dw01_prepare()
73 static int ls037v7dw01_enable(struct drm_panel *panel) in ls037v7dw01_enable() argument
75 struct ls037v7dw01_panel *lcd = to_ls037v7dw01_device(panel); in ls037v7dw01_enable()
80 gpiod_set_value_cansleep(lcd->resb_gpio, 1); in ls037v7dw01_enable()
81 gpiod_set_value_cansleep(lcd->ini_gpio, 1); in ls037v7dw01_enable()
102 static int ls037v7dw01_get_modes(struct drm_panel *panel, in ls037v7dw01_get_modes() argument
107 mode = drm_mode_duplicate(connector->dev, &ls037v7dw01_mode); in ls037v7dw01_get_modes()
109 return -ENOMEM; in ls037v7dw01_get_modes()
114 connector->display_info.width_mm = ls037v7dw01_mode.width_mm; in ls037v7dw01_get_modes()
115 connector->display_info.height_mm = ls037v7dw01_mode.height_mm; in ls037v7dw01_get_modes()
122 connector->display_info.bus_flags = DRM_BUS_FLAG_DE_HIGH in ls037v7dw01_get_modes()
141 lcd = devm_kzalloc(&pdev->dev, sizeof(*lcd), GFP_KERNEL); in ls037v7dw01_probe()
143 return -ENOMEM; in ls037v7dw01_probe()
146 lcd->pdev = pdev; in ls037v7dw01_probe()
148 lcd->vdd = devm_regulator_get(&pdev->dev, "envdd"); in ls037v7dw01_probe()
149 if (IS_ERR(lcd->vdd)) in ls037v7dw01_probe()
150 return dev_err_probe(&pdev->dev, PTR_ERR(lcd->vdd), in ls037v7dw01_probe()
153 lcd->ini_gpio = devm_gpiod_get(&pdev->dev, "enable", GPIOD_OUT_LOW); in ls037v7dw01_probe()
154 if (IS_ERR(lcd->ini_gpio)) in ls037v7dw01_probe()
155 return dev_err_probe(&pdev->dev, PTR_ERR(lcd->ini_gpio), in ls037v7dw01_probe()
158 lcd->resb_gpio = devm_gpiod_get(&pdev->dev, "reset", GPIOD_OUT_LOW); in ls037v7dw01_probe()
159 if (IS_ERR(lcd->resb_gpio)) in ls037v7dw01_probe()
160 return dev_err_probe(&pdev->dev, PTR_ERR(lcd->resb_gpio), in ls037v7dw01_probe()
163 lcd->mo_gpio = devm_gpiod_get_index(&pdev->dev, "mode", 0, in ls037v7dw01_probe()
165 if (IS_ERR(lcd->mo_gpio)) { in ls037v7dw01_probe()
166 dev_err(&pdev->dev, "failed to get mode[0] gpio\n"); in ls037v7dw01_probe()
167 return PTR_ERR(lcd->mo_gpio); in ls037v7dw01_probe()
170 lcd->lr_gpio = devm_gpiod_get_index(&pdev->dev, "mode", 1, in ls037v7dw01_probe()
172 if (IS_ERR(lcd->lr_gpio)) { in ls037v7dw01_probe()
173 dev_err(&pdev->dev, "failed to get mode[1] gpio\n"); in ls037v7dw01_probe()
174 return PTR_ERR(lcd->lr_gpio); in ls037v7dw01_probe()
177 lcd->ud_gpio = devm_gpiod_get_index(&pdev->dev, "mode", 2, in ls037v7dw01_probe()
179 if (IS_ERR(lcd->ud_gpio)) { in ls037v7dw01_probe()
180 dev_err(&pdev->dev, "failed to get mode[2] gpio\n"); in ls037v7dw01_probe()
181 return PTR_ERR(lcd->ud_gpio); in ls037v7dw01_probe()
184 drm_panel_init(&lcd->panel, &pdev->dev, &ls037v7dw01_funcs, in ls037v7dw01_probe()
187 drm_panel_add(&lcd->panel); in ls037v7dw01_probe()
196 drm_panel_remove(&lcd->panel); in ls037v7dw01_remove()
197 drm_panel_disable(&lcd->panel); in ls037v7dw01_remove()
198 drm_panel_unprepare(&lcd->panel); in ls037v7dw01_remove()
212 .name = "panel-sharp-ls037v7dw01",
220 MODULE_DESCRIPTION("Sharp LS037V7DW01 Panel Driver");