From patchwork Wed Jun 21 05:31:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhushan Shah X-Patchwork-Id: 9800753 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4DE5B60329 for ; Wed, 21 Jun 2017 05:35:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 359582851A for ; Wed, 21 Jun 2017 05:35:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27D4328521; Wed, 21 Jun 2017 05:35:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 909F92851A for ; Wed, 21 Jun 2017 05:35:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752350AbdFUFfi (ORCPT ); Wed, 21 Jun 2017 01:35:38 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34269 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750876AbdFUFfh (ORCPT ); Wed, 21 Jun 2017 01:35:37 -0400 Received: by mail-pg0-f67.google.com with SMTP id j186so25479470pge.1; Tue, 20 Jun 2017 22:35:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/ZQZdUNrxpP29eAtEYDZ5d1Tk08+D1CNJOrlAbwTJgI=; b=jlwpXBk4UEi15mL4/6swccwV9u1k1ygdzDOyY2r/fNftaSwzFxetsQNe94A4nwp5U0 GAbHXc/wy3vHqmnsyOiUxC5+WUPwYxnVyWDSarRXDHkHyQk7Di9zRCrOQ7vcqQ+zj+WM Q7TKR/8pSIq0t2lorIRAuQREnXV8K2j2ebxvqo8Qx8kurO2dQnNTtpQI8x20Fx/jCgXh UfZbPLXuXRcSO84gKU4G6ich2lyKbaecGblGj6oIWToIg15Zk5gwnl+/6CNsN8LT0bQT r83yaxq+InYvsgujSTL3hFhLTEpbVpT72+VdeyWkqikfJ2YtWltfFeQAPjXlYHH86Ky5 gFlQ== X-Gm-Message-State: AKS2vOwPaatrkHQ+BonyX7TDuqg/uLVs82MkmOhYsKXXLDvaj4Sf11AH GYA6OpKx6dR0Pw== X-Received: by 10.84.197.129 with SMTP id n1mr39569658pld.179.1498023336572; Tue, 20 Jun 2017 22:35:36 -0700 (PDT) Received: from localhost.localdomain ([123.201.91.86]) by smtp.gmail.com with ESMTPSA id e2sm31775853pfg.36.2017.06.20.22.35.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 22:35:35 -0700 (PDT) From: Bhushan Shah To: Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bhushan Shah Subject: [PATCH v2] backlight: lm3630a: bump REG_MAX value to 0x50 instead of 0x1F Date: Wed, 21 Jun 2017 11:01:52 +0530 Message-Id: <20170621053152.3008-1-bshah@kde.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170621052450.2258-1-bshah@kde.org> References: <20170621052450.2258-1-bshah@kde.org> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In the lm3630a_chip_init we try to write to 0x50 register, which is higher value then the max_register value, this resulted in regmap_write return -EIO. Fix this by bumping REG_MAX value to 0x50. Signed-off-by: Bhushan Shah Suggested-by: Bjorn Andersson --- Changes since v1: - Fix the lm3630a_write call to use proper value (sent worng patch earlier) drivers/video/backlight/lm3630a_bl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c index 60d6c2ac87aa..b641f706dbc9 100644 --- a/drivers/video/backlight/lm3630a_bl.c +++ b/drivers/video/backlight/lm3630a_bl.c @@ -31,7 +31,8 @@ #define REG_FAULT 0x0B #define REG_PWM_OUTLOW 0x12 #define REG_PWM_OUTHIGH 0x13 -#define REG_MAX 0x1F +#define REG_FLTR_STR 0x50 +#define REG_MAX 0x50 #define INT_DEBOUNCE_MSEC 10 struct lm3630a_chip { @@ -80,7 +81,7 @@ static int lm3630a_chip_init(struct lm3630a_chip *pchip) usleep_range(1000, 2000); /* set Filter Strength Register */ - rval = lm3630a_write(pchip, 0x50, 0x03); + rval = lm3630a_write(pchip, REG_FLTR_STR, 0x03); /* set Cofig. register */ rval |= lm3630a_update(pchip, REG_CONFIG, 0x07, pdata->pwm_ctrl); /* set boost control */