History

Merge tag 'drm/tegra/for-5.3-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next

drm/tegra: Changes for v5.3-rc1 This contains a couple of small improvements and cleanups for the Tegra DRM driver. Signed-off-by: Dave Airlie <airlied@redhat.com>

Dave Airlie committed 7 years ago

Commit dfd03392 parents 9b75276 eb7cf947 files · +69 −44Browse files

Unified · Split

7 files
  1. drivers/gpu/drm/tegra/dpaux.c +9 −4
  2. drivers/gpu/drm/tegra/drm.h +1 −2
  3. drivers/gpu/drm/tegra/output.c +19 −33
  4. drivers/gpu/host1x/bus.c +34 −1
  5. drivers/gpu/host1x/debug.c +0 −3
  6. drivers/gpu/host1x/dev.c +4 −1
  7. include/linux/host1x.h +2 −0
drivers/gpu/drm/tegra/dpaux.c+9−4
@@ -485,11 +485,16 @@ static int tegra_dpaux_probe(struct platform_device *pdev) · 484 unmodified lines
485485 return err;
486486 }
487487
488− dpaux->vdd = devm_regulator_get(&pdev->dev, "vdd");
488+ dpaux->vdd = devm_regulator_get_optional(&pdev->dev, "vdd");
489489 if (IS_ERR(dpaux->vdd)) {
490− dev_err(&pdev->dev, "failed to get VDD supply: %ld\n",
491− PTR_ERR(dpaux->vdd));
492− return PTR_ERR(dpaux->vdd);
490+ if (PTR_ERR(dpaux->vdd) != -ENODEV) {
491+ if (PTR_ERR(dpaux->vdd) != -EPROBE_DEFER)
492+ dev_err(&pdev->dev,
493+ "failed to get VDD supply: %ld\n",
494+ PTR_ERR(dpaux->vdd));
495+
496+ return PTR_ERR(dpaux->vdd);
497+ }
493498 }
494499
495500 platform_set_drvdata(pdev, dpaux);
drivers/gpu/drm/tegra/drm.h+1−2
@@ -127,8 +127,7 @@ struct tegra_output { · 126 unmodified lines
127127 const struct edid *edid;
128128 struct cec_notifier *cec;
129129 unsigned int hpd_irq;
130− int hpd_gpio;
131− enum of_gpio_flags hpd_gpio_flags;
130+ struct gpio_desc *hpd_gpio;
132131
133132 struct drm_encoder encoder;
134133 struct drm_connector connector;
drivers/gpu/drm/tegra/output.c+19−33
@@ -53,18 +53,11 @@ tegra_output_connector_detect(struct drm_connector *connector, bool force) · 52 unmodified lines
5353 struct tegra_output *output = connector_to_output(connector);
5454 enum drm_connector_status status = connector_status_unknown;
5555
56− if (gpio_is_valid(output->hpd_gpio)) {
57− if (output->hpd_gpio_flags & OF_GPIO_ACTIVE_LOW) {
58− if (gpio_get_value(output->hpd_gpio) != 0)
59− status = connector_status_disconnected;
60− else
61− status = connector_status_connected;
62− } else {
63− if (gpio_get_value(output->hpd_gpio) == 0)
64− status = connector_status_disconnected;
65− else
66− status = connector_status_connected;
67− }
56+ if (output->hpd_gpio) {
57+ if (gpiod_get_value(output->hpd_gpio) == 0)
58+ status = connector_status_disconnected;
59+ else
60+ status = connector_status_connected;
6861 } else {
6962 if (!output->panel)
7063 status = connector_status_disconnected;
@@ -102,6 +95,7 @@ static irqreturn_t hpd_irq(int irq, void *data) · 31 unmodified lines
10295 int tegra_output_probe(struct tegra_output *output)
10396 {
10497 struct device_node *ddc, *panel;
98+ unsigned long flags;
10599 int err, size;
106100
107101 if (!output->of_node)
@@ -130,23 +124,18 @@ int tegra_output_probe(struct tegra_output *output) · 22 unmodified lines
130124 of_node_put(ddc);
131125 }
132126
133− output->hpd_gpio = of_get_named_gpio_flags(output->of_node,
134− "nvidia,hpd-gpio", 0,
135− &output->hpd_gpio_flags);
136− if (gpio_is_valid(output->hpd_gpio)) {
137− unsigned long flags;
127+ output->hpd_gpio = devm_gpiod_get_from_of_node(output->dev,
128+ output->of_node,
129+ "nvidia,hpd-gpio", 0,
130+ GPIOD_IN,
131+ "HDMI hotplug detect");
132+ if (IS_ERR(output->hpd_gpio))
133+ return PTR_ERR(output->hpd_gpio);
138134
139− err = gpio_request_one(output->hpd_gpio, GPIOF_DIR_IN,
140− "HDMI hotplug detect");
135+ if (output->hpd_gpio) {
136+ err = gpiod_to_irq(output->hpd_gpio);
141137 if (err < 0) {
142− dev_err(output->dev, "gpio_request_one(): %d\n", err);
143− return err;
144− }
145−
146− err = gpio_to_irq(output->hpd_gpio);
147− if (err < 0) {
148− dev_err(output->dev, "gpio_to_irq(): %d\n", err);
149− gpio_free(output->hpd_gpio);
138+ dev_err(output->dev, "gpiod_to_irq(): %d\n", err);
150139 return err;
151140 }
152141
@@ -160,7 +149,6 @@ int tegra_output_probe(struct tegra_output *output) · 7 unmodified lines
160149 if (err < 0) {
161150 dev_err(output->dev, "failed to request IRQ#%u: %d\n",
162151 output->hpd_irq, err);
163− gpio_free(output->hpd_gpio);
164152 return err;
165153 }
166154
@@ -186,10 +174,8 @@ void tegra_output_remove(struct tegra_output *output) · 19 unmodified lines
186174 if (output->cec)
187175 cec_notifier_put(output->cec);
188176
189− if (gpio_is_valid(output->hpd_gpio)) {
177+ if (output->hpd_gpio)
190178 free_irq(output->hpd_irq, output);
191− gpio_free(output->hpd_gpio);
192− }
193179
194180 if (output->ddc)
195181 put_device(&output->ddc->dev);
@@ -209,7 +195,7 @@ int tegra_output_init(struct drm_device *drm, struct tegra_output *output) · 13 unmodified lines
209195 * The connector is now registered and ready to receive hotplug events
210196 * so the hotplug interrupt can be enabled.
211197 */
212− if (gpio_is_valid(output->hpd_gpio))
198+ if (output->hpd_gpio)
213199 enable_irq(output->hpd_irq);
214200
215201 return 0;
@@ -221,7 +207,7 @@ void tegra_output_exit(struct tegra_output *output) · 5 unmodified lines
221207 * The connector is going away, so the interrupt must be disabled to
222208 * prevent the hotplug interrupt handler from potentially crashing.
223209 */
224− if (gpio_is_valid(output->hpd_gpio))
210+ if (output->hpd_gpio)
225211 disable_irq(output->hpd_irq);
226212
227213 if (output->panel)
drivers/gpu/host1x/bus.c+34−1
@@ -305,6 +305,36 @@ static int host1x_device_match(struct device *dev, struct device_driver *drv) · 304 unmodified lines
305305 return strcmp(dev_name(dev), drv->name) == 0;
306306 }
307307
308+static int host1x_device_uevent(struct device *dev,
309+ struct kobj_uevent_env *env)
310+{
311+ struct device_node *np = dev->parent->of_node;
312+ unsigned int count = 0;
313+ struct property *p;
314+ const char *compat;
315+
316+ /*
317+ * This duplicates most of of_device_uevent(), but the latter cannot
318+ * be called from modules and operates on dev->of_node, which is not
319+ * available in this case.
320+ *
321+ * Note that this is really only needed for backwards compatibility
322+ * with libdrm, which parses this information from sysfs and will
323+ * fail if it can't find the OF_FULLNAME, specifically.
324+ */
325+ add_uevent_var(env, "OF_NAME=%pOFn", np);
326+ add_uevent_var(env, "OF_FULLNAME=%pOF", np);
327+
328+ of_property_for_each_string(np, "compatible", p, compat) {
329+ add_uevent_var(env, "OF_COMPATIBLE_%u=%s", count, compat);
330+ count++;
331+ }
332+
333+ add_uevent_var(env, "OF_COMPATIBLE_N=%u", count);
334+
335+ return 0;
336+}
337+
308338 static int host1x_dma_configure(struct device *dev)
309339 {
310340 return of_dma_configure(dev, dev->of_node, true);
@@ -322,6 +352,7 @@ static const struct dev_pm_ops host1x_device_pm_ops = { · 11 unmodified lines
322352 struct bus_type host1x_bus_type = {
323353 .name = "host1x",
324354 .match = host1x_device_match,
355+ .uevent = host1x_device_uevent,
325356 .dma_configure = host1x_dma_configure,
326357 .pm = &host1x_device_pm_ops,
327358 };
@@ -408,12 +439,14 @@ static int host1x_device_add(struct host1x *host1x, · 80 unmodified lines
408439 device->dev.dma_mask = &device->dev.coherent_dma_mask;
409440 dev_set_name(&device->dev, "%s", driver->driver.name);
410441 device->dev.release = host1x_device_release;
411− device->dev.of_node = host1x->dev->of_node;
412442 device->dev.bus = &host1x_bus_type;
413443 device->dev.parent = host1x->dev;
414444
415445 of_dma_configure(&device->dev, host1x->dev->of_node, true);
416446
447+ device->dev.dma_parms = &device->dma_parms;
448+ dma_set_max_seg_size(&device->dev, SZ_4M);
449+
417450 err = host1x_device_parse_dt(device, driver);
418451 if (err < 0) {
419452 kfree(device);
drivers/gpu/host1x/debug.c+0−3
@@ -162,9 +162,6 @@ static void host1x_debugfs_init(struct host1x *host1x) · 161 unmodified lines
162162 {
163163 struct dentry *de = debugfs_create_dir("tegra-host1x", NULL);
164164
165− if (!de)
166− return;
167−
168165 /* Store the created entry */
169166 host1x->debugfs = de;
170167
drivers/gpu/host1x/dev.c+4−1
@@ -247,8 +247,11 @@ static int host1x_probe(struct platform_device *pdev) · 246 unmodified lines
247247
248248 host->clk = devm_clk_get(&pdev->dev, NULL);
249249 if (IS_ERR(host->clk)) {
250− dev_err(&pdev->dev, "failed to get clock\n");
251250 err = PTR_ERR(host->clk);
251+
252+ if (err != -EPROBE_DEFER)
253+ dev_err(&pdev->dev, "failed to get clock: %d\n", err);
254+
252255 return err;
253256 }
254257
include/linux/host1x.h+2−0
@@ -297,6 +297,8 @@ struct host1x_device { · 296 unmodified lines
297297 struct list_head clients;
298298
299299 bool registered;
300+
301+ struct device_dma_parameters dma_parms;
300302 };
301303
302304 static inline struct host1x_device *to_host1x_device(struct device *dev)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t