Lines Matching refs:err
100 int err; in anx6345_dp_link_training() local
102 err = anx6345_clear_bits(anx6345->map[I2C_IDX_TXCOM], in anx6345_dp_link_training()
105 if (err) in anx6345_dp_link_training()
106 return err; in anx6345_dp_link_training()
108 err = drm_dp_dpcd_readb(&anx6345->aux, DP_MAX_LINK_RATE, &dp_bw); in anx6345_dp_link_training()
109 if (err < 0) in anx6345_dp_link_training()
110 return err; in anx6345_dp_link_training()
122 err = anx6345_set_bits(anx6345->map[I2C_IDX_TXCOM], SP_VID_CTRL1_REG, in anx6345_dp_link_training()
124 if (err) in anx6345_dp_link_training()
125 return err; in anx6345_dp_link_training()
127 err = anx6345_clear_bits(anx6345->map[I2C_IDX_TXCOM], in anx6345_dp_link_training()
129 if (err) in anx6345_dp_link_training()
130 return err; in anx6345_dp_link_training()
133 err = drm_dp_dpcd_read(&anx6345->aux, DP_DPCD_REV, in anx6345_dp_link_training()
135 if (err < 0) { in anx6345_dp_link_training()
136 DRM_ERROR("Failed to read DPCD: %d\n", err); in anx6345_dp_link_training()
137 return err; in anx6345_dp_link_training()
141 err = anx6345_clear_bits(anx6345->map[I2C_IDX_DPTX], in anx6345_dp_link_training()
143 if (err) in anx6345_dp_link_training()
144 return err; in anx6345_dp_link_training()
151 err = drm_dp_dpcd_readb(&anx6345->aux, DP_SET_POWER, &dpcd[0]); in anx6345_dp_link_training()
152 if (err < 0) { in anx6345_dp_link_training()
154 err); in anx6345_dp_link_training()
155 return err; in anx6345_dp_link_training()
161 err = drm_dp_dpcd_writeb(&anx6345->aux, DP_SET_POWER, dpcd[0]); in anx6345_dp_link_training()
162 if (err < 0) { in anx6345_dp_link_training()
164 err); in anx6345_dp_link_training()
165 return err; in anx6345_dp_link_training()
177 err = regmap_write(anx6345->map[I2C_IDX_DPTX], in anx6345_dp_link_training()
179 if (err) in anx6345_dp_link_training()
180 return err; in anx6345_dp_link_training()
185 err = regmap_write(anx6345->map[I2C_IDX_DPTX], in anx6345_dp_link_training()
187 if (err) in anx6345_dp_link_training()
188 return err; in anx6345_dp_link_training()
190 err = drm_dp_dpcd_writeb(&anx6345->aux, DP_DOWNSPREAD_CTRL, in anx6345_dp_link_training()
192 if (err < 0) in anx6345_dp_link_training()
193 return err; in anx6345_dp_link_training()
195 err = drm_dp_dpcd_writeb(&anx6345->aux, DP_DOWNSPREAD_CTRL, 0); in anx6345_dp_link_training()
196 if (err < 0) in anx6345_dp_link_training()
197 return err; in anx6345_dp_link_training()
202 err = anx6345_set_bits(anx6345->map[I2C_IDX_DPTX], in anx6345_dp_link_training()
206 err = anx6345_clear_bits(anx6345->map[I2C_IDX_DPTX], in anx6345_dp_link_training()
209 if (err) in anx6345_dp_link_training()
210 return err; in anx6345_dp_link_training()
213 err = regmap_write(anx6345->map[I2C_IDX_DPTX], in anx6345_dp_link_training()
215 if (err) in anx6345_dp_link_training()
216 return err; in anx6345_dp_link_training()
220 err = regmap_write(anx6345->map[I2C_IDX_DPTX], in anx6345_dp_link_training()
222 if (err) in anx6345_dp_link_training()
223 return err; in anx6345_dp_link_training()
228 err = drm_dp_dpcd_write(&anx6345->aux, DP_LINK_BW_SET, dpcd, in anx6345_dp_link_training()
231 if (err < 0) { in anx6345_dp_link_training()
232 DRM_ERROR("Failed to configure link: %d\n", err); in anx6345_dp_link_training()
233 return err; in anx6345_dp_link_training()
237 err = regmap_write(anx6345->map[I2C_IDX_DPTX], SP_DP_LT_CTRL_REG, in anx6345_dp_link_training()
239 if (err) in anx6345_dp_link_training()
240 return err; in anx6345_dp_link_training()
250 int err, i; in anx6345_tx_initialization() local
253 err = regmap_write(anx6345->map[I2C_IDX_TXCOM], SP_VID_CTRL2_REG, in anx6345_tx_initialization()
255 if (err) in anx6345_tx_initialization()
256 return err; in anx6345_tx_initialization()
258 err = regmap_write(anx6345->map[I2C_IDX_DPTX], SP_DP_PLL_CTRL_REG, 0); in anx6345_tx_initialization()
259 if (err) in anx6345_tx_initialization()
260 return err; in anx6345_tx_initialization()
262 err = regmap_write(anx6345->map[I2C_IDX_TXCOM], in anx6345_tx_initialization()
264 if (err) in anx6345_tx_initialization()
265 return err; in anx6345_tx_initialization()
267 err = regmap_write(anx6345->map[I2C_IDX_DPTX], in anx6345_tx_initialization()
270 if (err) in anx6345_tx_initialization()
271 return err; in anx6345_tx_initialization()
273 err = regmap_write(anx6345->map[I2C_IDX_DPTX], in anx6345_tx_initialization()
275 if (err) in anx6345_tx_initialization()
276 return err; in anx6345_tx_initialization()
279 err = anx6345_set_bits(anx6345->map[I2C_IDX_DPTX], in anx6345_tx_initialization()
282 if (err) in anx6345_tx_initialization()
283 return err; in anx6345_tx_initialization()
287 err = regmap_write(anx6345->map[I2C_IDX_DPTX], in anx6345_tx_initialization()
289 if (err) in anx6345_tx_initialization()
290 return err; in anx6345_tx_initialization()
294 err = anx6345_set_bits(anx6345->map[I2C_IDX_TXCOM], in anx6345_tx_initialization()
296 if (err) in anx6345_tx_initialization()
297 return err; in anx6345_tx_initialization()
305 int err; in anx6345_poweron() local
311 err = regulator_enable(anx6345->dvdd12); in anx6345_poweron()
312 if (err) { in anx6345_poweron()
314 err); in anx6345_poweron()
321 err = regulator_enable(anx6345->dvdd25); in anx6345_poweron()
322 if (err) { in anx6345_poweron()
324 err); in anx6345_poweron()
349 int err; in anx6345_poweroff() local
357 err = regulator_disable(anx6345->dvdd25); in anx6345_poweroff()
358 if (err) { in anx6345_poweroff()
360 err); in anx6345_poweroff()
366 err = regulator_disable(anx6345->dvdd12); in anx6345_poweroff()
367 if (err) { in anx6345_poweroff()
369 err); in anx6345_poweroff()
380 int err; in anx6345_start() local
386 err = anx6345_clear_bits(anx6345->map[I2C_IDX_TXCOM], in anx6345_start()
390 err = anx6345_tx_initialization(anx6345); in anx6345_start()
391 if (err) { in anx6345_start()
392 DRM_ERROR("Failed eDP transmitter initialization: %d\n", err); in anx6345_start()
394 return err; in anx6345_start()
397 err = anx6345_dp_link_training(anx6345); in anx6345_start()
398 if (err) { in anx6345_start()
399 DRM_ERROR("Failed link training: %d\n", err); in anx6345_start()
401 return err; in anx6345_start()
415 int err; in anx6345_config_dp_output() local
417 err = anx6345_clear_bits(anx6345->map[I2C_IDX_TXCOM], SP_VID_CTRL1_REG, in anx6345_config_dp_output()
419 if (err) in anx6345_config_dp_output()
420 return err; in anx6345_config_dp_output()
423 err = anx6345_set_bits(anx6345->map[I2C_IDX_TXCOM], SP_VID_CTRL1_REG, in anx6345_config_dp_output()
425 if (err) in anx6345_config_dp_output()
426 return err; in anx6345_config_dp_output()
437 int err; in anx6345_get_downstream_info() local
439 err = drm_dp_dpcd_readb(&anx6345->aux, DP_SINK_COUNT, &value); in anx6345_get_downstream_info()
440 if (err < 0) { in anx6345_get_downstream_info()
441 DRM_ERROR("Get sink count failed %d\n", err); in anx6345_get_downstream_info()
442 return err; in anx6345_get_downstream_info()
456 int err, num_modes = 0; in anx6345_get_modes() local
467 err = anx6345_get_downstream_info(anx6345); in anx6345_get_modes()
468 if (err) { in anx6345_get_modes()
469 DRM_ERROR("Failed to get downstream info: %d\n", err); in anx6345_get_modes()
477 err = drm_edid_connector_update(connector, anx6345->drm_edid); in anx6345_get_modes()
478 if (err) { in anx6345_get_modes()
479 DRM_ERROR("Failed to update EDID property: %d\n", err); in anx6345_get_modes()
523 int err; in anx6345_bridge_attach() local
536 err = drm_dp_aux_register(&anx6345->aux); in anx6345_bridge_attach()
537 if (err < 0) { in anx6345_bridge_attach()
538 DRM_ERROR("Failed to register aux channel: %d\n", err); in anx6345_bridge_attach()
539 return err; in anx6345_bridge_attach()
542 err = drm_connector_init(bridge->dev, &anx6345->connector, in anx6345_bridge_attach()
545 if (err) { in anx6345_bridge_attach()
546 DRM_ERROR("Failed to initialize connector: %d\n", err); in anx6345_bridge_attach()
555 err = drm_connector_attach_encoder(&anx6345->connector, in anx6345_bridge_attach()
557 if (err) { in anx6345_bridge_attach()
558 DRM_ERROR("Failed to link up connector to encoder: %d\n", err); in anx6345_bridge_attach()
562 err = drm_connector_register(&anx6345->connector); in anx6345_bridge_attach()
563 if (err) { in anx6345_bridge_attach()
564 DRM_ERROR("Failed to register connector: %d\n", err); in anx6345_bridge_attach()
573 return err; in anx6345_bridge_attach()
613 int err; in anx6345_bridge_enable() local
618 err = anx6345_start(anx6345); in anx6345_bridge_enable()
619 if (err) { in anx6345_bridge_enable()
620 DRM_ERROR("Failed to initialize: %d\n", err); in anx6345_bridge_enable()
624 err = anx6345_config_dp_output(anx6345); in anx6345_bridge_enable()
625 if (err) in anx6345_bridge_enable()
626 DRM_ERROR("Failed to enable DP output: %d\n", err); in anx6345_bridge_enable()
692 int i, err; in anx6345_i2c_probe() local
707 err = drm_of_find_panel_or_bridge(client->dev.of_node, 1, 0, in anx6345_i2c_probe()
709 if (err == -EPROBE_DEFER) in anx6345_i2c_probe()
710 return err; in anx6345_i2c_probe()
712 if (err) in anx6345_i2c_probe()
749 err = PTR_ERR(anx6345->i2c_clients[i]); in anx6345_i2c_probe()
758 err = PTR_ERR(anx6345->map[i]); in anx6345_i2c_probe()
774 err = -ENODEV; in anx6345_i2c_probe()
779 return err; in anx6345_i2c_probe()