Lines Matching refs:thc63
48 struct thc63_dev *thc63 = to_thc63(bridge); in thc63_attach() local
50 return drm_bridge_attach(bridge->encoder, thc63->next, bridge, flags); in thc63_attach()
57 struct thc63_dev *thc63 = to_thc63(bridge); in thc63_mode_valid() local
67 if (thc63->timings.dual_link) { in thc63_mode_valid()
86 struct thc63_dev *thc63 = to_thc63(bridge); in thc63_enable() local
89 ret = regulator_enable(thc63->vcc); in thc63_enable()
91 dev_err(thc63->dev, in thc63_enable()
96 gpiod_set_value(thc63->pdwn, 0); in thc63_enable()
97 gpiod_set_value(thc63->oe, 1); in thc63_enable()
102 struct thc63_dev *thc63 = to_thc63(bridge); in thc63_disable() local
105 gpiod_set_value(thc63->oe, 0); in thc63_disable()
106 gpiod_set_value(thc63->pdwn, 1); in thc63_disable()
108 ret = regulator_disable(thc63->vcc); in thc63_disable()
110 dev_err(thc63->dev, in thc63_disable()
121 static int thc63_parse_dt(struct thc63_dev *thc63) in thc63_parse_dt() argument
126 remote = of_graph_get_remote_node(thc63->dev->of_node, in thc63_parse_dt()
129 dev_err(thc63->dev, "No remote endpoint for port@%u\n", in thc63_parse_dt()
134 thc63->next = of_drm_find_bridge(remote); in thc63_parse_dt()
136 if (!thc63->next) in thc63_parse_dt()
139 endpoint = of_graph_get_endpoint_by_regs(thc63->dev->of_node, in thc63_parse_dt()
147 thc63->timings.dual_link = true; in thc63_parse_dt()
152 dev_dbg(thc63->dev, "operating in %s-link mode\n", in thc63_parse_dt()
153 thc63->timings.dual_link ? "dual" : "single"); in thc63_parse_dt()
158 static int thc63_gpio_init(struct thc63_dev *thc63) in thc63_gpio_init() argument
160 thc63->oe = devm_gpiod_get_optional(thc63->dev, "oe", GPIOD_OUT_LOW); in thc63_gpio_init()
161 if (IS_ERR(thc63->oe)) { in thc63_gpio_init()
162 dev_err(thc63->dev, "Unable to get \"oe-gpios\": %ld\n", in thc63_gpio_init()
163 PTR_ERR(thc63->oe)); in thc63_gpio_init()
164 return PTR_ERR(thc63->oe); in thc63_gpio_init()
167 thc63->pdwn = devm_gpiod_get_optional(thc63->dev, "powerdown", in thc63_gpio_init()
169 if (IS_ERR(thc63->pdwn)) { in thc63_gpio_init()
170 dev_err(thc63->dev, "Unable to get \"powerdown-gpios\": %ld\n", in thc63_gpio_init()
171 PTR_ERR(thc63->pdwn)); in thc63_gpio_init()
172 return PTR_ERR(thc63->pdwn); in thc63_gpio_init()
180 struct thc63_dev *thc63; in thc63_probe() local
183 thc63 = devm_kzalloc(&pdev->dev, sizeof(*thc63), GFP_KERNEL); in thc63_probe()
184 if (!thc63) in thc63_probe()
187 thc63->dev = &pdev->dev; in thc63_probe()
188 platform_set_drvdata(pdev, thc63); in thc63_probe()
190 thc63->vcc = devm_regulator_get(thc63->dev, "vcc"); in thc63_probe()
191 if (IS_ERR(thc63->vcc)) { in thc63_probe()
192 if (PTR_ERR(thc63->vcc) == -EPROBE_DEFER) in thc63_probe()
195 dev_err(thc63->dev, "Unable to get \"vcc\" supply: %ld\n", in thc63_probe()
196 PTR_ERR(thc63->vcc)); in thc63_probe()
197 return PTR_ERR(thc63->vcc); in thc63_probe()
200 ret = thc63_gpio_init(thc63); in thc63_probe()
204 ret = thc63_parse_dt(thc63); in thc63_probe()
208 thc63->bridge.driver_private = thc63; in thc63_probe()
209 thc63->bridge.of_node = pdev->dev.of_node; in thc63_probe()
210 thc63->bridge.funcs = &thc63_bridge_func; in thc63_probe()
211 thc63->bridge.timings = &thc63->timings; in thc63_probe()
213 drm_bridge_add(&thc63->bridge); in thc63_probe()
220 struct thc63_dev *thc63 = platform_get_drvdata(pdev); in thc63_remove() local
222 drm_bridge_remove(&thc63->bridge); in thc63_remove()