Lines Matching refs:max96755f

34 static bool max96755f_vid_sync_detected(struct max96755f *max96755f)  in max96755f_vid_sync_detected()  argument
38 if (regmap_read(max96755f->regmap, 0x55d, &det)) in max96755f_vid_sync_detected()
76 struct max96755f *max96755f = dev_get_drvdata(muxc->dev); in max96755f_select() local
80 regmap_update_bits(max96755f->regmap, 0x0001, DIS_REM_CC, in max96755f_select()
83 if (!max96755f->split_mode) in max96755f_select()
86 regmap_read(max96755f->regmap, 0x0010, &link_cfg); in max96755f_select()
91 regmap_update_bits(max96755f->regmap, 0x0010, in max96755f_select()
97 regmap_update_bits(max96755f->regmap, 0x0010, in max96755f_select()
104 ret = regmap_read_poll_timeout(max96755f->regmap, 0x0013, val, in max96755f_select()
108 dev_err(max96755f->dev, "GMSL2 link lock timeout\n"); in max96755f_select()
117 struct max96755f *max96755f = dev_get_drvdata(muxc->dev); in max96755f_deselect() local
119 regmap_update_bits(max96755f->regmap, 0x0001, DIS_REM_CC, in max96755f_deselect()
127 struct max96755f *max96755f = data; in max96755f_power_off() local
129 if (max96755f->reset_gpio) in max96755f_power_off()
130 gpiod_direction_output(max96755f->reset_gpio, 1); in max96755f_power_off()
132 if (max96755f->enable_gpio) in max96755f_power_off()
133 gpiod_direction_output(max96755f->enable_gpio, 0); in max96755f_power_off()
135 if (max96755f->supply) in max96755f_power_off()
136 regulator_disable(max96755f->supply); in max96755f_power_off()
139 static int max96755f_power_on(struct max96755f *max96755f) in max96755f_power_on() argument
143 if (max96755f_vid_sync_detected(max96755f)) { in max96755f_power_on()
144 extcon_set_state(max96755f->extcon, EXTCON_JACK_VIDEO_OUT, true); in max96755f_power_on()
148 if (max96755f->supply) { in max96755f_power_on()
149 ret = regulator_enable(max96755f->supply); in max96755f_power_on()
154 if (max96755f->enable_gpio) { in max96755f_power_on()
155 gpiod_direction_output(max96755f->enable_gpio, 1); in max96755f_power_on()
159 if (max96755f->reset_gpio) { in max96755f_power_on()
160 gpiod_direction_output(max96755f->reset_gpio, 0); in max96755f_power_on()
162 gpiod_direction_output(max96755f->reset_gpio, 1); in max96755f_power_on()
164 gpiod_direction_output(max96755f->reset_gpio, 0); in max96755f_power_on()
168 regmap_update_bits(max96755f->regmap, 0x0001, DIS_REM_CC, in max96755f_power_on()
177 struct max96755f *max96755f = dev_get_drvdata(device); in line_fault_monitor_show() local
180 regmap_read(max96755f->regmap, 0x0005, &pu_lf); in line_fault_monitor_show()
191 regmap_read(max96755f->regmap, 0x0026, &lf); in line_fault_monitor_show()
212 struct max96755f *max96755f = dev_get_drvdata(dev); in patgen_mode_store() local
220 regmap_update_bits(max96755f->regmap, 0x01e5, PATGEN_MODE, in patgen_mode_store()
237 static int max96755f_sysfs_add(struct max96755f *max96755f) in max96755f_sysfs_add() argument
239 struct device *dev = max96755f->dev; in max96755f_sysfs_add()
245 regmap_update_bits(max96755f->regmap, 0x0005, in max96755f_sysfs_add()
261 struct max96755f *max96755f; in max96755f_i2c_probe() local
273 max96755f = devm_kzalloc(dev, sizeof(*max96755f), GFP_KERNEL); in max96755f_i2c_probe()
274 if (!max96755f) in max96755f_i2c_probe()
279 max96755f->muxc = i2c_mux_alloc(client->adapter, dev, nr, 0, in max96755f_i2c_probe()
282 if (!max96755f->muxc) in max96755f_i2c_probe()
286 max96755f->split_mode = true; in max96755f_i2c_probe()
288 max96755f->dev = dev; in max96755f_i2c_probe()
289 i2c_set_clientdata(client, max96755f); in max96755f_i2c_probe()
291 max96755f->supply = devm_regulator_get(dev, "power"); in max96755f_i2c_probe()
292 if (IS_ERR(max96755f->supply)) in max96755f_i2c_probe()
293 return dev_err_probe(dev, PTR_ERR(max96755f->supply), in max96755f_i2c_probe()
296 max96755f->lock_gpio = devm_gpiod_get_optional(dev, "lock", GPIOD_IN); in max96755f_i2c_probe()
297 if (IS_ERR(max96755f->lock_gpio)) in max96755f_i2c_probe()
298 return dev_err_probe(dev, PTR_ERR(max96755f->lock_gpio), in max96755f_i2c_probe()
301 max96755f->enable_gpio = devm_gpiod_get_optional(dev, "enable", GPIOD_ASIS); in max96755f_i2c_probe()
302 if (IS_ERR(max96755f->enable_gpio)) { in max96755f_i2c_probe()
303 return dev_err_probe(dev, PTR_ERR(max96755f->enable_gpio), in max96755f_i2c_probe()
307 max96755f->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_ASIS); in max96755f_i2c_probe()
308 if (IS_ERR(max96755f->reset_gpio)) in max96755f_i2c_probe()
309 return dev_err_probe(dev, PTR_ERR(max96755f->reset_gpio), in max96755f_i2c_probe()
312 max96755f->regmap = devm_regmap_init_i2c(client, &max96755f_regmap_config); in max96755f_i2c_probe()
313 if (IS_ERR(max96755f->regmap)) in max96755f_i2c_probe()
314 return dev_err_probe(dev, PTR_ERR(max96755f->regmap), in max96755f_i2c_probe()
317 max96755f->extcon = devm_extcon_dev_allocate(dev, max96755f_cable); in max96755f_i2c_probe()
318 if (IS_ERR(max96755f->extcon)) in max96755f_i2c_probe()
319 return dev_err_probe(dev, PTR_ERR(max96755f->extcon), in max96755f_i2c_probe()
322 ret = devm_extcon_dev_register(dev, max96755f->extcon); in max96755f_i2c_probe()
327 ret = max96755f_power_on(max96755f); in max96755f_i2c_probe()
331 ret = devm_add_action_or_reset(dev, max96755f_power_off, max96755f); in max96755f_i2c_probe()
344 ret = i2c_mux_add_adapter(max96755f->muxc, 0, nr, 0); in max96755f_i2c_probe()
346 i2c_mux_del_adapters(max96755f->muxc); in max96755f_i2c_probe()
351 ret = max96755f_sysfs_add(max96755f); in max96755f_i2c_probe()
360 struct max96755f *max96755f = i2c_get_clientdata(client); in max96755f_i2c_remove() local
362 i2c_mux_del_adapters(max96755f->muxc); in max96755f_i2c_remove()
369 struct max96755f *max96755f = i2c_get_clientdata(client); in max96755f_i2c_shutdown() local
371 max96755f_power_off(max96755f); in max96755f_i2c_shutdown()
376 struct max96755f *max96755f = dev_get_drvdata(dev); in max96755f_suspend() local
378 regcache_mark_dirty(max96755f->regmap); in max96755f_suspend()
379 regcache_cache_only(max96755f->regmap, true); in max96755f_suspend()
386 struct max96755f *max96755f = dev_get_drvdata(dev); in max96755f_resume() local
388 regcache_cache_only(max96755f->regmap, false); in max96755f_resume()
389 regcache_sync(max96755f->regmap); in max96755f_resume()