From: Umang Jain <umang.jain@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>, linux-media@vger.kernel.org
Cc: tomi.valkeinen@ideasonboard.com,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil@xs4all.nl>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
linux-kernel@vger.kernel.org, Hans de Goede <hdegoede@redhat.com>
Subject: Re: [PATCH v2 1/1] media: v4l: Don't turn on privacy LED if streamon fails
Date: Thu, 11 Apr 2024 11:14:26 +0530 [thread overview]
Message-ID: <e7b07a8c-d56f-486f-9c5e-d0450288a1a3@ideasonboard.com> (raw)
In-Reply-To: <d330e0fa-fc50-4920-9000-c6343f5f101b@redhat.com>
Hi Sakari,
Thank you for the patch
On 10/04/24 5:18 pm, Hans de Goede wrote:
> Hi,
>
> On 4/10/24 1:47 PM, Sakari Ailus wrote:
>> Turn on the privacy LED only if streamon succeeds. This can be done after
>> enabling streaming on the sensor.
>>
>> Fixes: b6e10ff6c23d ("media: v4l2-core: Make the v4l2-core code enable/disable the privacy LED if present")
>> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Thanks, patch looks good to me:
Looks good to me too
>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
>
> Regards,
>
> Hans
>
>
>
>> ---
>> drivers/media/v4l2-core/v4l2-subdev.c | 22 ++++++++++++----------
>> 1 file changed, 12 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
>> index 4c6198c48dd6..012b757eac9f 100644
>> --- a/drivers/media/v4l2-core/v4l2-subdev.c
>> +++ b/drivers/media/v4l2-core/v4l2-subdev.c
>> @@ -412,15 +412,6 @@ static int call_s_stream(struct v4l2_subdev *sd, int enable)
>> if (WARN_ON(!!sd->enabled_streams == !!enable))
>> return 0;
>>
>> -#if IS_REACHABLE(CONFIG_LEDS_CLASS)
>> - if (!IS_ERR_OR_NULL(sd->privacy_led)) {
>> - if (enable)
>> - led_set_brightness(sd->privacy_led,
>> - sd->privacy_led->max_brightness);
>> - else
>> - led_set_brightness(sd->privacy_led, 0);
>> - }
>> -#endif
>> ret = sd->ops->video->s_stream(sd, enable);
>>
>> if (!enable && ret < 0) {
>> @@ -428,9 +419,20 @@ static int call_s_stream(struct v4l2_subdev *sd, int enable)
>> ret = 0;
>> }
>>
>> - if (!ret)
>> + if (!ret) {
>> sd->enabled_streams = enable ? BIT(0) : 0;
>>
>> +#if IS_REACHABLE(CONFIG_LEDS_CLASS)
>> + if (!IS_ERR_OR_NULL(sd->privacy_led)) {
>> + if (enable)
>> + led_set_brightness(sd->privacy_led,
>> + sd->privacy_led->max_brightness);
>> + else
>> + led_set_brightness(sd->privacy_led, 0);
>> + }
>> +#endif
>> + }
>> +
>> return ret;
>> }
>>
next prev parent reply other threads:[~2024-04-11 5:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-10 11:47 Sakari Ailus
2024-04-10 11:48 ` Hans de Goede
2024-04-11 5:44 ` Umang Jain [this message]
2024-04-10 11:53 ` Tomi Valkeinen
2024-04-12 17:46 ` Laurent Pinchart
2024-04-15 7:15 ` Sakari Ailus
2024-04-15 7:18 ` Laurent Pinchart
2024-04-15 7:29 ` Sakari Ailus
2024-04-15 7:40 ` Laurent Pinchart
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=e7b07a8c-d56f-486f-9c5e-d0450288a1a3@ideasonboard.com \
--to=umang.jain@ideasonboard.com \
--cc=hdegoede@redhat.com \
--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=tomi.valkeinen@ideasonboard.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
all inboxes | Powered by JetHome®