linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans Verkuil <hansverk@cisco.com>
To: Philipp Zabel <p.zabel@pengutronix.de>,
	Hans Verkuil <hans.verkuil@cisco.com>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>,
	linux-media@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH 3/5] [media] vivid: convert to platform device
Date: Wed, 22 Oct 2014 12:10:06 +0200	[thread overview]
Message-ID: <5447827E.2070200@cisco.com> (raw)
In-Reply-To: <1413972221-13669-4-git-send-email-p.zabel@pengutronix.de>

On 10/22/2014 12:03 PM, Philipp Zabel wrote:
> For contiguous DMA buffer allocation, a struct is needed that
> DMA buffers can be associated with.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>

Nice! I was planning something like that myself.

Regards,

	Hans

> ---
>   drivers/media/platform/vivid/vivid-core.c | 37 +++++++++++++++++++++++++++++--
>   1 file changed, 35 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/vivid/vivid-core.c b/drivers/media/platform/vivid/vivid-core.c
> index 2c61a62..c79d60d 100644
> --- a/drivers/media/platform/vivid/vivid-core.c
> +++ b/drivers/media/platform/vivid/vivid-core.c
> @@ -26,6 +26,7 @@
>   #include <linux/vmalloc.h>
>   #include <linux/font.h>
>   #include <linux/mutex.h>
> +#include <linux/platform_device.h>
>   #include <linux/videodev2.h>
>   #include <linux/v4l2-dv-timings.h>
>   #include <media/videobuf2-vmalloc.h>
> @@ -152,6 +153,7 @@ module_param(no_error_inj, bool, 0444);
>   MODULE_PARM_DESC(no_error_inj, " if set disable the error injecting controls");
>
>   static struct vivid_dev *vivid_devs[VIVID_MAX_DEVS];
> +static struct platform_device *vivid_pdev;
>
>   const struct v4l2_rect vivid_min_rect = {
>   	0, 0, MIN_WIDTH, MIN_HEIGHT
> @@ -1288,7 +1290,7 @@ free_dev:
>      will succeed. This is limited to the maximum number of devices that
>      videodev supports, which is equal to VIDEO_NUM_DEVICES.
>    */
> -static int __init vivid_init(void)
> +static int vivid_probe(struct platform_device *pdev)
>   {
>   	const struct font_desc *font = find_font("VGA8x16");
>   	int ret = 0, i;
> @@ -1323,7 +1325,7 @@ static int __init vivid_init(void)
>   	return ret;
>   }
>
> -static void __exit vivid_exit(void)
> +static int vivid_remove(struct platform_device *pdev)
>   {
>   	struct vivid_dev *dev;
>   	unsigned i;
> @@ -1384,6 +1386,37 @@ static void __exit vivid_exit(void)
>   		kfree(dev);
>   		vivid_devs[i] = NULL;
>   	}
> +
> +	return 0;
> +}
> +
> +struct platform_driver vivid_driver = {
> +	.probe = vivid_probe,
> +	.remove = vivid_remove,
> +	.driver = {
> +		.name = "vivid",
> +	},
> +};
> +
> +static int __init vivid_init(void)
> +{
> +	int ret;
> +
> +	vivid_pdev = platform_device_register_simple("vivid", -1, NULL, 0);
> +	if (IS_ERR(vivid_pdev))
> +		return PTR_ERR(vivid_pdev);
> +
> +	ret = platform_driver_register(&vivid_driver);
> +	if (ret != 0)
> +		platform_device_unregister(vivid_pdev);
> +
> +	return ret;
> +}
> +
> +static void __exit vivid_exit(void)
> +{
> +	platform_device_unregister(vivid_pdev);
> +	platform_driver_unregister(&vivid_driver);
>   }
>
>   module_init(vivid_init);
>


  reply	other threads:[~2014-10-22 10:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22 10:03 [PATCH 0/5] Contiguous DMA buffer support for the Virtual Video Test Driver Philipp Zabel
2014-10-22 10:03 ` [PATCH 1/5] [media] vivid: select CONFIG_FB_CFB_FILLRECT/COPYAREA/IMAGEBLIT Philipp Zabel
2014-10-22 10:07   ` Hans Verkuil
2014-10-22 10:03 ` [PATCH 2/5] [media] vivid: remove unused videobuf2-vmalloc headers Philipp Zabel
2014-10-22 10:08   ` Hans Verkuil
2014-10-22 10:03 ` [PATCH 3/5] [media] vivid: convert to platform device Philipp Zabel
2014-10-22 10:10   ` Hans Verkuil [this message]
2014-10-22 10:03 ` [PATCH 4/5] [media] vivid: add support for contiguous DMA buffers Philipp Zabel
2014-10-22 10:14   ` Hans Verkuil
2014-10-22 11:50     ` Philipp Zabel
2014-11-03 13:38   ` Hans Verkuil
2014-11-04 11:51     ` Philipp Zabel
2014-10-22 10:03 ` [PATCH 5/5] [media] vivid: enable VIDIOC_EXPBUF Philipp Zabel
2014-10-22 10:15   ` Hans Verkuil

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=5447827E.2070200@cisco.com \
    --to=hansverk@cisco.com \
    --cc=hans.verkuil@cisco.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=p.zabel@pengutronix.de \
    /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).