Lines Matching full:st7701
99 struct st7701 { struct
109 static inline struct st7701 *panel_to_st7701(struct drm_panel *panel) in panel_to_st7701() argument
111 return container_of(panel, struct st7701, panel); in panel_to_st7701()
114 static inline int st7701_dsi_write(struct st7701 *st7701, const void *seq, in st7701_dsi_write() argument
117 return mipi_dsi_dcs_write_buffer(st7701->dsi, seq, len); in st7701_dsi_write()
120 #define ST7701_DSI(st7701, seq...) \ argument
123 st7701_dsi_write(st7701, d, ARRAY_SIZE(d)); \
126 static void st7701_init_sequence(struct st7701 *st7701) in st7701_init_sequence() argument
128 const struct drm_display_mode *mode = st7701->desc->mode; in st7701_init_sequence()
130 ST7701_DSI(st7701, MIPI_DCS_SOFT_RESET, 0x00); in st7701_init_sequence()
135 ST7701_DSI(st7701, MIPI_DCS_EXIT_SLEEP_MODE, 0x00); in st7701_init_sequence()
137 msleep(st7701->sleep_delay); in st7701_init_sequence()
140 ST7701_DSI(st7701, DSI_CMD2BKX_SEL, in st7701_init_sequence()
142 ST7701_DSI(st7701, DSI_CMD2_BK0_PVGAMCTRL, 0x00, 0x0E, 0x15, 0x0F, in st7701_init_sequence()
145 ST7701_DSI(st7701, DSI_CMD2_BK0_NVGAMCTRL, 0x00, 0x0E, 0x95, 0x0F, in st7701_init_sequence()
148 ST7701_DSI(st7701, DSI_CMD2_BK0_LNESET, in st7701_init_sequence()
150 ST7701_DSI(st7701, DSI_CMD2_BK0_PORCTRL, in st7701_init_sequence()
153 ST7701_DSI(st7701, DSI_CMD2_BK0_INVSEL, in st7701_init_sequence()
157 ST7701_DSI(st7701, DSI_CMD2BKX_SEL, in st7701_init_sequence()
159 ST7701_DSI(st7701, DSI_CMD2_BK1_VRHS, DSI_CMD2_BK1_VRHA_SET); in st7701_init_sequence()
160 ST7701_DSI(st7701, DSI_CMD2_BK1_VCOM, DSI_CMD2_BK1_VCOM_SET); in st7701_init_sequence()
161 ST7701_DSI(st7701, DSI_CMD2_BK1_VGHSS, DSI_CMD2_BK1_VGHSS_SET); in st7701_init_sequence()
162 ST7701_DSI(st7701, DSI_CMD2_BK1_TESTCMD, DSI_CMD2_BK1_TESTCMD_VAL); in st7701_init_sequence()
163 ST7701_DSI(st7701, DSI_CMD2_BK1_VGLS, DSI_CMD2_BK1_VGLS_SET); in st7701_init_sequence()
164 ST7701_DSI(st7701, DSI_CMD2_BK1_PWCTLR1, DSI_CMD2_BK1_PWCTLR1_SET); in st7701_init_sequence()
165 ST7701_DSI(st7701, DSI_CMD2_BK1_PWCTLR2, DSI_CMD2_BK1_PWCTLR2_SET); in st7701_init_sequence()
166 ST7701_DSI(st7701, DSI_CMD2_BK1_SPD1, DSI_CMD2_BK1_SPD1_SET); in st7701_init_sequence()
167 ST7701_DSI(st7701, DSI_CMD2_BK1_SPD2, DSI_CMD2_BK1_SPD2_SET); in st7701_init_sequence()
168 ST7701_DSI(st7701, DSI_CMD2_BK1_MIPISET1, DSI_CMD2_BK1_MIPISET1_SET); in st7701_init_sequence()
174 ST7701_DSI(st7701, 0xE0, 0x00, 0x00, 0x02); in st7701_init_sequence()
175 ST7701_DSI(st7701, 0xE1, 0x0B, 0x00, 0x0D, 0x00, 0x0C, 0x00, 0x0E, in st7701_init_sequence()
177 ST7701_DSI(st7701, 0xE2, 0x33, 0x33, 0x44, 0x44, 0x64, 0x00, 0x66, in st7701_init_sequence()
179 ST7701_DSI(st7701, 0xE3, 0x00, 0x00, 0x33, 0x33); in st7701_init_sequence()
180 ST7701_DSI(st7701, 0xE4, 0x44, 0x44); in st7701_init_sequence()
181 ST7701_DSI(st7701, 0xE5, 0x0C, 0x78, 0x3C, 0xA0, 0x0E, 0x78, 0x3C, in st7701_init_sequence()
183 ST7701_DSI(st7701, 0xE6, 0x00, 0x00, 0x33, 0x33); in st7701_init_sequence()
184 ST7701_DSI(st7701, 0xE7, 0x44, 0x44); in st7701_init_sequence()
185 ST7701_DSI(st7701, 0xE8, 0x0D, 0x78, 0x3C, 0xA0, 0x0F, 0x78, 0x3C, in st7701_init_sequence()
187 ST7701_DSI(st7701, 0xEB, 0x02, 0x02, 0x39, 0x39, 0xEE, 0x44, 0x00); in st7701_init_sequence()
188 ST7701_DSI(st7701, 0xEC, 0x00, 0x00); in st7701_init_sequence()
189 ST7701_DSI(st7701, 0xED, 0xFF, 0xF1, 0x04, 0x56, 0x72, 0x3F, 0xFF, in st7701_init_sequence()
193 ST7701_DSI(st7701, DSI_CMD2BKX_SEL, in st7701_init_sequence()
199 struct st7701 *st7701 = panel_to_st7701(panel); in st7701_prepare() local
202 gpiod_set_value(st7701->reset, 0); in st7701_prepare()
204 ret = regulator_bulk_enable(st7701->desc->num_supplies, in st7701_prepare()
205 st7701->supplies); in st7701_prepare()
210 gpiod_set_value(st7701->reset, 1); in st7701_prepare()
213 st7701_init_sequence(st7701); in st7701_prepare()
220 struct st7701 *st7701 = panel_to_st7701(panel); in st7701_enable() local
222 ST7701_DSI(st7701, MIPI_DCS_SET_DISPLAY_ON, 0x00); in st7701_enable()
229 struct st7701 *st7701 = panel_to_st7701(panel); in st7701_disable() local
231 ST7701_DSI(st7701, MIPI_DCS_SET_DISPLAY_OFF, 0x00); in st7701_disable()
238 struct st7701 *st7701 = panel_to_st7701(panel); in st7701_unprepare() local
240 ST7701_DSI(st7701, MIPI_DCS_ENTER_SLEEP_MODE, 0x00); in st7701_unprepare()
242 msleep(st7701->sleep_delay); in st7701_unprepare()
244 gpiod_set_value(st7701->reset, 0); in st7701_unprepare()
255 msleep(st7701->sleep_delay); in st7701_unprepare()
257 regulator_bulk_disable(st7701->desc->num_supplies, st7701->supplies); in st7701_unprepare()
265 struct st7701 *st7701 = panel_to_st7701(panel); in st7701_get_modes() local
266 const struct drm_display_mode *desc_mode = st7701->desc->mode; in st7701_get_modes()
271 dev_err(&st7701->dsi->dev, "failed to add mode %ux%u@%u\n", in st7701_get_modes()
331 struct st7701 *st7701; in st7701_dsi_probe() local
334 st7701 = devm_kzalloc(&dsi->dev, sizeof(*st7701), GFP_KERNEL); in st7701_dsi_probe()
335 if (!st7701) in st7701_dsi_probe()
343 st7701->supplies = devm_kcalloc(&dsi->dev, desc->num_supplies, in st7701_dsi_probe()
344 sizeof(*st7701->supplies), in st7701_dsi_probe()
346 if (!st7701->supplies) in st7701_dsi_probe()
350 st7701->supplies[i].supply = desc->supply_names[i]; in st7701_dsi_probe()
353 st7701->supplies); in st7701_dsi_probe()
357 st7701->reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW); in st7701_dsi_probe()
358 if (IS_ERR(st7701->reset)) { in st7701_dsi_probe()
360 return PTR_ERR(st7701->reset); in st7701_dsi_probe()
363 drm_panel_init(&st7701->panel, &dsi->dev, &st7701_funcs, in st7701_dsi_probe()
367 * Once sleep out has been issued, ST7701 IC required to wait 120ms in st7701_dsi_probe()
375 st7701->sleep_delay = 120 + desc->panel_sleep_delay; in st7701_dsi_probe()
377 ret = drm_panel_of_backlight(&st7701->panel); in st7701_dsi_probe()
381 drm_panel_add(&st7701->panel); in st7701_dsi_probe()
383 mipi_dsi_set_drvdata(dsi, st7701); in st7701_dsi_probe()
384 st7701->dsi = dsi; in st7701_dsi_probe()
385 st7701->desc = desc; in st7701_dsi_probe()
392 struct st7701 *st7701 = mipi_dsi_get_drvdata(dsi); in st7701_dsi_remove() local
395 drm_panel_remove(&st7701->panel); in st7701_dsi_remove()
410 .name = "st7701",
417 MODULE_DESCRIPTION("Sitronix ST7701 LCD Panel Driver");