st7701 112 drivers/gpu/drm/panel/panel-sitronix-st7701.c static inline struct st7701 *panel_to_st7701(struct drm_panel *panel) st7701 114 drivers/gpu/drm/panel/panel-sitronix-st7701.c return container_of(panel, struct st7701, panel); st7701 117 drivers/gpu/drm/panel/panel-sitronix-st7701.c static inline int st7701_dsi_write(struct st7701 *st7701, const void *seq, st7701 120 drivers/gpu/drm/panel/panel-sitronix-st7701.c return mipi_dsi_dcs_write_buffer(st7701->dsi, seq, len); st7701 123 drivers/gpu/drm/panel/panel-sitronix-st7701.c #define ST7701_DSI(st7701, seq...) \ st7701 126 drivers/gpu/drm/panel/panel-sitronix-st7701.c st7701_dsi_write(st7701, d, ARRAY_SIZE(d)); \ st7701 129 drivers/gpu/drm/panel/panel-sitronix-st7701.c static void st7701_init_sequence(struct st7701 *st7701) st7701 131 drivers/gpu/drm/panel/panel-sitronix-st7701.c const struct drm_display_mode *mode = st7701->desc->mode; st7701 133 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, MIPI_DCS_SOFT_RESET, 0x00); st7701 138 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, MIPI_DCS_EXIT_SLEEP_MODE, 0x00); st7701 140 drivers/gpu/drm/panel/panel-sitronix-st7701.c msleep(st7701->sleep_delay); st7701 143 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2BKX_SEL, st7701 145 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2_BK0_PVGAMCTRL, 0x00, 0x0E, 0x15, 0x0F, st7701 148 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2_BK0_NVGAMCTRL, 0x00, 0x0E, 0x95, 0x0F, st7701 151 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2_BK0_LNESET, st7701 153 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2_BK0_PORCTRL, st7701 156 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2_BK0_INVSEL, st7701 160 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2BKX_SEL, st7701 162 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2_BK1_VRHS, DSI_CMD2_BK1_VRHA_SET); st7701 163 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2_BK1_VCOM, DSI_CMD2_BK1_VCOM_SET); st7701 164 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2_BK1_VGHSS, DSI_CMD2_BK1_VGHSS_SET); st7701 165 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2_BK1_TESTCMD, DSI_CMD2_BK1_TESTCMD_VAL); st7701 166 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2_BK1_VGLS, DSI_CMD2_BK1_VGLS_SET); st7701 167 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2_BK1_PWCTLR1, DSI_CMD2_BK1_PWCTLR1_SET); st7701 168 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2_BK1_PWCTLR2, DSI_CMD2_BK1_PWCTLR2_SET); st7701 169 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2_BK1_SPD1, DSI_CMD2_BK1_SPD1_SET); st7701 170 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2_BK1_SPD2, DSI_CMD2_BK1_SPD2_SET); st7701 171 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2_BK1_MIPISET1, DSI_CMD2_BK1_MIPISET1_SET); st7701 177 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, 0xE0, 0x00, 0x00, 0x02); st7701 178 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, 0xE1, 0x0B, 0x00, 0x0D, 0x00, 0x0C, 0x00, 0x0E, st7701 180 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, 0xE2, 0x33, 0x33, 0x44, 0x44, 0x64, 0x00, 0x66, st7701 182 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, 0xE3, 0x00, 0x00, 0x33, 0x33); st7701 183 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, 0xE4, 0x44, 0x44); st7701 184 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, 0xE5, 0x0C, 0x78, 0x3C, 0xA0, 0x0E, 0x78, 0x3C, st7701 186 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, 0xE6, 0x00, 0x00, 0x33, 0x33); st7701 187 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, 0xE7, 0x44, 0x44); st7701 188 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, 0xE8, 0x0D, 0x78, 0x3C, 0xA0, 0x0F, 0x78, 0x3C, st7701 190 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, 0xEB, 0x02, 0x02, 0x39, 0x39, 0xEE, 0x44, 0x00); st7701 191 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, 0xEC, 0x00, 0x00); st7701 192 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, 0xED, 0xFF, 0xF1, 0x04, 0x56, 0x72, 0x3F, 0xFF, st7701 196 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, DSI_CMD2BKX_SEL, st7701 202 drivers/gpu/drm/panel/panel-sitronix-st7701.c struct st7701 *st7701 = panel_to_st7701(panel); st7701 205 drivers/gpu/drm/panel/panel-sitronix-st7701.c gpiod_set_value(st7701->reset, 0); st7701 207 drivers/gpu/drm/panel/panel-sitronix-st7701.c ret = regulator_bulk_enable(st7701->desc->num_supplies, st7701 208 drivers/gpu/drm/panel/panel-sitronix-st7701.c st7701->supplies); st7701 213 drivers/gpu/drm/panel/panel-sitronix-st7701.c gpiod_set_value(st7701->reset, 1); st7701 216 drivers/gpu/drm/panel/panel-sitronix-st7701.c st7701_init_sequence(st7701); st7701 223 drivers/gpu/drm/panel/panel-sitronix-st7701.c struct st7701 *st7701 = panel_to_st7701(panel); st7701 225 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, MIPI_DCS_SET_DISPLAY_ON, 0x00); st7701 226 drivers/gpu/drm/panel/panel-sitronix-st7701.c backlight_enable(st7701->backlight); st7701 233 drivers/gpu/drm/panel/panel-sitronix-st7701.c struct st7701 *st7701 = panel_to_st7701(panel); st7701 235 drivers/gpu/drm/panel/panel-sitronix-st7701.c backlight_disable(st7701->backlight); st7701 236 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, MIPI_DCS_SET_DISPLAY_OFF, 0x00); st7701 243 drivers/gpu/drm/panel/panel-sitronix-st7701.c struct st7701 *st7701 = panel_to_st7701(panel); st7701 245 drivers/gpu/drm/panel/panel-sitronix-st7701.c ST7701_DSI(st7701, MIPI_DCS_ENTER_SLEEP_MODE, 0x00); st7701 247 drivers/gpu/drm/panel/panel-sitronix-st7701.c msleep(st7701->sleep_delay); st7701 249 drivers/gpu/drm/panel/panel-sitronix-st7701.c gpiod_set_value(st7701->reset, 0); st7701 260 drivers/gpu/drm/panel/panel-sitronix-st7701.c msleep(st7701->sleep_delay); st7701 262 drivers/gpu/drm/panel/panel-sitronix-st7701.c regulator_bulk_disable(st7701->desc->num_supplies, st7701->supplies); st7701 269 drivers/gpu/drm/panel/panel-sitronix-st7701.c struct st7701 *st7701 = panel_to_st7701(panel); st7701 270 drivers/gpu/drm/panel/panel-sitronix-st7701.c const struct drm_display_mode *desc_mode = st7701->desc->mode; st7701 275 drivers/gpu/drm/panel/panel-sitronix-st7701.c DRM_DEV_ERROR(&st7701->dsi->dev, st7701 336 drivers/gpu/drm/panel/panel-sitronix-st7701.c struct st7701 *st7701; st7701 339 drivers/gpu/drm/panel/panel-sitronix-st7701.c st7701 = devm_kzalloc(&dsi->dev, sizeof(*st7701), GFP_KERNEL); st7701 340 drivers/gpu/drm/panel/panel-sitronix-st7701.c if (!st7701) st7701 348 drivers/gpu/drm/panel/panel-sitronix-st7701.c st7701->supplies = devm_kcalloc(&dsi->dev, desc->num_supplies, st7701 349 drivers/gpu/drm/panel/panel-sitronix-st7701.c sizeof(*st7701->supplies), st7701 351 drivers/gpu/drm/panel/panel-sitronix-st7701.c if (!st7701->supplies) st7701 355 drivers/gpu/drm/panel/panel-sitronix-st7701.c st7701->supplies[i].supply = desc->supply_names[i]; st7701 358 drivers/gpu/drm/panel/panel-sitronix-st7701.c st7701->supplies); st7701 362 drivers/gpu/drm/panel/panel-sitronix-st7701.c st7701->reset = devm_gpiod_get(&dsi->dev, "reset", GPIOD_OUT_LOW); st7701 363 drivers/gpu/drm/panel/panel-sitronix-st7701.c if (IS_ERR(st7701->reset)) { st7701 365 drivers/gpu/drm/panel/panel-sitronix-st7701.c return PTR_ERR(st7701->reset); st7701 368 drivers/gpu/drm/panel/panel-sitronix-st7701.c st7701->backlight = devm_of_find_backlight(&dsi->dev); st7701 369 drivers/gpu/drm/panel/panel-sitronix-st7701.c if (IS_ERR(st7701->backlight)) st7701 370 drivers/gpu/drm/panel/panel-sitronix-st7701.c return PTR_ERR(st7701->backlight); st7701 372 drivers/gpu/drm/panel/panel-sitronix-st7701.c drm_panel_init(&st7701->panel); st7701 383 drivers/gpu/drm/panel/panel-sitronix-st7701.c st7701->sleep_delay = 120 + desc->panel_sleep_delay; st7701 384 drivers/gpu/drm/panel/panel-sitronix-st7701.c st7701->panel.funcs = &st7701_funcs; st7701 385 drivers/gpu/drm/panel/panel-sitronix-st7701.c st7701->panel.dev = &dsi->dev; st7701 387 drivers/gpu/drm/panel/panel-sitronix-st7701.c ret = drm_panel_add(&st7701->panel); st7701 391 drivers/gpu/drm/panel/panel-sitronix-st7701.c mipi_dsi_set_drvdata(dsi, st7701); st7701 392 drivers/gpu/drm/panel/panel-sitronix-st7701.c st7701->dsi = dsi; st7701 393 drivers/gpu/drm/panel/panel-sitronix-st7701.c st7701->desc = desc; st7701 400 drivers/gpu/drm/panel/panel-sitronix-st7701.c struct st7701 *st7701 = mipi_dsi_get_drvdata(dsi); st7701 403 drivers/gpu/drm/panel/panel-sitronix-st7701.c drm_panel_remove(&st7701->panel);