From patchwork Wed Oct 7 09:10:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Anaszewski X-Patchwork-Id: 7343201 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 49A8EBEEA4 for ; Wed, 7 Oct 2015 09:11:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 763A52063F for ; Wed, 7 Oct 2015 09:11:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 82DFA205EA for ; Wed, 7 Oct 2015 09:11:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752912AbbJGJL1 (ORCPT ); Wed, 7 Oct 2015 05:11:27 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:52747 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752800AbbJGJLY (ORCPT ); Wed, 7 Oct 2015 05:11:24 -0400 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NVU02JOCEU7Y140@mailout4.samsung.com>; Wed, 07 Oct 2015 18:11:22 +0900 (KST) X-AuditID: cbfee61a-f79a06d000005c6f-59-5614e1ba6fbc Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id F3.20.23663.AB1E4165; Wed, 7 Oct 2015 18:11:22 +0900 (KST) Received: from AMDC2362.DIGITAL.local ([106.120.53.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NVU00CWPEU2ANR0@mmp2.samsung.com>; Wed, 07 Oct 2015 18:11:22 +0900 (KST) From: Jacek Anaszewski To: linux-leds@vger.kernel.org Cc: linux-kernel@vger.kernel.org, pavel@ucw.cz, sakari.ailus@linux.intel.com, andrew@lunn.ch, Jacek Anaszewski , linux-media@vger.kernel.org Subject: [PATCH v3 10/10] media: flash: use led_set_brightness_sync for torch brightness Date: Wed, 07 Oct 2015 11:10:48 +0200 Message-id: <1444209048-29415-11-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1444209048-29415-1-git-send-email-j.anaszewski@samsung.com> References: <1444209048-29415-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprCLMWRmVeSWpSXmKPExsVy+t9jQd1dD0XCDJrXq1mcv3uI2aL36nNG i8u75rBZbH2zjtGiZ8NWVou7p46yWXza8o3Jgd1j3slAj507PjN59G1ZxeixYvV3do/Pm+QC WKO4bFJSczLLUov07RK4MpbP9y/o4Kt4Mm0OawPjH+4uRk4OCQETicaZHxkhbDGJC/fWs3Ux cnEICcxilHh+9ycrhPOTUeLskRnsIFVsAoYSP1+8Zupi5OAQEZCT2HmmEqSGWWAVo8TS6xPA aoQFoiR6Nj8As1kEVCUmH/nBBGLzCnhKvFh1kwWkV0JAQWLOJBuQMCdQuLH3BFiJkICHxOFf X9gmMPIuYGQAmplakFxQnJSea5iXWq5XnJhbXJqXrpecn7uJERxWz6R2MB7c5X6IUYCDUYmH 94exSJgQa2JZcWXuIUYJDmYlEd6F94BCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeW8cYggTEkhP LEnNTk0tSC2CyTJxcEo1MGrVVtjN31Z7yPmyS9qRtnXz5yxb8Vkq9MDus7IyKQvq5fn+PP0g fHJFn/q6gxv7tv5xXLIldfKim3VnG0xkvgpU12exbn6iwnHkSE1E74+ds49/Xpzbc2vpfe+c HHPpmLJDB+PCPQMFL1vxXbc4xqSzvibpkr8A1xnO0GCGsqB+Fq8pFu1nK5RYijMSDbWYi4oT AXNNhEwnAgAA Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 Acked-by: Pavel Machek Acked-by: Mauro Carvalho Chehab --- 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);