* [PATCH 1/2] regulator: s5m8767: Constify s5m8767_opmode_reg
@ 2019-02-21 13:17 Axel Lin
2019-02-21 13:17 ` [PATCH 2/2] regulator: s5m8767: Simplify s5m8767_set_voltage_time_sel implementation Axel Lin
2019-02-21 13:22 ` [PATCH 1/2] regulator: s5m8767: Constify s5m8767_opmode_reg Krzysztof Kozlowski
0 siblings, 2 replies; 4+ messages in thread
From: Axel Lin @ 2019-02-21 13:17 UTC (permalink / raw)
To: Mark Brown
Cc: Sangbeom Kim, Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz,
linux-samsung-soc, Liam Girdwood, linux-kernel, Axel Lin
The s5m8767_opmode_reg should never change, make it const.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
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 */
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] regulator: s5m8767: Simplify s5m8767_set_voltage_time_sel implementation
2019-02-21 13:17 [PATCH 1/2] regulator: s5m8767: Constify s5m8767_opmode_reg Axel Lin
@ 2019-02-21 13:17 ` Axel Lin
2019-02-21 13:38 ` Krzysztof Kozlowski
2019-02-21 13:22 ` [PATCH 1/2] regulator: s5m8767: Constify s5m8767_opmode_reg Krzysztof Kozlowski
1 sibling, 1 reply; 4+ messages in thread
From: Axel Lin @ 2019-02-21 13:17 UTC (permalink / raw)
To: Mark Brown
Cc: Sangbeom Kim, Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz,
linux-samsung-soc, Liam Girdwood, linux-kernel, Axel Lin
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
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;
}
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] regulator: s5m8767: Constify s5m8767_opmode_reg
2019-02-21 13:17 [PATCH 1/2] regulator: s5m8767: Constify s5m8767_opmode_reg Axel Lin
2019-02-21 13:17 ` [PATCH 2/2] regulator: s5m8767: Simplify s5m8767_set_voltage_time_sel implementation Axel Lin
@ 2019-02-21 13:22 ` Krzysztof Kozlowski
1 sibling, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2019-02-21 13:22 UTC (permalink / raw)
To: Axel Lin
Cc: Mark Brown, Sangbeom Kim, Bartlomiej Zolnierkiewicz,
linux-samsung-soc, Liam Girdwood, linux-kernel
On Thu, 21 Feb 2019 at 14:17, Axel Lin <axel.lin@ingics.com> wrote:
>
> The s5m8767_opmode_reg should never change, make it const.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> drivers/regulator/s5m8767.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] regulator: s5m8767: Simplify s5m8767_set_voltage_time_sel implementation
2019-02-21 13:17 ` [PATCH 2/2] regulator: s5m8767: Simplify s5m8767_set_voltage_time_sel implementation Axel Lin
@ 2019-02-21 13:38 ` Krzysztof Kozlowski
0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2019-02-21 13:38 UTC (permalink / raw)
To: Axel Lin
Cc: Mark Brown, Sangbeom Kim, Bartlomiej Zolnierkiewicz,
linux-samsung-soc, Liam Girdwood, linux-kernel
On Thu, 21 Feb 2019 at 14:17, Axel Lin <axel.lin@ingics.com> wrote:
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> drivers/regulator/s5m8767.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-02-21 13:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-21 13:17 [PATCH 1/2] regulator: s5m8767: Constify s5m8767_opmode_reg Axel Lin
2019-02-21 13:17 ` [PATCH 2/2] regulator: s5m8767: Simplify s5m8767_set_voltage_time_sel implementation Axel Lin
2019-02-21 13:38 ` Krzysztof Kozlowski
2019-02-21 13:22 ` [PATCH 1/2] regulator: s5m8767: Constify s5m8767_opmode_reg Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®