Lines Matching defs:st7701

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