Commit Graph

6 Commits

Author SHA1 Message Date
Krzysztof Kozlowski b29f42c662
regulator: max77857: Fix Wvoid-pointer-to-enum-cast warning
'id' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  max77857-regulator.c:56:24: error: cast to smaller integer type 'enum max77857_id' from 'void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810111914.204847-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-10 15:44:45 +01:00
Yang Yingliang 93083725e1
regulator: max77857: fix build error in max77857-regulator.c
When using low verion gcc(7.5) to build the max77857-regulator driver,
got the following error:

drivers/regulator/max77857-regulator.c:312:16: error: initializer element is not constant
  .ramp_delay = max77857_ramp_table[0][0],

To fix this by introducing a macro RAMAP_DELAY_INIT_VAL to define the
value of max77857_ramp_table[0[0].

Fixes: af71cccade ("regulator: max77857: Add ADI MAX77857/59/MAX77831 Regulator Support")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230803113654.818640-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-03 15:57:36 +01:00
Yang Yingliang 39b5ba6cb5
regulator: max77857: change some variables to static
max77857_regmap_config and max77857_driver are only used
in max77857-regulator.c now, change them to static.

Fixes: af71cccade ("regulator: max77857: Add ADI MAX77857/59/MAX77831 Regulator Support")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230801130354.552243-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-08-01 16:02:22 +01:00
Arnd Bergmann 541e75954c
regulator: max77857: mark more functions static
A few functions in the new driver are global but only used in this file:

drivers/regulator/max77857-regulator.c:209:5: error: no previous prototype for 'max77859_get_voltage_sel' [-Werror=missing-prototypes]
drivers/regulator/max77857-regulator.c:221:5: error: no previous prototype for 'max77859_set_current_limit' [-Werror=missing-prototypes]
drivers/regulator/max77857-regulator.c:235:5: error: no previous prototype for 'max77859_get_current_limit' [-Werror=missing-prototypes]

Mark them static, which produces potentially better code and avoids the warning.

Fixes: af71cccade ("regulator: max77857: Add ADI MAX77857/59/MAX77831 Regulator Support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230718193938.3593118-1-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-19 14:00:47 +01:00
Uwe Kleine-König 2920e08bef
regulator: max77857: Switch back to use struct i2c_driver's .probe()
After commit b8a1a4cd5a ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
commit 03c835f498 ("i2c: Switch .probe() to not take an id parameter")
convert back to (the new) .probe() to be able to eventually drop
.probe_new() from struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230718201453.3953602-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-19 14:00:46 +01:00
Okan Sahin af71cccade
regulator: max77857: Add ADI MAX77857/59/MAX77831 Regulator Support
Regulator driver for  MAX77857/59 and MAX77831.
The MAX77857 is a high-efficiency, high-performance
buck-boost converter targeted for systems requiring
a wide input voltage range (2.5V to 16V).

The MAX77859 is high-Efficiency Buck-Boost Converter
for USB-PD/PPS Applications. It has wide input range
(2.5V to 22V)

The MAX77831 is a high-efficiency, high-performance
buck-boost converter targeted for systems requiring
wide input voltage range (2.5V to 16V).

Signed-off-by: Okan Sahin <okan.sahin@analog.com>
Link: https://lore.kernel.org/r/20230717050736.10075-3-okan.sahin@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-07-17 06:40:32 +01:00