From patchwork Wed Jun 21 05:24:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhushan Shah X-Patchwork-Id: 9800749 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 90EEF60329 for ; Wed, 21 Jun 2017 05:30:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A11F28516 for ; Wed, 21 Jun 2017 05:30:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A4792851E; Wed, 21 Jun 2017 05:30:34 +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 C633C28516 for ; Wed, 21 Jun 2017 05:30:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751922AbdFUFad (ORCPT ); Wed, 21 Jun 2017 01:30:33 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:33384 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750876AbdFUFac (ORCPT ); Wed, 21 Jun 2017 01:30:32 -0400 Received: by mail-pg0-f68.google.com with SMTP id u62so19838316pgb.0; Tue, 20 Jun 2017 22:30:32 -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; bh=MPIUqEcRoCw5E868PXQvBCynq5OpBq+aICR3WlPHUTI=; b=AXCLoBprQIcPRDZLEzagCYVZnLCzQx3nNLyOb8xmcOjNflm4AKnA9YHS0cePUHbxP+ vY7wfPYC2InksaF852sMVIySqPoGTKJWwJ9EMaZkoUBindiYTu3v/g0IbugvGBQ162Dw QsDuEWjQzxIuHoMNAiyd5FP3JXdBpYuSWQCjeVgM2zBy4rBFgA0wD1ia5aVzms/fDL2S SsMATnvphBonQ+6thnYhm03u+S0EVPJ0r03JcikwXjBERVVgPUiMg/UBjuuODT5jUIFh lzN6yQ9DiOLloMoNHCLssHVz2PrPIjwtKmesIp0vzEx3B50FDLsyk9zE/qt6R0O3dlqP 9iGg== X-Gm-Message-State: AKS2vOwHXQZ8wioCnF9h8x7I3tEtAOtOzqI4+5SIfUkoHTvI1m6o/6he eAF75B5REBGQQw== X-Received: by 10.84.132.73 with SMTP id 67mr6401917ple.53.1498023031813; Tue, 20 Jun 2017 22:30:31 -0700 (PDT) Received: from localhost.localdomain ([123.201.91.86]) by smtp.gmail.com with ESMTPSA id e63sm31038699pfb.18.2017.06.20.22.30.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 22:30:30 -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] backlight: lm3630a: bump REG_MAX value to 0x50 instead of 0x1F Date: Wed, 21 Jun 2017 10:54:50 +0530 Message-Id: <20170621052450.2258-1-bshah@kde.org> X-Mailer: git-send-email 2.13.0 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 --- 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..42496b6c09d0 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, FLTR_STR, 0x03); /* set Cofig. register */ rval |= lm3630a_update(pchip, REG_CONFIG, 0x07, pdata->pwm_ctrl); /* set boost control */