diff mbox series

[v3,2/4] mfd: simple-mfd-i2c: Adds Ampere's Altra SMpro support

Message ID 20210409031332.21919-3-quan@os.amperecomputing.com
State Superseded
Headers show
Series Add Ampere's Altra SMPro hwmon driver | expand

Commit Message

Quan Nguyen April 9, 2021, 3:13 a.m. UTC
Adds an MFD driver for SMpro found on the Mt.Jade hardware reference
platform with Ampere's Altra processor family.

Signed-off-by: Quan Nguyen <quan@os.amperecomputing.com>
---
 drivers/mfd/Kconfig          | 10 ++++++++++
 drivers/mfd/simple-mfd-i2c.c |  6 ++++++
 2 files changed, 16 insertions(+)

Comments

kernel test robot April 14, 2021, 11:52 a.m. UTC | #1
Hi Quan,

I love your patch! Yet something to improve:

[auto build test ERROR on hwmon/hwmon-next]
[also build test ERROR on lee-mfd/for-mfd-next v5.12-rc7 next-20210413]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Quan-Nguyen/Add-Ampere-s-Altra-SMPro-hwmon-driver/20210409-111448
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
config: ia64-randconfig-r033-20210414 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/ae9c1fc1cd6602869e0d6b6de0d4d1ec6e126fb8
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Quan-Nguyen/Add-Ampere-s-Altra-SMPro-hwmon-driver/20210409-111448
        git checkout ae9c1fc1cd6602869e0d6b6de0d4d1ec6e126fb8
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   ia64-linux-ld: drivers/mfd/simple-mfd-i2c.o: in function `simple_mfd_i2c_probe':
>> simple-mfd-i2c.c:(.text+0x62): undefined reference to `__devm_regmap_init_i2c'

   ia64-linux-ld: drivers/mfd/simple-mfd-i2c.o: in function `simple_mfd_i2c_driver_init':
>> simple-mfd-i2c.c:(.init.text+0x22): undefined reference to `i2c_register_driver'


Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for MFD_SIMPLE_MFD_I2C
   Depends on HAS_IOMEM && I2C
   Selected by
   - MFD_SMPRO && HAS_IOMEM

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Guenter Roeck April 14, 2021, 12:21 p.m. UTC | #2
On Fri, Apr 09, 2021 at 10:13:30AM +0700, Quan Nguyen wrote:
> Adds an MFD driver for SMpro found on the Mt.Jade hardware reference

> platform with Ampere's Altra processor family.

> 

> Signed-off-by: Quan Nguyen <quan@os.amperecomputing.com>

> Reported-by: kernel test robot <lkp@intel.com>

> ---

>  drivers/mfd/Kconfig          | 10 ++++++++++

>  drivers/mfd/simple-mfd-i2c.c |  6 ++++++

>  2 files changed, 16 insertions(+)

> 

> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig

> index d07e8cf93286..f7a6460f7aa0 100644

> --- a/drivers/mfd/Kconfig

> +++ b/drivers/mfd/Kconfig

> @@ -77,6 +77,16 @@ config MFD_AS3711

>  	help

>  	  Support for the AS3711 PMIC from AMS

>  

> +config MFD_SMPRO

> +	tristate "Ampere Computing MFD SMpro core driver"

> +	select MFD_SIMPLE_MFD_I2C


This is missing "depends on I2C".

> +	help

> +	  Say yes here to enable SMpro driver support for Ampere's Altra

> +	  processor family.

> +

> +	  Ampere's Altra SMpro exposes an I2C regmap interface that can

> +	  be accessed by child devices.

> +

>  config MFD_AS3722

>  	tristate "ams AS3722 Power Management IC"

>  	select MFD_CORE

> diff --git a/drivers/mfd/simple-mfd-i2c.c b/drivers/mfd/simple-mfd-i2c.c

> index 87f684cff9a1..9a44655f5592 100644

> --- a/drivers/mfd/simple-mfd-i2c.c

> +++ b/drivers/mfd/simple-mfd-i2c.c

> @@ -21,6 +21,11 @@ static const struct regmap_config simple_regmap_config = {

>  	.val_bits = 8,

>  };

>  

> +static const struct regmap_config simple_word_regmap_config = {

> +	.reg_bits = 8,

> +	.val_bits = 16,

> +};

> +

>  static int simple_mfd_i2c_probe(struct i2c_client *i2c)

>  {

>  	const struct regmap_config *config;

> @@ -39,6 +44,7 @@ static int simple_mfd_i2c_probe(struct i2c_client *i2c)

>  

>  static const struct of_device_id simple_mfd_i2c_of_match[] = {

>  	{ .compatible = "kontron,sl28cpld" },

> +	{ .compatible = "ampere,smpro", .data = &simple_word_regmap_config },

>  	{}

>  };

>  MODULE_DEVICE_TABLE(of, simple_mfd_i2c_of_match);
Quan Nguyen April 15, 2021, 4:15 a.m. UTC | #3
On 14/04/2021 19:21, Guenter Roeck wrote:
> On Fri, Apr 09, 2021 at 10:13:30AM +0700, Quan Nguyen wrote:

>> Adds an MFD driver for SMpro found on the Mt.Jade hardware reference

>> platform with Ampere's Altra processor family.

>>

>> Signed-off-by: Quan Nguyen <quan@os.amperecomputing.com>

>> Reported-by: kernel test robot <lkp@intel.com>

>> ---

>>   drivers/mfd/Kconfig          | 10 ++++++++++

>>   drivers/mfd/simple-mfd-i2c.c |  6 ++++++

>>   2 files changed, 16 insertions(+)

>>

>> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig

>> index d07e8cf93286..f7a6460f7aa0 100644

>> --- a/drivers/mfd/Kconfig

>> +++ b/drivers/mfd/Kconfig

>> @@ -77,6 +77,16 @@ config MFD_AS3711

>>   	help

>>   	  Support for the AS3711 PMIC from AMS

>>   

>> +config MFD_SMPRO

>> +	tristate "Ampere Computing MFD SMpro core driver"

>> +	select MFD_SIMPLE_MFD_I2C

> 

> This is missing "depends on I2C".

> 

Thanks Guenter to help pointing this out.
This fixes the issue reported by kernel test robot. Will include this in 
next version.

>> +	help

>> +	  Say yes here to enable SMpro driver support for Ampere's Altra

>> +	  processor family.

>> +

>> +	  Ampere's Altra SMpro exposes an I2C regmap interface that can

>> +	  be accessed by child devices.

>> +

>>   config MFD_AS3722

>>   	tristate "ams AS3722 Power Management IC"

>>   	select MFD_CORE

>> diff --git a/drivers/mfd/simple-mfd-i2c.c b/drivers/mfd/simple-mfd-i2c.c

>> index 87f684cff9a1..9a44655f5592 100644

>> --- a/drivers/mfd/simple-mfd-i2c.c

>> +++ b/drivers/mfd/simple-mfd-i2c.c

>> @@ -21,6 +21,11 @@ static const struct regmap_config simple_regmap_config = {

>>   	.val_bits = 8,

>>   };

>>   

>> +static const struct regmap_config simple_word_regmap_config = {

>> +	.reg_bits = 8,

>> +	.val_bits = 16,

>> +};

>> +

>>   static int simple_mfd_i2c_probe(struct i2c_client *i2c)

>>   {

>>   	const struct regmap_config *config;

>> @@ -39,6 +44,7 @@ static int simple_mfd_i2c_probe(struct i2c_client *i2c)

>>   

>>   static const struct of_device_id simple_mfd_i2c_of_match[] = {

>>   	{ .compatible = "kontron,sl28cpld" },

>> +	{ .compatible = "ampere,smpro", .data = &simple_word_regmap_config },

>>   	{}

>>   };

>>   MODULE_DEVICE_TABLE(of, simple_mfd_i2c_of_match);
diff mbox series

Patch

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index d07e8cf93286..f7a6460f7aa0 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -77,6 +77,16 @@  config MFD_AS3711
 	help
 	  Support for the AS3711 PMIC from AMS
 
+config MFD_SMPRO
+	tristate "Ampere Computing MFD SMpro core driver"
+	select MFD_SIMPLE_MFD_I2C
+	help
+	  Say yes here to enable SMpro driver support for Ampere's Altra
+	  processor family.
+
+	  Ampere's Altra SMpro exposes an I2C regmap interface that can
+	  be accessed by child devices.
+
 config MFD_AS3722
 	tristate "ams AS3722 Power Management IC"
 	select MFD_CORE
diff --git a/drivers/mfd/simple-mfd-i2c.c b/drivers/mfd/simple-mfd-i2c.c
index 87f684cff9a1..9a44655f5592 100644
--- a/drivers/mfd/simple-mfd-i2c.c
+++ b/drivers/mfd/simple-mfd-i2c.c
@@ -21,6 +21,11 @@  static const struct regmap_config simple_regmap_config = {
 	.val_bits = 8,
 };
 
+static const struct regmap_config simple_word_regmap_config = {
+	.reg_bits = 8,
+	.val_bits = 16,
+};
+
 static int simple_mfd_i2c_probe(struct i2c_client *i2c)
 {
 	const struct regmap_config *config;
@@ -39,6 +44,7 @@  static int simple_mfd_i2c_probe(struct i2c_client *i2c)
 
 static const struct of_device_id simple_mfd_i2c_of_match[] = {
 	{ .compatible = "kontron,sl28cpld" },
+	{ .compatible = "ampere,smpro", .data = &simple_word_regmap_config },
 	{}
 };
 MODULE_DEVICE_TABLE(of, simple_mfd_i2c_of_match);