dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Inki Dae <inki.dae@samsung.com>
To: Emil Velikov <emil.l.velikov@gmail.com>, dri-devel@lists.freedesktop.org
Cc: Kyungmin Park <kyungmin.park@samsung.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Joonyoung Shim <jy0922.shim@samsung.com>
Subject: Re: [PATCH 3/3] drm/exynos-vidi: convert platform driver to use dev_groups
Date: Mon, 18 May 2020 14:03:04 +0900	[thread overview]
Message-ID: <8050fc74-ae7e-c50f-274a-88d546460d1b@samsung.com> (raw)
In-Reply-To: <20200517193655.3895087-3-emil.l.velikov@gmail.com>

Hi Email,

20. 5. 18. 오전 4:36에 Emil Velikov 이(가) 쓴 글:
> Platform drivers now have the option to have the platform core create
> and remove any needed sysfs attribute files.  So take advantage of that
> and do not register "by hand" a sysfs file.
> 
> Cc: Inki Dae <inki.dae@samsung.com>
> Cc: Joonyoung Shim <jy0922.shim@samsung.com>
> Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
> ---
> Compile tested only. Please test locally and merge through your tree.

Thanks for taking care of this. Tested and worked well like below,
# echo 1 > /sys/devices/platform/exynos-drm-vidi/connection
# modetest -M exynos -v -s 91@89:1920x1080 -s 77@54:1440x2560
setting mode 1920x1080-60Hz@XR24 on connectors 91, crtc 89
setting mode 1440x2560-60Hz@XR24 on connectors 77, crtc 54
freq: 60.22Hz
freq: 50.44Hz
freq: 59.78Hz
freq: 50.00Hz
freq: 59.77Hz
freq: 50.00Hz

Ps. 91 is connector ID of exynos-drm-vidi


Merged.

Thanks,
Inki Dae

> ---
>  drivers/gpu/drm/exynos/exynos_drm_vidi.c | 26 ++++++++----------------
>  1 file changed, 8 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> index 282467121699..e5662bdcbbde 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
> @@ -214,6 +214,12 @@ static ssize_t vidi_store_connection(struct device *dev,
>  static DEVICE_ATTR(connection, 0644, vidi_show_connection,
>  			vidi_store_connection);
>  
> +static struct attribute *vidi_attrs[] = {
> +	&dev_attr_connection.attr,
> +	NULL,
> +};
> +ATTRIBUTE_GROUPS(vidi);
> +
>  int vidi_connection_ioctl(struct drm_device *drm_dev, void *data,
>  				struct drm_file *file_priv)
>  {
> @@ -439,7 +445,6 @@ static int vidi_probe(struct platform_device *pdev)
>  {
>  	struct vidi_context *ctx;
>  	struct device *dev = &pdev->dev;
> -	int ret;
>  
>  	ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
>  	if (!ctx)
> @@ -453,23 +458,7 @@ static int vidi_probe(struct platform_device *pdev)
>  
>  	platform_set_drvdata(pdev, ctx);
>  
> -	ret = device_create_file(dev, &dev_attr_connection);
> -	if (ret < 0) {
> -		DRM_DEV_ERROR(dev,
> -			      "failed to create connection sysfs.\n");
> -		return ret;
> -	}
> -
> -	ret = component_add(dev, &vidi_component_ops);
> -	if (ret)
> -		goto err_remove_file;
> -
> -	return ret;
> -
> -err_remove_file:
> -	device_remove_file(dev, &dev_attr_connection);
> -
> -	return ret;
> +	return component_add(dev, &vidi_component_ops);
>  }
>  
>  static int vidi_remove(struct platform_device *pdev)
> @@ -494,5 +483,6 @@ struct platform_driver vidi_driver = {
>  	.driver		= {
>  		.name	= "exynos-drm-vidi",
>  		.owner	= THIS_MODULE,
> +		.dev_groups = vidi_groups,
>  	},
>  };
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-05-18  4:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-17 19:36 [PATCH 1/3] drm/arm: Kconfig annotate drivers as COMPILE_TEST Emil Velikov
2020-05-17 19:36 ` [PATCH 2/3] drm/malidp: convert platform driver to use dev_groups Emil Velikov
2020-05-17 19:36 ` [PATCH 3/3] drm/exynos-vidi: " Emil Velikov
2020-05-18  5:03   ` Inki Dae [this message]
2020-05-18 11:10 ` [PATCH 1/3] drm/arm: Kconfig annotate drivers as COMPILE_TEST Liviu Dudau
2020-05-19 23:54   ` Emil Velikov
2020-06-01 17:42     ` Liviu Dudau
2020-06-15 19:25       ` Emil Velikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8050fc74-ae7e-c50f-274a-88d546460d1b@samsung.com \
    --to=inki.dae@samsung.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=jy0922.shim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=sw0312.kim@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).