[PATCH] x-power AXP805 support

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] x-power AXP805 support

SASANO Takayoshi
Hi,

DTB says that AXP805 is AXP806 compatible, but axppmic(4) does not use
OF_is_compatible() so we need to add AXP805 entry to code like this.

Index: axppmic.c
===================================================================
RCS file: /cvs/src/sys/dev/fdt/axppmic.c,v
retrieving revision 1.9
diff -u -p -r1.9 axppmic.c
--- axppmic.c 23 Jan 2020 10:01:41 -0000 1.9
+++ axppmic.c 6 Feb 2021 20:23:15 -0000
@@ -293,6 +293,7 @@ struct axppmic_device axppmic_devices[]
  { "x-powers,axp221", "AXP221", axp221_regdata, axp221_sensdata },
  { "x-powers,axp223", "AXP223", axp221_regdata, axp221_sensdata },
  { "x-powers,axp803", "AXP803", axp803_regdata, axp803_sensdata },
+ { "x-powers,axp805", "AXP805", axp806_regdata },
  { "x-powers,axp806", "AXP806", axp806_regdata },
  { "x-powers,axp809", "AXP809", axp809_regdata, axp221_sensdata }
 };
@@ -491,7 +492,8 @@ axppmic_attach_common(struct axppmic_sof
  sc->sc_sensdata = device->sensdata;
 
  /* Switch AXP806 into master or slave mode. */
- if (strcmp(name, "x-powers,axp806") == 0) {
+ if (strcmp(name, "x-powers,axp805") == 0 ||
+    strcmp(name, "x-powers,axp806") == 0) {
     if (OF_getproplen(node, "x-powers,master-mode") == 0) {
  axppmic_write_reg(sc, AXP806_REG_ADDR_EXT,
     AXP806_REG_ADDR_EXT_MASTER_MODE);

but on OrangePi One Plus (Allwinner H6), there is something misconfiguration
so currently AXP805 is not working with errors.

  sxitwi0 at simplebus0
  iic0 at sxitwi0
  axppmic0 at iic0 addr 0x36: AXP805
  axppmic0: SMBus write byte to 0xff failed
  axppmic0: SMBus read byte from 0x17 failed
  (many errors continues...)

--
SASANO Takayoshi (JG1UAA) <[hidden email]>