Lines Matching refs:err

101 	int err;  in anx6345_dp_link_training()  local
103 err = anx6345_clear_bits(anx6345->map[I2C_IDX_TXCOM], in anx6345_dp_link_training()
106 if (err) in anx6345_dp_link_training()
107 return err; in anx6345_dp_link_training()
109 err = drm_dp_dpcd_readb(&anx6345->aux, DP_MAX_LINK_RATE, &dp_bw); in anx6345_dp_link_training()
110 if (err < 0) in anx6345_dp_link_training()
111 return err; in anx6345_dp_link_training()
123 err = anx6345_set_bits(anx6345->map[I2C_IDX_TXCOM], SP_VID_CTRL1_REG, in anx6345_dp_link_training()
125 if (err) in anx6345_dp_link_training()
126 return err; in anx6345_dp_link_training()
128 err = anx6345_clear_bits(anx6345->map[I2C_IDX_TXCOM], in anx6345_dp_link_training()
130 if (err) in anx6345_dp_link_training()
131 return err; in anx6345_dp_link_training()
134 err = drm_dp_dpcd_read(&anx6345->aux, DP_DPCD_REV, in anx6345_dp_link_training()
136 if (err < 0) { in anx6345_dp_link_training()
137 DRM_ERROR("Failed to read DPCD: %d\n", err); in anx6345_dp_link_training()
138 return err; in anx6345_dp_link_training()
142 err = anx6345_clear_bits(anx6345->map[I2C_IDX_DPTX], in anx6345_dp_link_training()
144 if (err) in anx6345_dp_link_training()
145 return err; in anx6345_dp_link_training()
152 err = drm_dp_dpcd_readb(&anx6345->aux, DP_SET_POWER, &dpcd[0]); in anx6345_dp_link_training()
153 if (err < 0) { in anx6345_dp_link_training()
155 err); in anx6345_dp_link_training()
156 return err; in anx6345_dp_link_training()
162 err = drm_dp_dpcd_writeb(&anx6345->aux, DP_SET_POWER, dpcd[0]); in anx6345_dp_link_training()
163 if (err < 0) { in anx6345_dp_link_training()
165 err); in anx6345_dp_link_training()
166 return err; in anx6345_dp_link_training()
178 err = regmap_write(anx6345->map[I2C_IDX_DPTX], in anx6345_dp_link_training()
180 if (err) in anx6345_dp_link_training()
181 return err; in anx6345_dp_link_training()
186 err = regmap_write(anx6345->map[I2C_IDX_DPTX], in anx6345_dp_link_training()
188 if (err) in anx6345_dp_link_training()
189 return err; in anx6345_dp_link_training()
191 err = drm_dp_dpcd_writeb(&anx6345->aux, DP_DOWNSPREAD_CTRL, in anx6345_dp_link_training()
193 if (err < 0) in anx6345_dp_link_training()
194 return err; in anx6345_dp_link_training()
196 err = drm_dp_dpcd_writeb(&anx6345->aux, DP_DOWNSPREAD_CTRL, 0); in anx6345_dp_link_training()
197 if (err < 0) in anx6345_dp_link_training()
198 return err; in anx6345_dp_link_training()
203 err = anx6345_set_bits(anx6345->map[I2C_IDX_DPTX], in anx6345_dp_link_training()
207 err = anx6345_clear_bits(anx6345->map[I2C_IDX_DPTX], in anx6345_dp_link_training()
210 if (err) in anx6345_dp_link_training()
211 return err; in anx6345_dp_link_training()
214 err = regmap_write(anx6345->map[I2C_IDX_DPTX], in anx6345_dp_link_training()
216 if (err) in anx6345_dp_link_training()
217 return err; in anx6345_dp_link_training()
221 err = regmap_write(anx6345->map[I2C_IDX_DPTX], in anx6345_dp_link_training()
223 if (err) in anx6345_dp_link_training()
224 return err; in anx6345_dp_link_training()
229 err = drm_dp_dpcd_write(&anx6345->aux, DP_LINK_BW_SET, dpcd, in anx6345_dp_link_training()
232 if (err < 0) { in anx6345_dp_link_training()
233 DRM_ERROR("Failed to configure link: %d\n", err); in anx6345_dp_link_training()
234 return err; in anx6345_dp_link_training()
238 err = regmap_write(anx6345->map[I2C_IDX_DPTX], SP_DP_LT_CTRL_REG, in anx6345_dp_link_training()
240 if (err) in anx6345_dp_link_training()
241 return err; in anx6345_dp_link_training()
251 int err, i; in anx6345_tx_initialization() local
254 err = regmap_write(anx6345->map[I2C_IDX_TXCOM], SP_VID_CTRL2_REG, in anx6345_tx_initialization()
256 if (err) in anx6345_tx_initialization()
257 return err; in anx6345_tx_initialization()
259 err = regmap_write(anx6345->map[I2C_IDX_DPTX], SP_DP_PLL_CTRL_REG, 0); in anx6345_tx_initialization()
260 if (err) in anx6345_tx_initialization()
261 return err; in anx6345_tx_initialization()
263 err = regmap_write(anx6345->map[I2C_IDX_TXCOM], in anx6345_tx_initialization()
265 if (err) in anx6345_tx_initialization()
266 return err; in anx6345_tx_initialization()
268 err = regmap_write(anx6345->map[I2C_IDX_DPTX], in anx6345_tx_initialization()
271 if (err) in anx6345_tx_initialization()
272 return err; in anx6345_tx_initialization()
274 err = regmap_write(anx6345->map[I2C_IDX_DPTX], in anx6345_tx_initialization()
276 if (err) in anx6345_tx_initialization()
277 return err; in anx6345_tx_initialization()
280 err = anx6345_set_bits(anx6345->map[I2C_IDX_DPTX], in anx6345_tx_initialization()
283 if (err) in anx6345_tx_initialization()
284 return err; in anx6345_tx_initialization()
288 err = regmap_write(anx6345->map[I2C_IDX_DPTX], in anx6345_tx_initialization()
290 if (err) in anx6345_tx_initialization()
291 return err; in anx6345_tx_initialization()
295 err = anx6345_set_bits(anx6345->map[I2C_IDX_TXCOM], in anx6345_tx_initialization()
297 if (err) in anx6345_tx_initialization()
298 return err; in anx6345_tx_initialization()
306 int err; in anx6345_poweron() local
312 err = regulator_enable(anx6345->dvdd12); in anx6345_poweron()
313 if (err) { in anx6345_poweron()
315 err); in anx6345_poweron()
322 err = regulator_enable(anx6345->dvdd25); in anx6345_poweron()
323 if (err) { in anx6345_poweron()
325 err); in anx6345_poweron()
350 int err; in anx6345_poweroff() local
358 err = regulator_disable(anx6345->dvdd25); in anx6345_poweroff()
359 if (err) { in anx6345_poweroff()
361 err); in anx6345_poweroff()
367 err = regulator_disable(anx6345->dvdd12); in anx6345_poweroff()
368 if (err) { in anx6345_poweroff()
370 err); in anx6345_poweroff()
381 int err; in anx6345_start() local
387 err = anx6345_clear_bits(anx6345->map[I2C_IDX_TXCOM], in anx6345_start()
391 err = anx6345_tx_initialization(anx6345); in anx6345_start()
392 if (err) { in anx6345_start()
393 DRM_ERROR("Failed eDP transmitter initialization: %d\n", err); in anx6345_start()
395 return err; in anx6345_start()
398 err = anx6345_dp_link_training(anx6345); in anx6345_start()
399 if (err) { in anx6345_start()
400 DRM_ERROR("Failed link training: %d\n", err); in anx6345_start()
402 return err; in anx6345_start()
416 int err; in anx6345_config_dp_output() local
418 err = anx6345_clear_bits(anx6345->map[I2C_IDX_TXCOM], SP_VID_CTRL1_REG, in anx6345_config_dp_output()
420 if (err) in anx6345_config_dp_output()
421 return err; in anx6345_config_dp_output()
424 err = anx6345_set_bits(anx6345->map[I2C_IDX_TXCOM], SP_VID_CTRL1_REG, in anx6345_config_dp_output()
426 if (err) in anx6345_config_dp_output()
427 return err; in anx6345_config_dp_output()
438 int err; in anx6345_get_downstream_info() local
440 err = drm_dp_dpcd_readb(&anx6345->aux, DP_SINK_COUNT, &value); in anx6345_get_downstream_info()
441 if (err < 0) { in anx6345_get_downstream_info()
442 DRM_ERROR("Get sink count failed %d\n", err); in anx6345_get_downstream_info()
443 return err; in anx6345_get_downstream_info()
457 int err, num_modes = 0; in anx6345_get_modes() local
468 err = anx6345_get_downstream_info(anx6345); in anx6345_get_modes()
469 if (err) { in anx6345_get_modes()
470 DRM_ERROR("Failed to get downstream info: %d\n", err); in anx6345_get_modes()
478 err = drm_connector_update_edid_property(connector, in anx6345_get_modes()
480 if (err) { in anx6345_get_modes()
481 DRM_ERROR("Failed to update EDID property: %d\n", err); in anx6345_get_modes()
525 int err; in anx6345_bridge_attach() local
543 err = drm_dp_aux_register(&anx6345->aux); in anx6345_bridge_attach()
544 if (err < 0) { in anx6345_bridge_attach()
545 DRM_ERROR("Failed to register aux channel: %d\n", err); in anx6345_bridge_attach()
546 return err; in anx6345_bridge_attach()
549 err = drm_connector_init(bridge->dev, &anx6345->connector, in anx6345_bridge_attach()
552 if (err) { in anx6345_bridge_attach()
553 DRM_ERROR("Failed to initialize connector: %d\n", err); in anx6345_bridge_attach()
562 err = drm_connector_attach_encoder(&anx6345->connector, in anx6345_bridge_attach()
564 if (err) { in anx6345_bridge_attach()
565 DRM_ERROR("Failed to link up connector to encoder: %d\n", err); in anx6345_bridge_attach()
569 err = drm_connector_register(&anx6345->connector); in anx6345_bridge_attach()
570 if (err) { in anx6345_bridge_attach()
571 DRM_ERROR("Failed to register connector: %d\n", err); in anx6345_bridge_attach()
580 return err; in anx6345_bridge_attach()
620 int err; in anx6345_bridge_enable() local
625 err = anx6345_start(anx6345); in anx6345_bridge_enable()
626 if (err) { in anx6345_bridge_enable()
627 DRM_ERROR("Failed to initialize: %d\n", err); in anx6345_bridge_enable()
631 err = anx6345_config_dp_output(anx6345); in anx6345_bridge_enable()
632 if (err) in anx6345_bridge_enable()
633 DRM_ERROR("Failed to enable DP output: %d\n", err); in anx6345_bridge_enable()
700 int i, err; in anx6345_i2c_probe() local
715 err = drm_of_find_panel_or_bridge(client->dev.of_node, 1, 0, in anx6345_i2c_probe()
717 if (err == -EPROBE_DEFER) in anx6345_i2c_probe()
718 return err; in anx6345_i2c_probe()
720 if (err) in anx6345_i2c_probe()
757 err = PTR_ERR(anx6345->i2c_clients[i]); in anx6345_i2c_probe()
766 err = PTR_ERR(anx6345->map[i]); in anx6345_i2c_probe()
782 err = -ENODEV; in anx6345_i2c_probe()
787 return err; in anx6345_i2c_probe()