Message ID | 7a6727838bcc93f443c993d91d21d9306dee22be.1585902279.git.matti.vaittinen@fi.rohmeurope.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Support ROHM BD99954 charger IC | expand |
Hi, On Fri, Apr 03, 2020 at 11:46:30AM +0300, Matti Vaittinen wrote: > Follow-up patches in this series will add a generic struct > linear_range. Rename bd70528 internal struct to avoid collision. > > Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> > --- Actually the patch is before this one. But since the include is not yet used in the bd70528 charger driver, it should be ok to do it in this order. Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> -- Sebastian > > No changes since v7 > > drivers/power/supply/bd70528-charger.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/power/supply/bd70528-charger.c b/drivers/power/supply/bd70528-charger.c > index b8e1ec106627..3b820110ecfa 100644 > --- a/drivers/power/supply/bd70528-charger.c > +++ b/drivers/power/supply/bd70528-charger.c > @@ -335,14 +335,14 @@ static int bd70528_get_present(struct bd70528_psy *bdpsy, int *val) > return 0; > } > > -struct linear_range { > +struct bd70528_linear_range { > int min; > int step; > int vals; > int low_sel; > }; > > -static const struct linear_range current_limit_ranges[] = { > +static const struct bd70528_linear_range current_limit_ranges[] = { > { > .min = 5, > .step = 1, > @@ -374,7 +374,7 @@ static const struct linear_range current_limit_ranges[] = { > * voltage for low temperatures. The driver currently only reads > * the charge current at room temperature. We do set both though. > */ > -static const struct linear_range warm_charge_curr[] = { > +static const struct bd70528_linear_range warm_charge_curr[] = { > { > .min = 10, > .step = 10, > @@ -398,7 +398,7 @@ static const struct linear_range warm_charge_curr[] = { > #define MAX_WARM_CHG_CURR_SEL 0x1f > #define MIN_CHG_CURR_SEL 0x0 > > -static int find_value_for_selector_low(const struct linear_range *r, > +static int find_value_for_selector_low(const struct bd70528_linear_range *r, > int selectors, unsigned int sel, > unsigned int *val) > { > @@ -420,7 +420,7 @@ static int find_value_for_selector_low(const struct linear_range *r, > * I guess it is enough if we use voltage/current which is closest (below) > * the requested? > */ > -static int find_selector_for_value_low(const struct linear_range *r, > +static int find_selector_for_value_low(const struct bd70528_linear_range *r, > int selectors, unsigned int val, > unsigned int *sel, bool *found) > { > -- > 2.21.0 > > > -- > Matti Vaittinen, Linux device drivers > ROHM Semiconductors, Finland SWDC > Kiviharjunlenkki 1E > 90220 OULU > FINLAND > > ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ > Simon says - in Latin please. > ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ > Thanks to Simon Glass for the translation =]
Hello Sebastian, Thanks for all the reviews :) On Sun, 2020-04-05 at 05:33 +0200, Sebastian Reichel wrote: > Hi, > > On Fri, Apr 03, 2020 at 11:46:30AM +0300, Matti Vaittinen wrote: > > Follow-up patches in this series will add a generic struct > > linear_range. Rename bd70528 internal struct to avoid collision. > > > > Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> > > --- > > Actually the patch is before this one. But since the include is not > yet used in the bd70528 charger driver, it should be ok to do it in > this order. You are correct. Just a thing to note (you suggested rebasing the regulator stuff and linear ranges to be first patches in the series): This patch still needs to be applied before [PATCH v8 06/10] regulator: use linear_ranges helper because the regulator header definitions get included via MFD headers: linux/mfd/rohm-bd70528.h => linux/mfd/rohm-generic.h => linux/regulator/driver.h And linux/regulator/driver.h will be including the linear_range definitions when "regulator: use linear_ranges helper" gets included. Br, Matti Vaittinen
diff --git a/drivers/power/supply/bd70528-charger.c b/drivers/power/supply/bd70528-charger.c index b8e1ec106627..3b820110ecfa 100644 --- a/drivers/power/supply/bd70528-charger.c +++ b/drivers/power/supply/bd70528-charger.c @@ -335,14 +335,14 @@ static int bd70528_get_present(struct bd70528_psy *bdpsy, int *val) return 0; } -struct linear_range { +struct bd70528_linear_range { int min; int step; int vals; int low_sel; }; -static const struct linear_range current_limit_ranges[] = { +static const struct bd70528_linear_range current_limit_ranges[] = { { .min = 5, .step = 1, @@ -374,7 +374,7 @@ static const struct linear_range current_limit_ranges[] = { * voltage for low temperatures. The driver currently only reads * the charge current at room temperature. We do set both though. */ -static const struct linear_range warm_charge_curr[] = { +static const struct bd70528_linear_range warm_charge_curr[] = { { .min = 10, .step = 10, @@ -398,7 +398,7 @@ static const struct linear_range warm_charge_curr[] = { #define MAX_WARM_CHG_CURR_SEL 0x1f #define MIN_CHG_CURR_SEL 0x0 -static int find_value_for_selector_low(const struct linear_range *r, +static int find_value_for_selector_low(const struct bd70528_linear_range *r, int selectors, unsigned int sel, unsigned int *val) { @@ -420,7 +420,7 @@ static int find_value_for_selector_low(const struct linear_range *r, * I guess it is enough if we use voltage/current which is closest (below) * the requested? */ -static int find_selector_for_value_low(const struct linear_range *r, +static int find_selector_for_value_low(const struct bd70528_linear_range *r, int selectors, unsigned int val, unsigned int *sel, bool *found) {
Follow-up patches in this series will add a generic struct linear_range. Rename bd70528 internal struct to avoid collision. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> --- No changes since v7 drivers/power/supply/bd70528-charger.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)