From patchwork Fri Jul 17 08:46:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Anaszewski X-Patchwork-Id: 6814421 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 26FD59F380 for ; Fri, 17 Jul 2015 09:14:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 31894205EE for ; Fri, 17 Jul 2015 09:14:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3E1C82057E for ; Fri, 17 Jul 2015 09:14:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1945930AbbGQJNy (ORCPT ); Fri, 17 Jul 2015 05:13:54 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:35989 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751190AbbGQIsJ (ORCPT ); Fri, 17 Jul 2015 04:48:09 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NRM02DWAJ47GF40@mailout3.samsung.com>; Fri, 17 Jul 2015 17:48:07 +0900 (KST) X-AuditID: cbfee61a-f79516d000006302-99-55a8c1470cda Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 66.3B.25346.741C8A55; Fri, 17 Jul 2015 17:48:07 +0900 (KST) Received: from AMDC2362.DIGITAL.local ([106.120.53.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NRM00IUPJ3F4B20@mmp1.samsung.com>; Fri, 17 Jul 2015 17:48:07 +0900 (KST) From: Jacek Anaszewski To: linux-leds@vger.kernel.org Cc: linux-kernel@vger.kernel.org, cooloney@gmail.com, rpurdie@rpsys.net, stsp@users.sourceforge.net, Jacek Anaszewski , Sakari Ailus , Pavel Machek , linux-media@vger.kernel.org Subject: [PATCH/RFC 06/51] media: flash: use led_set_brightness_sync for torch brightness Date: Fri, 17 Jul 2015 10:46:52 +0200 Message-id: <1437122857-6765-7-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1437122857-6765-1-git-send-email-j.anaszewski@samsung.com> References: <1437122857-6765-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCLMWRmVeSWpSXmKPExsVy+t9jAV33gytCDRpnmFsc3TmRyaL36nNG i8u75rBZbH2zjtGiZ8NWVou7p46yWeze9ZTV4tOWb0wWnX3TWBw4PXbOusvuMe9koMee+T9Y Pfq2rGL0WLH6O7tH06l2Vo/Pm+QC2KO4bFJSczLLUov07RK4MpbP9y/o4Kt4Mm0OawPjH+4u Rk4OCQETiX3z1rBC2GISF+6tZ+ti5OIQEljEKHF53j4o5yejxO2TdxhBqtgEDCV+vnjN1MXI wSEiICex80wlSJhZ4C+jRMsyQxBbWCBaYv3NP2BDWQRUJdY+38YOYvMKuEtsad3FAtIqIaAg MWeSDUiYU8BD4v2DlSwgthBQSdufi2wTGHkXMDKsYhRNLUguKE5KzzXUK07MLS7NS9dLzs/d xAgOu2dSOxhXNlgcYhTgYFTi4W1wXREqxJpYVlyZe4hRgoNZSYS3cidQiDclsbIqtSg/vqg0 J7X4EKM0B4uSOO/JfJ9QIYH0xJLU7NTUgtQimCwTB6dUA6PWqVnSE865LVQtl+lUPNhteSj6 7UsfzXvzzVkmsO0MOT4vh8dVIXoz18GKDzHnG3ezL2p6cbQ/79CKmkONDnMs91qUhbyc087K nv7LeLPdbNW7oVfW6zM5VsRrHqi+N3/nvuMnPhVvK2I1u6l0LqBFTsZ0Ef+TZbcOTNwXVHUk OfHg+nzNyXeVWIozEg21mIuKEwGXUnRHNwIAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP LED subsystem shifted responsibility for choosing between SYNC or ASYNC way of setting brightness from drivers to the caller. Adapt the wrapper to those changes. Signed-off-by: Jacek Anaszewski Cc: Sakari Ailus Cc: Pavel Machek Cc: linux-media@vger.kernel.org --- drivers/media/v4l2-core/v4l2-flash-led-class.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-flash-led-class.c b/drivers/media/v4l2-core/v4l2-flash-led-class.c index 5bdfb8d..5d67335 100644 --- a/drivers/media/v4l2-core/v4l2-flash-led-class.c +++ b/drivers/media/v4l2-core/v4l2-flash-led-class.c @@ -107,10 +107,10 @@ static void v4l2_flash_set_led_brightness(struct v4l2_flash *v4l2_flash, if (ctrls[LED_MODE]->val != V4L2_FLASH_LED_MODE_TORCH) return; - led_set_brightness(&v4l2_flash->fled_cdev->led_cdev, + led_set_brightness_sync(&v4l2_flash->fled_cdev->led_cdev, brightness); } else { - led_set_brightness(&v4l2_flash->iled_cdev->led_cdev, + led_set_brightness_sync(&v4l2_flash->iled_cdev->led_cdev, brightness); } } @@ -206,11 +206,11 @@ static int v4l2_flash_s_ctrl(struct v4l2_ctrl *c) case V4L2_CID_FLASH_LED_MODE: switch (c->val) { case V4L2_FLASH_LED_MODE_NONE: - led_set_brightness(led_cdev, LED_OFF); + led_set_brightness_sync(led_cdev, LED_OFF); return led_set_flash_strobe(fled_cdev, false); case V4L2_FLASH_LED_MODE_FLASH: /* Turn the torch LED off */ - led_set_brightness(led_cdev, LED_OFF); + led_set_brightness_sync(led_cdev, LED_OFF); if (ctrls[STROBE_SOURCE]) { external_strobe = (ctrls[STROBE_SOURCE]->val == V4L2_FLASH_STROBE_SOURCE_EXTERNAL);