Lines Matching refs:adv

27 static void adv7511_dsi_config_timing_gen(struct adv7511 *adv)  in adv7511_dsi_config_timing_gen()  argument
29 struct mipi_dsi_device *dsi = adv->dsi; in adv7511_dsi_config_timing_gen()
30 struct drm_display_mode *mode = &adv->curr_mode; in adv7511_dsi_config_timing_gen()
42 regmap_write(adv->regmap_cec, 0x16, in adv7511_dsi_config_timing_gen()
46 regmap_write(adv->regmap_cec, 0x28, mode->htotal >> 4); in adv7511_dsi_config_timing_gen()
47 regmap_write(adv->regmap_cec, 0x29, (mode->htotal << 4) & 0xff); in adv7511_dsi_config_timing_gen()
48 regmap_write(adv->regmap_cec, 0x2a, hsw >> 4); in adv7511_dsi_config_timing_gen()
49 regmap_write(adv->regmap_cec, 0x2b, (hsw << 4) & 0xff); in adv7511_dsi_config_timing_gen()
50 regmap_write(adv->regmap_cec, 0x2c, hfp >> 4); in adv7511_dsi_config_timing_gen()
51 regmap_write(adv->regmap_cec, 0x2d, (hfp << 4) & 0xff); in adv7511_dsi_config_timing_gen()
52 regmap_write(adv->regmap_cec, 0x2e, hbp >> 4); in adv7511_dsi_config_timing_gen()
53 regmap_write(adv->regmap_cec, 0x2f, (hbp << 4) & 0xff); in adv7511_dsi_config_timing_gen()
56 regmap_write(adv->regmap_cec, 0x30, mode->vtotal >> 4); in adv7511_dsi_config_timing_gen()
57 regmap_write(adv->regmap_cec, 0x31, (mode->vtotal << 4) & 0xff); in adv7511_dsi_config_timing_gen()
58 regmap_write(adv->regmap_cec, 0x32, vsw >> 4); in adv7511_dsi_config_timing_gen()
59 regmap_write(adv->regmap_cec, 0x33, (vsw << 4) & 0xff); in adv7511_dsi_config_timing_gen()
60 regmap_write(adv->regmap_cec, 0x34, vfp >> 4); in adv7511_dsi_config_timing_gen()
61 regmap_write(adv->regmap_cec, 0x35, (vfp << 4) & 0xff); in adv7511_dsi_config_timing_gen()
62 regmap_write(adv->regmap_cec, 0x36, vbp >> 4); in adv7511_dsi_config_timing_gen()
63 regmap_write(adv->regmap_cec, 0x37, (vbp << 4) & 0xff); in adv7511_dsi_config_timing_gen()
66 void adv7533_dsi_power_on(struct adv7511 *adv) in adv7533_dsi_power_on() argument
68 struct mipi_dsi_device *dsi = adv->dsi; in adv7533_dsi_power_on()
70 if (adv->use_timing_gen) in adv7533_dsi_power_on()
71 adv7511_dsi_config_timing_gen(adv); in adv7533_dsi_power_on()
74 regmap_write(adv->regmap_cec, 0x1c, dsi->lanes << 4); in adv7533_dsi_power_on()
76 if (adv->use_timing_gen) { in adv7533_dsi_power_on()
78 regmap_write(adv->regmap_cec, 0x27, 0xcb); in adv7533_dsi_power_on()
79 regmap_write(adv->regmap_cec, 0x27, 0x8b); in adv7533_dsi_power_on()
80 regmap_write(adv->regmap_cec, 0x27, 0xcb); in adv7533_dsi_power_on()
83 regmap_write(adv->regmap_cec, 0x27, 0x0b); in adv7533_dsi_power_on()
87 regmap_write(adv->regmap_cec, 0x03, 0x89); in adv7533_dsi_power_on()
89 regmap_write(adv->regmap_cec, 0x55, 0x00); in adv7533_dsi_power_on()
91 regmap_register_patch(adv->regmap_cec, adv7533_cec_fixed_registers, in adv7533_dsi_power_on()
95 void adv7533_dsi_power_off(struct adv7511 *adv) in adv7533_dsi_power_off() argument
98 regmap_write(adv->regmap_cec, 0x03, 0x0b); in adv7533_dsi_power_off()
100 regmap_write(adv->regmap_cec, 0x27, 0x0b); in adv7533_dsi_power_off()
103 enum drm_mode_status adv7533_mode_valid(struct adv7511 *adv, in adv7533_mode_valid() argument
107 struct mipi_dsi_device *dsi = adv->dsi; in adv7533_mode_valid()
111 if (mode->clock > (adv->type == ADV7533 ? 80000 : 148500)) in adv7533_mode_valid()
115 max_lane_freq = (adv->type == ADV7533 ? 800000 : 891000); in adv7533_mode_valid()
117 if (mode->clock * bpp > max_lane_freq * adv->num_dsi_lanes) in adv7533_mode_valid()
123 int adv7533_patch_registers(struct adv7511 *adv) in adv7533_patch_registers() argument
125 return regmap_register_patch(adv->regmap, in adv7533_patch_registers()
130 int adv7533_patch_cec_registers(struct adv7511 *adv) in adv7533_patch_cec_registers() argument
132 return regmap_register_patch(adv->regmap_cec, in adv7533_patch_cec_registers()
137 int adv7533_attach_dsi(struct adv7511 *adv) in adv7533_attach_dsi() argument
139 struct device *dev = &adv->i2c_main->dev; in adv7533_attach_dsi()
148 host = of_find_mipi_dsi_host_by_node(adv->host_node); in adv7533_attach_dsi()
158 adv->dsi = dsi; in adv7533_attach_dsi()
160 dsi->lanes = adv->num_dsi_lanes; in adv7533_attach_dsi()
172 int adv7533_parse_dt(struct device_node *np, struct adv7511 *adv) in adv7533_parse_dt() argument
181 adv->num_dsi_lanes = num_lanes; in adv7533_parse_dt()
183 adv->host_node = of_graph_get_remote_node(np, 0, 0); in adv7533_parse_dt()
184 if (!adv->host_node) in adv7533_parse_dt()
187 of_node_put(adv->host_node); in adv7533_parse_dt()
189 adv->use_timing_gen = !of_property_read_bool(np, in adv7533_parse_dt()
193 adv->rgb = true; in adv7533_parse_dt()
194 adv->embedded_sync = false; in adv7533_parse_dt()