From patchwork Fri Jan 9 15:22:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacek Anaszewski X-Patchwork-Id: 5600921 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 B1986C058D for ; Fri, 9 Jan 2015 15:33:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 01FCD2044C for ; Fri, 9 Jan 2015 15:33:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ADB1B2051C for ; Fri, 9 Jan 2015 15:33:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932715AbbAIPYJ (ORCPT ); Fri, 9 Jan 2015 10:24:09 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:26711 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932668AbbAIPYF (ORCPT ); Fri, 9 Jan 2015 10:24:05 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NHX00IXO1G35A90@mailout4.samsung.com>; Sat, 10 Jan 2015 00:24:03 +0900 (KST) X-AuditID: cbfee61b-f79d76d0000024d6-54-54aff292b2f7 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id F6.B6.09430.292FFA45; Sat, 10 Jan 2015 00:24:03 +0900 (KST) Received: from AMDC2362.DIGITAL.local ([106.120.53.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NHX003F51EOLH20@mmp2.samsung.com>; Sat, 10 Jan 2015 00:24:02 +0900 (KST) From: Jacek Anaszewski To: linux-leds@vger.kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: devicetree@vger.kernel.org, kyungmin.park@samsung.com, b.zolnierkie@samsung.com, pavel@ucw.cz, cooloney@gmail.com, rpurdie@rpsys.net, sakari.ailus@iki.fi, s.nawrocki@samsung.com, Jacek Anaszewski , Chanwoo Choi , Lee Jones Subject: [PATCH/RFC v10 07/19] mfd: max77693: Adjust FLASH_EN_SHIFT and TORCH_EN_SHIFT macros Date: Fri, 09 Jan 2015 16:22:57 +0100 Message-id: <1420816989-1808-8-git-send-email-j.anaszewski@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1420816989-1808-1-git-send-email-j.anaszewski@samsung.com> References: <1420816989-1808-1-git-send-email-j.anaszewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrDLMWRmVeSWpSXmKPExsVy+t9jQd3Jn9aHGNx/xWyxccZ6VoujOycy WVz/8pzVYv6Rc6wWvVefM1qcbXrDbnH/61FGi8u75rBZbH2zjtGiZ8NWVou7p46yWeze9ZTV 4vCbdlaLM/tXsjnweeycdZfd4/DXhSwed67tYfPYM/8Hq0ffllWMHitWf2f3+LxJLoA9issm JTUnsyy1SN8ugSvj0+mtzAU7OCp2PD3O1MDYz97FyMkhIWAisXX9HxYIW0ziwr31bF2MXBxC AtMZJbb0NLBCOO1MEs2/5jOBVLEJGEr8fPEayObgEBGIlrh0rB4kzCywiUli11ddEFtYIF5i 9aedrCA2i4CqxLnG+ywg5bwC7hLNH3JATAkBBYk5k2xATE4BD4mW304gphBQwZurhhMYeRcw MqxiFE0tSC4oTkrPNdIrTswtLs1L10vOz93ECA7TZ9I7GFc1WBxiFOBgVOLh3SC3PkSINbGs uDL3EKMEB7OSCG/DZqAQb0piZVVqUX58UWlOavEhRmkOFiVxXiX7thAhgfTEktTs1NSC1CKY LBMHp1QDI4NtrJBpncaG3LJqo1O1Sx+GVVyXjZ8T4Zu+aMdD7ceGexP+3FNZp7Nrk+38+y4T XuUfn1Uk4KGaEfCh7NBWy3v7t7F2avtvsmIK3fjnXOKEc12tr4//m3zu1H75ImEGPsH2Dy1h 9/9mXBdJSP6cwlIRL3BvCo/kT8PQ828KqzYdXyrcmevrp8RSnJFoqMVcVJwIAKYCpGdPAgAA 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 Modify FLASH_EN_SHIFT and TORCH_EN_SHIFT macros to work properly when passed enum max77693_fled values (0 for FLED1 and 1 for FLED2) from leds-max77693 driver. Signed-off-by: Jacek Anaszewski Acked-by: Kyungmin Park Cc: Chanwoo Choi Cc: Lee Jones Acked-by: Pavel Machek --- include/linux/mfd/max77693-private.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h index 08dae01..01799a9 100644 --- a/include/linux/mfd/max77693-private.h +++ b/include/linux/mfd/max77693-private.h @@ -113,8 +113,8 @@ enum max77693_pmic_reg { #define FLASH_EN_FLASH 0x1 #define FLASH_EN_TORCH 0x2 #define FLASH_EN_ON 0x3 -#define FLASH_EN_SHIFT(x) (6 - ((x) - 1) * 2) -#define TORCH_EN_SHIFT(x) (2 - ((x) - 1) * 2) +#define FLASH_EN_SHIFT(x) (6 - (x) * 2) +#define TORCH_EN_SHIFT(x) (2 - (x) * 2) /* MAX77693 MAX_FLASH1 register */ #define MAX_FLASH1_MAX_FL_EN 0x80