* [PATCH] drm/dsi: Add uevent callback
@ 2016-06-03 15:28 Thierry Reding
2016-06-08 4:40 ` Archit Taneja
0 siblings, 1 reply; 3+ messages in thread
From: Thierry Reding @ 2016-06-03 15:28 UTC (permalink / raw)
To: Thierry Reding; +Cc: Andrzej Hajda, dri-devel
From: Thierry Reding <treding@nvidia.com>
Implement a uevent callback for devices on the MIPI DSI bus. This
callback will append MODALIAS information to the uevent and allow
modules to be loaded when devices are added to the bus.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
drivers/gpu/drm/drm_mipi_dsi.c | 16 ++++++++++++++++
include/drm/drm_mipi_dsi.h | 2 ++
2 files changed, 18 insertions(+)
diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
index f5d80839a90c..2181699d5b3b 100644
--- a/drivers/gpu/drm/drm_mipi_dsi.c
+++ b/drivers/gpu/drm/drm_mipi_dsi.c
@@ -60,6 +60,21 @@ static int mipi_dsi_device_match(struct device *dev, struct device_driver *drv)
return 0;
}
+static int mipi_dsi_uevent(struct device *dev, struct kobj_uevent_env *env)
+{
+ struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev);
+ int err;
+
+ err = of_device_uevent_modalias(dev, env);
+ if (err != -ENODEV)
+ return err;
+
+ add_uevent_var(env, "MODALIAS=%s%s", MIPI_DSI_MODULE_PREFIX,
+ dsi->name);
+
+ return 0;
+}
+
static const struct dev_pm_ops mipi_dsi_device_pm_ops = {
.runtime_suspend = pm_generic_runtime_suspend,
.runtime_resume = pm_generic_runtime_resume,
@@ -74,6 +89,7 @@ static const struct dev_pm_ops mipi_dsi_device_pm_ops = {
static struct bus_type mipi_dsi_bus_type = {
.name = "mipi-dsi",
.match = mipi_dsi_device_match,
+ .uevent = mipi_dsi_uevent,
.pm = &mipi_dsi_device_pm_ops,
};
diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
index 7a9840f8b38e..765c04348b7f 100644
--- a/include/drm/drm_mipi_dsi.h
+++ b/include/drm/drm_mipi_dsi.h
@@ -180,6 +180,8 @@ struct mipi_dsi_device {
unsigned long mode_flags;
};
+#define MIPI_DSI_MODULE_PREFIX "mipi-dsi:"
+
static inline struct mipi_dsi_device *to_mipi_dsi_device(struct device *dev)
{
return container_of(dev, struct mipi_dsi_device, dev);
--
2.8.3
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/dsi: Add uevent callback
2016-06-03 15:28 [PATCH] drm/dsi: Add uevent callback Thierry Reding
@ 2016-06-08 4:40 ` Archit Taneja
2016-06-13 11:10 ` Thierry Reding
0 siblings, 1 reply; 3+ messages in thread
From: Archit Taneja @ 2016-06-08 4:40 UTC (permalink / raw)
To: Thierry Reding; +Cc: Andrzej Hajda, dri-devel
On 06/03/2016 08:58 PM, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> Implement a uevent callback for devices on the MIPI DSI bus. This
> callback will append MODALIAS information to the uevent and allow
> modules to be loaded when devices are added to the bus.
Reviewed-by: Archit Taneja <architt@codeaurora.org>
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> drivers/gpu/drm/drm_mipi_dsi.c | 16 ++++++++++++++++
> include/drm/drm_mipi_dsi.h | 2 ++
> 2 files changed, 18 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
> index f5d80839a90c..2181699d5b3b 100644
> --- a/drivers/gpu/drm/drm_mipi_dsi.c
> +++ b/drivers/gpu/drm/drm_mipi_dsi.c
> @@ -60,6 +60,21 @@ static int mipi_dsi_device_match(struct device *dev, struct device_driver *drv)
> return 0;
> }
>
> +static int mipi_dsi_uevent(struct device *dev, struct kobj_uevent_env *env)
> +{
> + struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev);
> + int err;
> +
> + err = of_device_uevent_modalias(dev, env);
> + if (err != -ENODEV)
> + return err;
> +
> + add_uevent_var(env, "MODALIAS=%s%s", MIPI_DSI_MODULE_PREFIX,
> + dsi->name);
> +
> + return 0;
> +}
> +
> static const struct dev_pm_ops mipi_dsi_device_pm_ops = {
> .runtime_suspend = pm_generic_runtime_suspend,
> .runtime_resume = pm_generic_runtime_resume,
> @@ -74,6 +89,7 @@ static const struct dev_pm_ops mipi_dsi_device_pm_ops = {
> static struct bus_type mipi_dsi_bus_type = {
> .name = "mipi-dsi",
> .match = mipi_dsi_device_match,
> + .uevent = mipi_dsi_uevent,
> .pm = &mipi_dsi_device_pm_ops,
> };
>
> diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
> index 7a9840f8b38e..765c04348b7f 100644
> --- a/include/drm/drm_mipi_dsi.h
> +++ b/include/drm/drm_mipi_dsi.h
> @@ -180,6 +180,8 @@ struct mipi_dsi_device {
> unsigned long mode_flags;
> };
>
> +#define MIPI_DSI_MODULE_PREFIX "mipi-dsi:"
> +
> static inline struct mipi_dsi_device *to_mipi_dsi_device(struct device *dev)
> {
> return container_of(dev, struct mipi_dsi_device, dev);
>
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
Forum, hosted by The Linux Foundation
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/dsi: Add uevent callback
2016-06-08 4:40 ` Archit Taneja
@ 2016-06-13 11:10 ` Thierry Reding
0 siblings, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2016-06-13 11:10 UTC (permalink / raw)
To: Archit Taneja; +Cc: Andrzej Hajda, dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 477 bytes --]
On Wed, Jun 08, 2016 at 10:10:29AM +0530, Archit Taneja wrote:
>
>
> On 06/03/2016 08:58 PM, Thierry Reding wrote:
> > From: Thierry Reding <treding@nvidia.com>
> >
> > Implement a uevent callback for devices on the MIPI DSI bus. This
> > callback will append MODALIAS information to the uevent and allow
> > modules to be loaded when devices are added to the bus.
>
> Reviewed-by: Archit Taneja <architt@codeaurora.org>
Applied to topic/drm-misc.
Thierry
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-13 11:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-03 15:28 [PATCH] drm/dsi: Add uevent callback Thierry Reding
2016-06-08 4:40 ` Archit Taneja
2016-06-13 11:10 ` Thierry Reding
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.