brcm2708: update linux 4.4 patches to latest version
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0448-drm-Emit-modalias-uevents-for-the-DSI-devices-we-cre.patch
1 From e46450e232a96665344b825557bacf1d37842174 Mon Sep 17 00:00:00 2001
2 From: Eric Anholt <eric@anholt.net>
3 Date: Tue, 9 Aug 2016 15:13:33 -0700
4 Subject: [PATCH] drm: Emit modalias uevents for the DSI devices we create.
5
6 This gets the Raspberry Pi panel module to automatically load at boot
7 time.
8
9 Signed-off-by: Eric Anholt <eric@anholt.net>
10 ---
11 drivers/gpu/drm/drm_mipi_dsi.c | 19 +++++++++++++++++++
12 1 file changed, 19 insertions(+)
13
14 --- a/drivers/gpu/drm/drm_mipi_dsi.c
15 +++ b/drivers/gpu/drm/drm_mipi_dsi.c
16 @@ -50,6 +50,24 @@ static int mipi_dsi_device_match(struct
17 return of_driver_match_device(dev, drv);
18 }
19
20 +/**
21 + * Send modalias events when devices are created on the bus, so that
22 + * modules can load automatically.
23 + */
24 +static int mipi_dsi_uevent(struct device *dev, struct kobj_uevent_env *env)
25 +{
26 + int rc;
27 +
28 + /* Just do the OF uevent, which emits the compatible string so
29 + * that a MODULE_DEVICE_TABLE(of, ...) works.
30 + */
31 + rc = of_device_uevent_modalias(dev, env);
32 + if (rc != -ENODEV)
33 + return rc;
34 +
35 + return 0;
36 +}
37 +
38 static const struct dev_pm_ops mipi_dsi_device_pm_ops = {
39 .runtime_suspend = pm_generic_runtime_suspend,
40 .runtime_resume = pm_generic_runtime_resume,
41 @@ -65,6 +83,7 @@ static struct bus_type mipi_dsi_bus_type
42 .name = "mipi-dsi",
43 .match = mipi_dsi_device_match,
44 .pm = &mipi_dsi_device_pm_ops,
45 + .uevent = mipi_dsi_uevent,
46 };
47
48 static int of_device_match(struct device *dev, void *data)