Lines Matching defs:thc63

48 	struct thc63_dev *thc63 = to_thc63(bridge);
50 return drm_bridge_attach(bridge->encoder, thc63->next, bridge, flags);
57 struct thc63_dev *thc63 = to_thc63(bridge);
67 if (thc63->timings.dual_link) {
86 struct thc63_dev *thc63 = to_thc63(bridge);
89 ret = regulator_enable(thc63->vcc);
91 dev_err(thc63->dev,
96 gpiod_set_value(thc63->pdwn, 0);
97 gpiod_set_value(thc63->oe, 1);
102 struct thc63_dev *thc63 = to_thc63(bridge);
105 gpiod_set_value(thc63->oe, 0);
106 gpiod_set_value(thc63->pdwn, 1);
108 ret = regulator_disable(thc63->vcc);
110 dev_err(thc63->dev,
121 static int thc63_parse_dt(struct thc63_dev *thc63)
126 endpoint = of_graph_get_endpoint_by_regs(thc63->dev->of_node,
129 dev_err(thc63->dev, "Missing endpoint in port@%u\n",
137 dev_err(thc63->dev, "Endpoint in port@%u unconnected\n",
143 dev_err(thc63->dev, "port@%u remote endpoint is disabled\n",
149 thc63->next = of_drm_find_bridge(remote);
151 if (!thc63->next)
154 endpoint = of_graph_get_endpoint_by_regs(thc63->dev->of_node,
162 thc63->timings.dual_link = true;
167 dev_dbg(thc63->dev, "operating in %s-link mode\n",
168 thc63->timings.dual_link ? "dual" : "single");
173 static int thc63_gpio_init(struct thc63_dev *thc63)
175 thc63->oe = devm_gpiod_get_optional(thc63->dev, "oe", GPIOD_OUT_LOW);
176 if (IS_ERR(thc63->oe)) {
177 dev_err(thc63->dev, "Unable to get \"oe-gpios\": %ld\n",
178 PTR_ERR(thc63->oe));
179 return PTR_ERR(thc63->oe);
182 thc63->pdwn = devm_gpiod_get_optional(thc63->dev, "powerdown",
184 if (IS_ERR(thc63->pdwn)) {
185 dev_err(thc63->dev, "Unable to get \"powerdown-gpios\": %ld\n",
186 PTR_ERR(thc63->pdwn));
187 return PTR_ERR(thc63->pdwn);
195 struct thc63_dev *thc63;
198 thc63 = devm_kzalloc(&pdev->dev, sizeof(*thc63), GFP_KERNEL);
199 if (!thc63)
202 thc63->dev = &pdev->dev;
203 platform_set_drvdata(pdev, thc63);
205 thc63->vcc = devm_regulator_get_optional(thc63->dev, "vcc");
206 if (IS_ERR(thc63->vcc)) {
207 if (PTR_ERR(thc63->vcc) == -EPROBE_DEFER)
210 dev_err(thc63->dev, "Unable to get \"vcc\" supply: %ld\n",
211 PTR_ERR(thc63->vcc));
212 return PTR_ERR(thc63->vcc);
215 ret = thc63_gpio_init(thc63);
219 ret = thc63_parse_dt(thc63);
223 thc63->bridge.driver_private = thc63;
224 thc63->bridge.of_node = pdev->dev.of_node;
225 thc63->bridge.funcs = &thc63_bridge_func;
226 thc63->bridge.timings = &thc63->timings;
228 drm_bridge_add(&thc63->bridge);
235 struct thc63_dev *thc63 = platform_get_drvdata(pdev);
237 drm_bridge_remove(&thc63->bridge);