Lines Matching refs:ser

44 static bool max96745_bridge_link_locked(struct max96745_bridge *ser)  in max96745_bridge_link_locked()  argument
48 if (ser->lock.gpio) in max96745_bridge_link_locked()
49 return gpiod_get_value_cansleep(ser->lock.gpio); in max96745_bridge_link_locked()
51 if (regmap_read(ser->regmap, 0x002a, &val)) in max96745_bridge_link_locked()
63 struct max96745_bridge *ser = to_max96745_bridge(bridge); in max96745_bridge_attach() local
66 ret = drm_of_find_panel_or_bridge(bridge->of_node, 1, -1, &ser->panel, in max96745_bridge_attach()
71 if (max96745_bridge_link_locked(ser)) in max96745_bridge_attach()
72 ser->status = connector_status_connected; in max96745_bridge_attach()
74 ser->status = connector_status_disconnected; in max96745_bridge_attach()
81 struct max96745_bridge *ser = to_max96745_bridge(bridge); in max96745_bridge_pre_enable() local
83 if (ser->panel) in max96745_bridge_pre_enable()
84 drm_panel_prepare(ser->panel); in max96745_bridge_pre_enable()
89 struct max96745_bridge *ser = to_max96745_bridge(bridge); in max96745_bridge_enable() local
90 struct max96745 *max96745 = ser->parent; in max96745_bridge_enable()
95 regmap_read(ser->regmap, 0x0011, &reg); in max96745_bridge_enable()
97 regmap_read(ser->regmap, 0x0028, &reg); in max96745_bridge_enable()
100 regmap_update_bits(ser->regmap, 0x0028, TX_RATE, in max96745_bridge_enable()
102 regmap_update_bits(ser->regmap, 0x0029, RESET_ONESHOT, in max96745_bridge_enable()
104 if (regmap_read_poll_timeout(ser->regmap, 0x002a, reg, in max96745_bridge_enable()
106 dev_err(ser->dev, "%s: GMSL link not locked\n", __func__); in max96745_bridge_enable()
109 if (ser->panel) in max96745_bridge_enable()
110 drm_panel_enable(ser->panel); in max96745_bridge_enable()
117 struct max96745_bridge *ser = to_max96745_bridge(bridge); in max96745_bridge_disable() local
118 struct max96745 *max96745 = ser->parent; in max96745_bridge_disable()
122 if (ser->panel) in max96745_bridge_disable()
123 drm_panel_disable(ser->panel); in max96745_bridge_disable()
128 struct max96745_bridge *ser = to_max96745_bridge(bridge); in max96745_bridge_post_disable() local
132 regmap_read(ser->regmap, 0x002a, &reg); in max96745_bridge_post_disable()
135 if (ser->panel) in max96745_bridge_post_disable()
136 drm_panel_unprepare(ser->panel); in max96745_bridge_post_disable()
138 regmap_read(ser->regmap, 0x0011, &reg); in max96745_bridge_post_disable()
140 regmap_read(ser->regmap, 0x0028, &reg); in max96745_bridge_post_disable()
143 regmap_update_bits(ser->regmap, 0x0028, TX_RATE, in max96745_bridge_post_disable()
145 regmap_update_bits(ser->regmap, 0x0029, RESET_ONESHOT, in max96745_bridge_post_disable()
148 if (regmap_read_poll_timeout(ser->regmap, 0x002a, reg, in max96745_bridge_post_disable()
150 dev_err(ser->dev, "%s: GMSL link not locked\n", __func__); in max96745_bridge_post_disable()
158 struct max96745_bridge *ser = to_max96745_bridge(bridge); in max96745_bridge_detect() local
159 struct max96745 *max96745 = ser->parent; in max96745_bridge_detect()
163 return ser->status; in max96745_bridge_detect()
165 if (!max96745_bridge_link_locked(ser)) { in max96745_bridge_detect()
173 if (atomic_cmpxchg(&ser->lock.triggered, 1, 0)) { in max96745_bridge_detect()
178 if (regmap_read(ser->regmap, 0x641a, &dprx_trn_status2)) { in max96745_bridge_detect()
184 dev_err(ser->dev, "Training State: 0x%lx\n", in max96745_bridge_detect()
190 atomic_set(&ser->lock.triggered, 0); in max96745_bridge_detect()
194 ser->status = status; in max96745_bridge_detect()
201 struct max96745_bridge *ser = to_max96745_bridge(bridge); in max96745_bridge_get_modes() local
203 if (ser->panel) in max96745_bridge_get_modes()
204 return drm_panel_get_modes(ser->panel, connector); in max96745_bridge_get_modes()
225 struct max96745_bridge *ser = arg; in max96745_bridge_lock_irq_handler() local
226 struct max96745 *max96745 = ser->parent; in max96745_bridge_lock_irq_handler()
229 atomic_set(&ser->lock.triggered, 1); in max96745_bridge_lock_irq_handler()
237 struct max96745_bridge *ser; in max96745_bridge_probe() local
240 ser = devm_kzalloc(dev, sizeof(*ser), GFP_KERNEL); in max96745_bridge_probe()
241 if (!ser) in max96745_bridge_probe()
244 ser->dev = dev; in max96745_bridge_probe()
245 ser->parent = dev_get_drvdata(dev->parent); in max96745_bridge_probe()
246 platform_set_drvdata(pdev, ser); in max96745_bridge_probe()
248 ser->regmap = dev_get_regmap(dev->parent, NULL); in max96745_bridge_probe()
249 if (!ser->regmap) in max96745_bridge_probe()
252 ser->lock.gpio = devm_gpiod_get_optional(dev, "lock", GPIOD_IN); in max96745_bridge_probe()
253 if (IS_ERR(ser->lock.gpio)) in max96745_bridge_probe()
254 return dev_err_probe(dev, PTR_ERR(ser->lock.gpio), in max96745_bridge_probe()
257 if (ser->lock.gpio) { in max96745_bridge_probe()
258 ser->lock.irq = gpiod_to_irq(ser->lock.gpio); in max96745_bridge_probe()
259 if (ser->lock.irq < 0) in max96745_bridge_probe()
260 return ser->lock.irq; in max96745_bridge_probe()
262 ret = devm_request_threaded_irq(dev, ser->lock.irq, NULL, in max96745_bridge_probe()
265 dev_name(dev), ser); in max96745_bridge_probe()
270 ser->bridge.funcs = &max96745_bridge_funcs; in max96745_bridge_probe()
271 ser->bridge.of_node = dev->of_node; in max96745_bridge_probe()
272 ser->bridge.ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_MODES; in max96745_bridge_probe()
274 drm_bridge_add(&ser->bridge); in max96745_bridge_probe()
281 struct max96745_bridge *ser = platform_get_drvdata(pdev); in max96745_bridge_remove() local
283 drm_bridge_remove(&ser->bridge); in max96745_bridge_remove()