From: Ricardo Ribalda <ribalda@chromium.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
Yunke Cao <yunkec@chromium.org>,
Hans Verkuil <hverkuil@xs4all.nl>,
Ricardo Ribalda <ribalda@chromium.org>
Subject: [PATCH 4/7] media: uvcvideo: Create ancillary link for GPIO subdevice
Date: Thu, 31 Oct 2024 13:43:17 +0000 [thread overview]
Message-ID: <20241031-uvc-subdev-v1-4-a68331cedd72@chromium.org> (raw)
In-Reply-To: <20241031-uvc-subdev-v1-0-a68331cedd72@chromium.org>
Make an ancillary device between the streaming subdevice and the GPIO
subdevice.
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
drivers/media/usb/uvc/uvc_entity.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/media/usb/uvc/uvc_entity.c b/drivers/media/usb/uvc/uvc_entity.c
index c1b69f9eaa56..dad77b96fe16 100644
--- a/drivers/media/usb/uvc/uvc_entity.c
+++ b/drivers/media/usb/uvc/uvc_entity.c
@@ -53,6 +53,16 @@ static int uvc_mc_create_links(struct uvc_video_chain *chain,
return ret;
}
+ /* Create ancillary link for the GPIO. */
+ if (chain->dev->gpio_unit && UVC_ENTITY_TYPE(entity) == UVC_ITT_CAMERA) {
+ struct media_link *link;
+
+ link = media_create_ancillary_link(sink,
+ &chain->dev->gpio_unit->subdev.entity);
+ if (IS_ERR(link))
+ return PTR_ERR(link);
+ }
+
return 0;
}
--
2.47.0.163.g1226f6d8fa-goog
next prev parent reply other threads:[~2024-10-31 13:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 13:43 [PATCH 0/7] media: uvcvideo: Implement the Privacy GPIO as a subdevice Ricardo Ribalda
2024-10-31 13:43 ` [PATCH 1/7] media: uvcvideo: Factor out gpio functions to its own file Ricardo Ribalda
2024-10-31 13:43 ` [PATCH 2/7] media: uvcvideo: reimplement privacy GPIO as a separate subdevice Ricardo Ribalda
2024-10-31 13:43 ` [PATCH 3/7] Revert "media: uvcvideo: Allow entity-defined get_info and get_cur" Ricardo Ribalda
2024-10-31 13:43 ` Ricardo Ribalda [this message]
2024-10-31 13:43 ` [PATCH 5/7] media: v4l2-core: Add new MEDIA_ENT_F_GPIO Ricardo Ribalda
2024-10-31 13:43 ` [PATCH 6/7] media: uvcvideo: Use MEDIA_ENT_F_GPIO for the GPIO entity Ricardo Ribalda
2024-11-04 9:37 ` Sergey Senozhatsky
2024-10-31 13:43 ` [PATCH 7/7] media: uvcvideo: Introduce UVC_QUIRK_PRIVACY_DURING_STREAM Ricardo Ribalda
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=20241031-uvc-subdev-v1-4-a68331cedd72@chromium.org \
--to=ribalda@chromium.org \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=yunkec@chromium.org \
/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
all inboxes | Powered by JetHome®