All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] power: supply: bq25890_charger: Add the BQ25895 part
@ 2019-07-05 11:37 Angus Ainslie (Purism)
  2019-07-10  8:49 ` Krzysztof Kozlowski
  2019-09-02 19:13 ` Sebastian Reichel
  0 siblings, 2 replies; 3+ messages in thread
From: Angus Ainslie (Purism) @ 2019-07-05 11:37 UTC (permalink / raw)
  To: angus.ainslie
  Cc: krzk, Sebastian Reichel, linux-pm, linux-kernel, Angus Ainslie (Purism)

The BQ25895 is almost identical to the BQ25890.

Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca>
---
 drivers/power/supply/bq25890_charger.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
index d333f2b321b9..9d1ec8d677de 100644
--- a/drivers/power/supply/bq25890_charger.c
+++ b/drivers/power/supply/bq25890_charger.c
@@ -22,6 +22,7 @@
 #define BQ25890_IRQ_PIN			"bq25890_irq"
 
 #define BQ25890_ID			3
+#define BQ25895_ID			7
 #define BQ25896_ID			0
 
 enum bq25890_fields {
@@ -171,7 +172,7 @@ static const struct reg_field bq25890_reg_fields[] = {
 	[F_WD]			= REG_FIELD(0x07, 4, 5),
 	[F_TMR_EN]		= REG_FIELD(0x07, 3, 3),
 	[F_CHG_TMR]		= REG_FIELD(0x07, 1, 2),
-	[F_JEITA_ISET]		= REG_FIELD(0x07, 0, 0),
+	[F_JEITA_ISET]		= REG_FIELD(0x07, 0, 0), // reserved on BQ25895
 	/* REG08 */
 	[F_BATCMP]		= REG_FIELD(0x08, 5, 7),
 	[F_VCLAMP]		= REG_FIELD(0x08, 2, 4),
@@ -180,7 +181,7 @@ static const struct reg_field bq25890_reg_fields[] = {
 	[F_FORCE_ICO]		= REG_FIELD(0x09, 7, 7),
 	[F_TMR2X_EN]		= REG_FIELD(0x09, 6, 6),
 	[F_BATFET_DIS]		= REG_FIELD(0x09, 5, 5),
-	[F_JEITA_VSET]		= REG_FIELD(0x09, 4, 4),
+	[F_JEITA_VSET]		= REG_FIELD(0x09, 4, 4), // reserved on BQ25895
 	[F_BATFET_DLY]		= REG_FIELD(0x09, 3, 3),
 	[F_BATFET_RST_EN]	= REG_FIELD(0x09, 2, 2),
 	[F_PUMPX_UP]		= REG_FIELD(0x09, 1, 1),
@@ -188,7 +189,7 @@ static const struct reg_field bq25890_reg_fields[] = {
 	/* REG0A */
 	[F_BOOSTV]		= REG_FIELD(0x0A, 4, 7),
 	/* PFM_OTG_DIS 3 on BQ25896 */
-	[F_BOOSTI]		= REG_FIELD(0x0A, 0, 2),
+	[F_BOOSTI]		= REG_FIELD(0x0A, 0, 2), // reserved on BQ25895
 	/* REG0B */
 	[F_VBUS_STAT]		= REG_FIELD(0x0B, 5, 7),
 	[F_CHG_STAT]		= REG_FIELD(0x0B, 3, 4),
@@ -392,6 +393,8 @@ static int bq25890_power_supply_get_property(struct power_supply *psy,
 	case POWER_SUPPLY_PROP_MODEL_NAME:
 		if (bq->chip_id == BQ25890_ID)
 			val->strval = "BQ25890";
+		else if (bq->chip_id == BQ25895_ID)
+			val->strval = "BQ25895";
 		else if (bq->chip_id == BQ25896_ID)
 			val->strval = "BQ25896";
 		else
@@ -862,7 +865,8 @@ static int bq25890_probe(struct i2c_client *client,
 		return bq->chip_id;
 	}
 
-	if ((bq->chip_id != BQ25890_ID) && (bq->chip_id != BQ25896_ID)) {
+	if ((bq->chip_id != BQ25890_ID) && (bq->chip_id != BQ25895_ID)
+			&& (bq->chip_id != BQ25896_ID)) {
 		dev_err(dev, "Chip with ID=%d, not supported!\n", bq->chip_id);
 		return -ENODEV;
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] power: supply: bq25890_charger: Add the BQ25895 part
  2019-07-05 11:37 [PATCH] power: supply: bq25890_charger: Add the BQ25895 part Angus Ainslie (Purism)
@ 2019-07-10  8:49 ` Krzysztof Kozlowski
  2019-09-02 19:13 ` Sebastian Reichel
  1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2019-07-10  8:49 UTC (permalink / raw)
  To: Angus Ainslie (Purism)
  Cc: angus.ainslie, Sebastian Reichel, linux-pm, linux-kernel

On Fri, 5 Jul 2019 at 13:38, Angus Ainslie (Purism) <angus@akkea.ca> wrote:
>
> The BQ25895 is almost identical to the BQ25890.
>
> Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca>
> ---
>  drivers/power/supply/bq25890_charger.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] power: supply: bq25890_charger: Add the BQ25895 part
  2019-07-05 11:37 [PATCH] power: supply: bq25890_charger: Add the BQ25895 part Angus Ainslie (Purism)
  2019-07-10  8:49 ` Krzysztof Kozlowski
@ 2019-09-02 19:13 ` Sebastian Reichel
  1 sibling, 0 replies; 3+ messages in thread
From: Sebastian Reichel @ 2019-09-02 19:13 UTC (permalink / raw)
  To: Angus Ainslie (Purism); +Cc: angus.ainslie, krzk, linux-pm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2816 bytes --]

Hi,

On Fri, Jul 05, 2019 at 05:37:51AM -0600, Angus Ainslie (Purism) wrote:
> The BQ25895 is almost identical to the BQ25890.
> 
> Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca>
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/bq25890_charger.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
> index d333f2b321b9..9d1ec8d677de 100644
> --- a/drivers/power/supply/bq25890_charger.c
> +++ b/drivers/power/supply/bq25890_charger.c
> @@ -22,6 +22,7 @@
>  #define BQ25890_IRQ_PIN			"bq25890_irq"
>  
>  #define BQ25890_ID			3
> +#define BQ25895_ID			7
>  #define BQ25896_ID			0
>  
>  enum bq25890_fields {
> @@ -171,7 +172,7 @@ static const struct reg_field bq25890_reg_fields[] = {
>  	[F_WD]			= REG_FIELD(0x07, 4, 5),
>  	[F_TMR_EN]		= REG_FIELD(0x07, 3, 3),
>  	[F_CHG_TMR]		= REG_FIELD(0x07, 1, 2),
> -	[F_JEITA_ISET]		= REG_FIELD(0x07, 0, 0),
> +	[F_JEITA_ISET]		= REG_FIELD(0x07, 0, 0), // reserved on BQ25895
>  	/* REG08 */
>  	[F_BATCMP]		= REG_FIELD(0x08, 5, 7),
>  	[F_VCLAMP]		= REG_FIELD(0x08, 2, 4),
> @@ -180,7 +181,7 @@ static const struct reg_field bq25890_reg_fields[] = {
>  	[F_FORCE_ICO]		= REG_FIELD(0x09, 7, 7),
>  	[F_TMR2X_EN]		= REG_FIELD(0x09, 6, 6),
>  	[F_BATFET_DIS]		= REG_FIELD(0x09, 5, 5),
> -	[F_JEITA_VSET]		= REG_FIELD(0x09, 4, 4),
> +	[F_JEITA_VSET]		= REG_FIELD(0x09, 4, 4), // reserved on BQ25895
>  	[F_BATFET_DLY]		= REG_FIELD(0x09, 3, 3),
>  	[F_BATFET_RST_EN]	= REG_FIELD(0x09, 2, 2),
>  	[F_PUMPX_UP]		= REG_FIELD(0x09, 1, 1),
> @@ -188,7 +189,7 @@ static const struct reg_field bq25890_reg_fields[] = {
>  	/* REG0A */
>  	[F_BOOSTV]		= REG_FIELD(0x0A, 4, 7),
>  	/* PFM_OTG_DIS 3 on BQ25896 */
> -	[F_BOOSTI]		= REG_FIELD(0x0A, 0, 2),
> +	[F_BOOSTI]		= REG_FIELD(0x0A, 0, 2), // reserved on BQ25895
>  	/* REG0B */
>  	[F_VBUS_STAT]		= REG_FIELD(0x0B, 5, 7),
>  	[F_CHG_STAT]		= REG_FIELD(0x0B, 3, 4),
> @@ -392,6 +393,8 @@ static int bq25890_power_supply_get_property(struct power_supply *psy,
>  	case POWER_SUPPLY_PROP_MODEL_NAME:
>  		if (bq->chip_id == BQ25890_ID)
>  			val->strval = "BQ25890";
> +		else if (bq->chip_id == BQ25895_ID)
> +			val->strval = "BQ25895";
>  		else if (bq->chip_id == BQ25896_ID)
>  			val->strval = "BQ25896";
>  		else
> @@ -862,7 +865,8 @@ static int bq25890_probe(struct i2c_client *client,
>  		return bq->chip_id;
>  	}
>  
> -	if ((bq->chip_id != BQ25890_ID) && (bq->chip_id != BQ25896_ID)) {
> +	if ((bq->chip_id != BQ25890_ID) && (bq->chip_id != BQ25895_ID)
> +			&& (bq->chip_id != BQ25896_ID)) {
>  		dev_err(dev, "Chip with ID=%d, not supported!\n", bq->chip_id);
>  		return -ENODEV;
>  	}
> -- 
> 2.17.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-02 19:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-05 11:37 [PATCH] power: supply: bq25890_charger: Add the BQ25895 part Angus Ainslie (Purism)
2019-07-10  8:49 ` Krzysztof Kozlowski
2019-09-02 19:13 ` Sebastian Reichel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.