From patchwork Mon Sep 28 13:07:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Anaszewski X-Patchwork-Id: 7277471 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 2759D9F36A for ; Mon, 28 Sep 2015 13:08:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 36FFB20726 for ; Mon, 28 Sep 2015 13:08:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 47C7720721 for ; Mon, 28 Sep 2015 13:08:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933866AbbI1NIH (ORCPT ); Mon, 28 Sep 2015 09:08:07 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:54500 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933854AbbI1NIE (ORCPT ); Mon, 28 Sep 2015 09:08:04 -0400 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NVE00N2B1SWMP90@mailout4.samsung.com>; Mon, 28 Sep 2015 22:08:03 +0900 (KST) X-AuditID: cbfee61b-f79d56d0000048c5-08-56093bb2ae98 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id D4.86.18629.2BB39065; Mon, 28 Sep 2015 22:08:03 +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 <0NVE005PU1SC7X00@mmp2.samsung.com>; Mon, 28 Sep 2015 22:08:02 +0900 (KST) From: Jacek Anaszewski To: linux-leds@vger.kernel.org Cc: linux-kernel@vger.kernel.org, sakari.ailus@linux.intel.com, andrew@lunn.ch, rpurdie@rpsys.net, Jacek Anaszewski , Pavel Machek , linux-media@vger.kernel.org Subject: [PATCH v2 12/12] media: flash: use led_set_brightness_sync for torch brightness Date: Mon, 28 Sep 2015 15:07:21 +0200 Message-id: <1443445641-9529-13-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1443445641-9529-1-git-send-email-j.anaszewski@samsung.com> References: <1443445641-9529-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprLLMWRmVeSWpSXmKPExsVy+t9jQd3N1pxhBrP+s1icv3uI2aL36nNG i8u75rBZbH2zjtGiZ8NWVou7p46yWeze9ZTV4tOWb0wOHB7zTgZ67Nzxmcljz/wfrB59W1Yx eqxY/Z3d4/MmuQC2KC6blNSczLLUIn27BK6M5fP9Czr4Kp5Mm8PawPiHu4uRk0NCwESi79sh dghbTOLCvfVsXYxcHEICsxglHk9tZoVwfjJKzJv2gAWkik3AUOLni9dMXYwcHCICchI7z1SC hJkFzjBKvP+rAGILC0RJbNx8jhnEZhFQlfg9+yWYzSvgITFj4wtGkFYJAQWJOZNsQMKcQOH1 37uZQGwhAXeJh7vPs01g5F3AyLCKUSK1ILmgOCk91ygvtVyvODG3uDQvXS85P3cTIzjQnknv YDy8y/0QowAHoxIP7wdNjjAh1sSy4srcQ4wSHMxKIrxOopxhQrwpiZVVqUX58UWlOanFhxil OViUxHlvHGIIExJITyxJzU5NLUgtgskycXBKNTBu8khflF1kXaUw/3LuSqkF2lp8YhoPW5f4 XeE+UzXLaWZ191/BFOGG6ovaPpfneyb6VIjPfOk4R6zix4T360ykimXvWaybdMouXjTg2y3X iessotbFCx68JTu5xlT3wZM1yqVNJ9JF1n9wMpqfZepQtPUL7/WjEru4ZfuzDwb92/zHXtTv d7sSS3FGoqEWc1FxIgAkOMRxMAIAAA== 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 --- 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);