From patchwork Thu Feb 21 13:17:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 10824101 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E86001399 for ; Thu, 21 Feb 2019 13:17:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D776A2E5D0 for ; Thu, 21 Feb 2019 13:17:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB81C2E664; Thu, 21 Feb 2019 13:17:52 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 64BC6303FD for ; Thu, 21 Feb 2019 13:17:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727974AbfBUNRv (ORCPT ); Thu, 21 Feb 2019 08:17:51 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:40025 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726165AbfBUNRv (ORCPT ); Thu, 21 Feb 2019 08:17:51 -0500 Received: by mail-pl1-f195.google.com with SMTP id bj4so14169751plb.7 for ; Thu, 21 Feb 2019 05:17:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ingics-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=i9dnmQKikQDAfv387S9/Csb5/zqc1ZkYICOw/M9dd+4=; b=Clv/6rnSVFy3mxLUnS8/e4lPiCFX4xO7X3SVB4bSl98/yy9VWvZW7my0FXEd2h8xwg hqAZ0RfwHLztIryk3ipkPP+JwdJMVn8LtC179ZAETqHgEU1wIo2WF38p3uGiZR1G0Pbo zN8pFzPuDGldT+KFeenNyJomKgykmn4yMYv/hg+laAXhGypN4o9tnZPttiRNScLw1FAH l2ZqRnnfL/3/ipeqeRExiO691Cil7A0mTr91mQ8WSLEWoHlv/WQERUsCfubM0L/sGAhw 9gojgGGwX/VU6FXHb5c8HPV7iYAdRzNApMcynzhrh8Ys/A1q7vpNNcMJ0bt7MAkaEMEy JNxw== 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=i9dnmQKikQDAfv387S9/Csb5/zqc1ZkYICOw/M9dd+4=; b=VdPOpKNNPSbbi6vSqx5QuMsbS4HQ681t6tmZVjIDUr24gy1zXuSPUBO5Qtb6lwUgiy Jm2yZSAfJxl8nLNC2c9FCMATPaCUDaro/D0ulDhZXGfqwdkCmrPQ312eP6T1O3shqqOw xcrpy09adSj5ft/pC9YMSfewnyEv1+L9cP/MwMu3ltajBO9Kq9U1t+oI7DXlFsfwcTuA jI1i9lXBQtse0vAj/iJaWKxc054D+md+5DN1fWsZa+9/r6B9YuutAPbe5mJdG93olPpv v5w0QJu/iT5IxJF0GIZ1nv9YVw0Uls0Q+B/CXuiEtlnql4f7hr0CxdAg6FWa/74xl09W TnUw== X-Gm-Message-State: AHQUAubFd3JufVph62q4Ugpz/QfH/gjpXfcm/4DztoMMRPNBZGW7soer VFnoYhOBn9xmoDNRD3IUReSsZA== X-Google-Smtp-Source: AHgI3IbJwCIOi+VlW2VQIoJB8pwJn9LYlRseRu45GcuZFaTdBNHZHlkjKFALPbc/nmz2cE7O+mngpA== X-Received: by 2002:a17:902:b01:: with SMTP id 1mr43251258plq.331.1550755070867; Thu, 21 Feb 2019 05:17:50 -0800 (PST) Received: from localhost.localdomain (220-133-186-239.HINET-IP.hinet.net. [220.133.186.239]) by smtp.gmail.com with ESMTPSA id e21sm79046676pfh.45.2019.02.21.05.17.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 05:17:49 -0800 (PST) From: Axel Lin To: Mark Brown Cc: Sangbeom Kim , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , linux-samsung-soc@vger.kernel.org, Liam Girdwood , linux-kernel@vger.kernel.org, Axel Lin Subject: [PATCH 1/2] regulator: s5m8767: Constify s5m8767_opmode_reg Date: Thu, 21 Feb 2019 21:17:21 +0800 Message-Id: <20190221131722.12278-1-axel.lin@ingics.com> X-Mailer: git-send-email 2.17.1 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The s5m8767_opmode_reg should never change, make it const. Signed-off-by: Axel Lin Reviewed-by: Krzysztof Kozlowski --- drivers/regulator/s5m8767.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index b581f01f3395..5b0e1fe6723f 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c @@ -115,7 +115,7 @@ static const struct sec_voltage_desc *reg_voltage_map[] = { [S5M8767_BUCK9] = &buck_voltage_val3, }; -static unsigned int s5m8767_opmode_reg[][4] = { +static const unsigned int s5m8767_opmode_reg[][4] = { /* {OFF, ON, LOWPOWER, SUSPEND} */ /* LDO1 ... LDO28 */ {0x0, 0x3, 0x2, 0x1}, /* LDO1 */ From patchwork Thu Feb 21 13:17:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 10824103 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A93671399 for ; Thu, 21 Feb 2019 13:17:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98A312E664 for ; Thu, 21 Feb 2019 13:17:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CF31303FB; Thu, 21 Feb 2019 13:17:59 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 438362E664 for ; Thu, 21 Feb 2019 13:17:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728006AbfBUNRy (ORCPT ); Thu, 21 Feb 2019 08:17:54 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43685 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726113AbfBUNRy (ORCPT ); Thu, 21 Feb 2019 08:17:54 -0500 Received: by mail-pl1-f195.google.com with SMTP id m10so4511287plt.10 for ; Thu, 21 Feb 2019 05:17:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ingics-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Z4WPpNvqATEqflSPwYUzMl3muuVuJNYbX37LQ5kTos0=; b=cYND5pZ1RjYAKsI8X/nSYC3vb41LMgF5K5SHWRAh2eHO9dQaxpif98SFORXP16GJ3f oreBrm0HGi2/rRsBGpwlrfWa6MWPH8lWwOS87FDkmKb04KeZpSvsjC8g3HLt3Ev59dRw CNFUhmAsyemXhnjW+o85wItMkF3ewjnRhdxHg35DRIMjexdafyhytyw3SYkn5NuvYaon 2p45Lcd4HyLbQFmdpvHLJCnA7+nNM5y5Sep2yrZzk4BntP4qifwi99WEydkAygJPqzxE B6RF1Ff1f7nfZ18R11k+khnGdJrU1P+EhVFF4KzIU1nMUQ5Bh6JBJT9Wiu+5uPewUf8j p+bQ== 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=Z4WPpNvqATEqflSPwYUzMl3muuVuJNYbX37LQ5kTos0=; b=qrEsiAV7zKOfsOKqPy6cXXuK/7+vdLKrD9TLFKBssRcNT3IwI405tCZpP+JLUt+STD 0we/YQsei1f084IaRqdNuw3jc/wmREAXK6GPFJ2FxyidHqZIDSuSSQvIzKAceUe8SMzC zOQLvVkMGP5gvlBLE1WlrhFncx1b4FjC/2RJi/artXaRXH9Vcwqjh0zf8pAIosngFlek W96LqM4EQjtZM1bhdjAyusvdhM/u6tkiE+B5qEMQcj0Xhgbc0TV9D1y8thTSWND+hf1m 43CdmSVlfycfydvatXI7AyoIEARpHkg4u4g5yeRwuXkhaNEG6R5l7ZFTipK//teyEBUK Gq1w== X-Gm-Message-State: AHQUAuYtNcVt5q2qsoMDEg+YtEE/BlIe1nzbggSh3TzNq5KsbBdg/5/P JIhrnRR2q4jySJeHYwtmPMQvCA== X-Google-Smtp-Source: AHgI3IZgMgxx2VnsBPn3yEVzdeb9/YCv0OhSrmuAl2Q3gfov6iMisnXsXI4QFahe7Rka4xcVrXtNCg== X-Received: by 2002:a17:902:1101:: with SMTP id d1mr9323067pla.19.1550755073905; Thu, 21 Feb 2019 05:17:53 -0800 (PST) Received: from localhost.localdomain (220-133-186-239.HINET-IP.hinet.net. [220.133.186.239]) by smtp.gmail.com with ESMTPSA id e21sm79046676pfh.45.2019.02.21.05.17.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 05:17:53 -0800 (PST) From: Axel Lin To: Mark Brown Cc: Sangbeom Kim , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , linux-samsung-soc@vger.kernel.org, Liam Girdwood , linux-kernel@vger.kernel.org, Axel Lin Subject: [PATCH 2/2] regulator: s5m8767: Simplify s5m8767_set_voltage_time_sel implementation Date: Thu, 21 Feb 2019 21:17:22 +0800 Message-Id: <20190221131722.12278-2-axel.lin@ingics.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190221131722.12278-1-axel.lin@ingics.com> References: <20190221131722.12278-1-axel.lin@ingics.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Axel Lin Reviewed-by: Krzysztof Kozlowski --- drivers/regulator/s5m8767.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index 5b0e1fe6723f..bb9d1a083299 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c @@ -339,13 +339,9 @@ static int s5m8767_set_voltage_time_sel(struct regulator_dev *rdev, unsigned int new_sel) { struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); - const struct sec_voltage_desc *desc; - int reg_id = rdev_get_id(rdev); - - desc = reg_voltage_map[reg_id]; if ((old_sel < new_sel) && s5m8767->ramp_delay) - return DIV_ROUND_UP(desc->step * (new_sel - old_sel), + return DIV_ROUND_UP(rdev->desc->uV_step * (new_sel - old_sel), s5m8767->ramp_delay * 1000); return 0; }