Lines Matching +full:6 +full:- +full:inch

1 // SPDX-License-Identifier: GPL-2.0-only
3 * MIPI-DSI based s6e8aa0 AMOLED LCD 5.3 inch panel driver.
37 #define PANELCTL_GTCON_110 (6 << 2)
62 #define PANELCTL_EM_CLK1_110 (6 << 3)
65 #define PANELCTL_EM_CLK1B_110 (6 << 0)
69 #define PANELCTL_EM_CLK2_110 (6 << 3)
72 #define PANELCTL_EM_CLK2B_110 (6 << 0)
130 int ret = ctx->error; in s6e8aa0_clear_error()
132 ctx->error = 0; in s6e8aa0_clear_error()
138 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in s6e8aa0_dcs_write()
141 if (ctx->error < 0) in s6e8aa0_dcs_write()
146 dev_err(ctx->dev, "error %zd writing dcs seq: %*ph\n", ret, in s6e8aa0_dcs_write()
148 ctx->error = ret; in s6e8aa0_dcs_write()
154 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in s6e8aa0_dcs_read()
157 if (ctx->error < 0) in s6e8aa0_dcs_read()
158 return ctx->error; in s6e8aa0_dcs_read()
162 dev_err(ctx->dev, "error %d reading dcs seq(%#x)\n", ret, cmd); in s6e8aa0_dcs_read()
163 ctx->error = ret; in s6e8aa0_dcs_read()
192 u8 aid = aids[ctx->id >> 5]; in s6e8aa0_panel_cond_set_v142()
201 if (ctx->flip_vertical) { in s6e8aa0_panel_cond_set_v142()
207 if (ctx->flip_horizontal) { in s6e8aa0_panel_cond_set_v142()
213 if (ctx->flip_horizontal || ctx->flip_vertical) { in s6e8aa0_panel_cond_set_v142()
260 if (ctx->version < 142) in s6e8aa0_panel_cond_set()
292 if (ctx->version < 142) in s6e8aa0_etc_pentile_control()
308 if (ctx->version < 142) in s6e8aa0_etc_power_control()
316 u8 id = ctx->id ? 0 : 0x95; in s6e8aa0_etc_elvss_control()
325 switch (ctx->brightness) { in s6e8aa0_elvss_nvm_set_v142()
326 case 0 ... 6: /* 30cd ~ 100cd */ in s6e8aa0_elvss_nvm_set_v142()
347 if (ctx->version < 142) in s6e8aa0_elvss_nvm_set()
768 if (ctx->error) in s6e8aa0_brightness_set()
771 gamma = ctx->variant->gamma_tables[ctx->brightness]; in s6e8aa0_brightness_set()
773 if (ctx->version >= 142) in s6e8aa0_brightness_set()
799 msleep(ctx->init_delay); in s6e8aa0_panel_init()
805 struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev); in s6e8aa0_set_maximum_return_packet_size()
808 if (ctx->error < 0) in s6e8aa0_set_maximum_return_packet_size()
813 dev_err(ctx->dev, in s6e8aa0_set_maximum_return_packet_size()
816 ctx->error = ret; in s6e8aa0_set_maximum_return_packet_size()
827 dev_err(ctx->dev, "read id failed\n"); in s6e8aa0_read_mtp_id()
828 ctx->error = -EIO; in s6e8aa0_read_mtp_id()
832 dev_info(ctx->dev, "ID: 0x%2x, 0x%2x, 0x%2x\n", id[0], id[1], id[2]); in s6e8aa0_read_mtp_id()
839 dev_err(ctx->dev, "unsupported display version %d\n", id[1]); in s6e8aa0_read_mtp_id()
840 ctx->error = -EINVAL; in s6e8aa0_read_mtp_id()
844 ctx->variant = &s6e8aa0_variants[i]; in s6e8aa0_read_mtp_id()
845 ctx->version = id[1]; in s6e8aa0_read_mtp_id()
846 ctx->id = id[2]; in s6e8aa0_read_mtp_id()
861 ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies); in s6e8aa0_power_on()
865 msleep(ctx->power_on_delay); in s6e8aa0_power_on()
867 gpiod_set_value(ctx->reset_gpio, 0); in s6e8aa0_power_on()
869 gpiod_set_value(ctx->reset_gpio, 1); in s6e8aa0_power_on()
871 msleep(ctx->reset_delay); in s6e8aa0_power_on()
878 return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies); in s6e8aa0_power_off()
909 ret = ctx->error; in s6e8aa0_prepare()
928 mode = drm_mode_create(connector->dev); in s6e8aa0_get_modes()
930 dev_err(panel->dev, "failed to create a new display mode\n"); in s6e8aa0_get_modes()
934 drm_display_mode_from_videomode(&ctx->vm, mode); in s6e8aa0_get_modes()
935 mode->width_mm = ctx->width_mm; in s6e8aa0_get_modes()
936 mode->height_mm = ctx->height_mm; in s6e8aa0_get_modes()
937 connector->display_info.width_mm = mode->width_mm; in s6e8aa0_get_modes()
938 connector->display_info.height_mm = mode->height_mm; in s6e8aa0_get_modes()
940 mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; in s6e8aa0_get_modes()
956 struct device *dev = ctx->dev; in s6e8aa0_parse_dt()
957 struct device_node *np = dev->of_node; in s6e8aa0_parse_dt()
960 ret = of_get_videomode(np, &ctx->vm, 0); in s6e8aa0_parse_dt()
964 of_property_read_u32(np, "power-on-delay", &ctx->power_on_delay); in s6e8aa0_parse_dt()
965 of_property_read_u32(np, "reset-delay", &ctx->reset_delay); in s6e8aa0_parse_dt()
966 of_property_read_u32(np, "init-delay", &ctx->init_delay); in s6e8aa0_parse_dt()
967 of_property_read_u32(np, "panel-width-mm", &ctx->width_mm); in s6e8aa0_parse_dt()
968 of_property_read_u32(np, "panel-height-mm", &ctx->height_mm); in s6e8aa0_parse_dt()
970 ctx->flip_horizontal = of_property_read_bool(np, "flip-horizontal"); in s6e8aa0_parse_dt()
971 ctx->flip_vertical = of_property_read_bool(np, "flip-vertical"); in s6e8aa0_parse_dt()
978 struct device *dev = &dsi->dev; in s6e8aa0_probe()
984 return -ENOMEM; in s6e8aa0_probe()
988 ctx->dev = dev; in s6e8aa0_probe()
990 dsi->lanes = 4; in s6e8aa0_probe()
991 dsi->format = MIPI_DSI_FMT_RGB888; in s6e8aa0_probe()
992 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST in s6e8aa0_probe()
999 ctx->supplies[0].supply = "vdd3"; in s6e8aa0_probe()
1000 ctx->supplies[1].supply = "vci"; in s6e8aa0_probe()
1001 ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ctx->supplies), in s6e8aa0_probe()
1002 ctx->supplies); in s6e8aa0_probe()
1008 ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in s6e8aa0_probe()
1009 if (IS_ERR(ctx->reset_gpio)) { in s6e8aa0_probe()
1010 dev_err(dev, "cannot get reset-gpios %ld\n", in s6e8aa0_probe()
1011 PTR_ERR(ctx->reset_gpio)); in s6e8aa0_probe()
1012 return PTR_ERR(ctx->reset_gpio); in s6e8aa0_probe()
1015 ctx->brightness = GAMMA_LEVEL_NUM - 1; in s6e8aa0_probe()
1017 drm_panel_init(&ctx->panel, dev, &s6e8aa0_drm_funcs, in s6e8aa0_probe()
1019 ctx->panel.prepare_prev_first = true; in s6e8aa0_probe()
1021 drm_panel_add(&ctx->panel); in s6e8aa0_probe()
1025 drm_panel_remove(&ctx->panel); in s6e8aa0_probe()
1035 drm_panel_remove(&ctx->panel); in s6e8aa0_remove()
1048 .name = "panel-samsung-s6e8aa0",
1060 MODULE_DESCRIPTION("MIPI-DSI based s6e8aa0 AMOLED LCD Panel Driver");