Re: [patch v7 3/3] platform/mellanox: mlxreg-hotplug: modify to use regmap intreface

2018-01-15 Thread Darren Hart
On Mon, Jan 15, 2018 at 10:21:33PM +0200, Andy Shevchenko wrote:
> On Mon, Jan 15, 2018 at 10:15 PM, Darren Hart  wrote:
> > On Wed, Jan 10, 2018 at 03:12:48PM +0800, kbuild test robot wrote:
> 
> >>ERROR: "ia64_delay_loop" [drivers/spi/spi-thunderx.ko] undefined!
> >> >> ERROR: "of_update_property" 
> >> >> [drivers/platform/mellanox/mlxreg-hotplug.ko] undefined!
> >>ERROR: "ia64_delay_loop" [drivers/net/phy/mdio-cavium.ko] undefined!
> >
> > Vadim, three undefined errors. Assuming you successfully built the drivers 
> > prior
> > to submission, this is likely due to a Kconfig dependency missing. Please
> > correct and resubmit.
> 
> It's already v8 is there.

Yeah, I just noticed this got reordered in my Inbox. On it.

-- 
Darren Hart
VMware Open Source Technology Center


Re: [patch v7 3/3] platform/mellanox: mlxreg-hotplug: modify to use regmap intreface

2018-01-15 Thread Darren Hart
On Mon, Jan 15, 2018 at 10:21:33PM +0200, Andy Shevchenko wrote:
> On Mon, Jan 15, 2018 at 10:15 PM, Darren Hart  wrote:
> > On Wed, Jan 10, 2018 at 03:12:48PM +0800, kbuild test robot wrote:
> 
> >>ERROR: "ia64_delay_loop" [drivers/spi/spi-thunderx.ko] undefined!
> >> >> ERROR: "of_update_property" 
> >> >> [drivers/platform/mellanox/mlxreg-hotplug.ko] undefined!
> >>ERROR: "ia64_delay_loop" [drivers/net/phy/mdio-cavium.ko] undefined!
> >
> > Vadim, three undefined errors. Assuming you successfully built the drivers 
> > prior
> > to submission, this is likely due to a Kconfig dependency missing. Please
> > correct and resubmit.
> 
> It's already v8 is there.

Yeah, I just noticed this got reordered in my Inbox. On it.

-- 
Darren Hart
VMware Open Source Technology Center


Re: [patch v7 3/3] platform/mellanox: mlxreg-hotplug: modify to use regmap intreface

2018-01-15 Thread Andy Shevchenko
On Mon, Jan 15, 2018 at 10:15 PM, Darren Hart  wrote:
> On Wed, Jan 10, 2018 at 03:12:48PM +0800, kbuild test robot wrote:

>>ERROR: "ia64_delay_loop" [drivers/spi/spi-thunderx.ko] undefined!
>> >> ERROR: "of_update_property" [drivers/platform/mellanox/mlxreg-hotplug.ko] 
>> >> undefined!
>>ERROR: "ia64_delay_loop" [drivers/net/phy/mdio-cavium.ko] undefined!
>
> Vadim, three undefined errors. Assuming you successfully built the drivers 
> prior
> to submission, this is likely due to a Kconfig dependency missing. Please
> correct and resubmit.

It's already v8 is there.

-- 
With Best Regards,
Andy Shevchenko


Re: [patch v7 3/3] platform/mellanox: mlxreg-hotplug: modify to use regmap intreface

2018-01-15 Thread Andy Shevchenko
On Mon, Jan 15, 2018 at 10:15 PM, Darren Hart  wrote:
> On Wed, Jan 10, 2018 at 03:12:48PM +0800, kbuild test robot wrote:

>>ERROR: "ia64_delay_loop" [drivers/spi/spi-thunderx.ko] undefined!
>> >> ERROR: "of_update_property" [drivers/platform/mellanox/mlxreg-hotplug.ko] 
>> >> undefined!
>>ERROR: "ia64_delay_loop" [drivers/net/phy/mdio-cavium.ko] undefined!
>
> Vadim, three undefined errors. Assuming you successfully built the drivers 
> prior
> to submission, this is likely due to a Kconfig dependency missing. Please
> correct and resubmit.

It's already v8 is there.

-- 
With Best Regards,
Andy Shevchenko


Re: [patch v7 3/3] platform/mellanox: mlxreg-hotplug: modify to use regmap intreface

2018-01-15 Thread Darren Hart
On Wed, Jan 10, 2018 at 03:12:48PM +0800, kbuild test robot wrote:
> Hi Vadim,
> 
> I love your patch! Yet something to improve:
> 
> [auto build test ERROR on platform-drivers-x86/for-next]
> [cannot apply to linus/master]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
> 
> url:
> https://github.com/0day-ci/linux/commits/Vadim-Pasternak/rivers-platform-replace-module-x86-mlxcpld-hotplug-with-mellanox-mlxreg-hotplug/20180110-115215
> base:   git://git.infradead.org/users/dvhart/linux-platform-drivers-x86.git 
> for-next
> config: ia64-allmodconfig (attached as .config)
> compiler: ia64-linux-gcc (GCC) 7.2.0
> reproduce:
> wget 
> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
> ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=ia64 
> 
> All errors (new ones prefixed by >>):

...

>ERROR: "ia64_delay_loop" [drivers/spi/spi-thunderx.ko] undefined!
> >> ERROR: "of_update_property" [drivers/platform/mellanox/mlxreg-hotplug.ko] 
> >> undefined!
>ERROR: "ia64_delay_loop" [drivers/net/phy/mdio-cavium.ko] undefined!

Vadim, three undefined errors. Assuming you successfully built the drivers prior
to submission, this is likely due to a Kconfig dependency missing. Please
correct and resubmit.

> 
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation



-- 
Darren Hart
VMware Open Source Technology Center


Re: [patch v7 3/3] platform/mellanox: mlxreg-hotplug: modify to use regmap intreface

2018-01-15 Thread Darren Hart
On Wed, Jan 10, 2018 at 03:12:48PM +0800, kbuild test robot wrote:
> Hi Vadim,
> 
> I love your patch! Yet something to improve:
> 
> [auto build test ERROR on platform-drivers-x86/for-next]
> [cannot apply to linus/master]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
> 
> url:
> https://github.com/0day-ci/linux/commits/Vadim-Pasternak/rivers-platform-replace-module-x86-mlxcpld-hotplug-with-mellanox-mlxreg-hotplug/20180110-115215
> base:   git://git.infradead.org/users/dvhart/linux-platform-drivers-x86.git 
> for-next
> config: ia64-allmodconfig (attached as .config)
> compiler: ia64-linux-gcc (GCC) 7.2.0
> reproduce:
> wget 
> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
> ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=ia64 
> 
> All errors (new ones prefixed by >>):

...

>ERROR: "ia64_delay_loop" [drivers/spi/spi-thunderx.ko] undefined!
> >> ERROR: "of_update_property" [drivers/platform/mellanox/mlxreg-hotplug.ko] 
> >> undefined!
>ERROR: "ia64_delay_loop" [drivers/net/phy/mdio-cavium.ko] undefined!

Vadim, three undefined errors. Assuming you successfully built the drivers prior
to submission, this is likely due to a Kconfig dependency missing. Please
correct and resubmit.

> 
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation



-- 
Darren Hart
VMware Open Source Technology Center


Re: [patch v7 3/3] platform/mellanox: mlxreg-hotplug: modify to use regmap intreface

2018-01-09 Thread kbuild test robot
Hi Vadim,

I love your patch! Yet something to improve:

[auto build test ERROR on platform-drivers-x86/for-next]
[cannot apply to linus/master]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Vadim-Pasternak/rivers-platform-replace-module-x86-mlxcpld-hotplug-with-mellanox-mlxreg-hotplug/20180110-115215
base:   git://git.infradead.org/users/dvhart/linux-platform-drivers-x86.git 
for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 7.2.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=ia64 

All errors (new ones prefixed by >>):

   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/auxdisplay/img-ascii-lcd.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-ath79.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-iop.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in drivers/iio/accel/kxsd9-i2c.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/iio/adc/qcom-vadc-common.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/media/platform/mtk-vcodec/mtk-vcodec-common.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/media/platform/tegra-cec/tegra_cec.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in drivers/mtd/nand/denali_pci.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/pinctrl/pxa/pinctrl-pxa2xx.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in drivers/power/reset/zx-reboot.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/staging/comedi/drivers/ni_atmio.o
   see include/linux/module.h for more information
   ERROR: "ia64_delay_loop" [drivers/spi/spi-thunderx.ko] undefined!
>> ERROR: "of_update_property" [drivers/platform/mellanox/mlxreg-hotplug.ko] 
>> undefined!
   ERROR: "ia64_delay_loop" [drivers/net/phy/mdio-cavium.ko] undefined!

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


Re: [patch v7 3/3] platform/mellanox: mlxreg-hotplug: modify to use regmap intreface

2018-01-09 Thread kbuild test robot
Hi Vadim,

I love your patch! Yet something to improve:

[auto build test ERROR on platform-drivers-x86/for-next]
[cannot apply to linus/master]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Vadim-Pasternak/rivers-platform-replace-module-x86-mlxcpld-hotplug-with-mellanox-mlxreg-hotplug/20180110-115215
base:   git://git.infradead.org/users/dvhart/linux-platform-drivers-x86.git 
for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 7.2.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=ia64 

All errors (new ones prefixed by >>):

   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/auxdisplay/img-ascii-lcd.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-ath79.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in drivers/gpio/gpio-iop.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in drivers/iio/accel/kxsd9-i2c.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/iio/adc/qcom-vadc-common.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/media/platform/mtk-vcodec/mtk-vcodec-common.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/media/platform/tegra-cec/tegra_cec.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in drivers/mtd/nand/denali_pci.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/pinctrl/pxa/pinctrl-pxa2xx.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in drivers/power/reset/zx-reboot.o
   see include/linux/module.h for more information
   WARNING: modpost: missing MODULE_LICENSE() in 
drivers/staging/comedi/drivers/ni_atmio.o
   see include/linux/module.h for more information
   ERROR: "ia64_delay_loop" [drivers/spi/spi-thunderx.ko] undefined!
>> ERROR: "of_update_property" [drivers/platform/mellanox/mlxreg-hotplug.ko] 
>> undefined!
   ERROR: "ia64_delay_loop" [drivers/net/phy/mdio-cavium.ko] undefined!

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


[patch v7 3/3] platform/mellanox: mlxreg-hotplug: modify to use regmap intreface

2018-01-08 Thread Vadim Pasternak
It includes:
- restructuring  of mlxreg header file for unification of hotplug items
  definition;
- unification of hotplug items to allow any kind of item (power
  controller, fan eeprom, psu eeprom, asic health in common way);
- utilization of regmap interface to allow independency of underlying
  hardware. It allows to support hotplug event functionality over
  programmable devices logic, when these devices can be attached to
  different interfaces types, like I2C, LPC, SPI.

Signed-off-by: Vadim Pasternak 
Acked-by: Andy Shevchenko 
---
v6->v7
 Fixes added by Vadim:
 - Remove include  in mlxreg-hotplug.c in this patch.
v5->v6:
 Fixes added by Vadim:
 - rename mlxreg_core_led_platform_data to common name
   mlxreg_core_platform_data;
 - add cell_low and mask_low fields to
   mlxreg_core_hotplug_platform_data for low aggregation interrupt
   registers and check for these fields in mlxreg_hotplug_set_irq and
   mlxreg_hotplug_unset_irq;
v4->v5:
 Comments pointed out by Andy:
 - use suffix OFFSET instead of ADDR for aggregation registers;
 - return back MACROS;
 - rearrange mlxreg_hotplug_attr_init routine;
---
 drivers/platform/mellanox/Kconfig  |   1 +
 drivers/platform/mellanox/mlxreg-hotplug.c | 629 +
 drivers/platform/x86/mlx-platform.c| 231 ---
 include/linux/platform_data/mlxreg.h   | 126 --
 4 files changed, 645 insertions(+), 342 deletions(-)

diff --git a/drivers/platform/mellanox/Kconfig 
b/drivers/platform/mellanox/Kconfig
index 0267e1d..591bccd 100644
--- a/drivers/platform/mellanox/Kconfig
+++ b/drivers/platform/mellanox/Kconfig
@@ -16,6 +16,7 @@ if MELLANOX_PLATFORM
 
 config MLXREG_HOTPLUG
tristate "Mellanox platform hotplug driver support"
+   depends on REGMAP
depends on HWMON
depends on I2C
---help---
diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c 
b/drivers/platform/mellanox/mlxreg-hotplug.c
index d609520..ba9241e 100644
--- a/drivers/platform/mellanox/mlxreg-hotplug.c
+++ b/drivers/platform/mellanox/mlxreg-hotplug.c
@@ -37,68 +37,63 @@
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 
-/* Offset of event and mask registers from status register */
+/* Offset of event and mask registers from status register. */
 #define MLXREG_HOTPLUG_EVENT_OFF   1
-#define MLXREG_HOTPLUG_MASK_OFF2
+#define MLXREG_HOTPLUG_MASK_OFF2
 #define MLXREG_HOTPLUG_AGGR_MASK_OFF   1
 
+/* ASIC health parameters. */
+#define MLXREG_HOTPLUG_HEALTH_MASK 0x02
+#define MLXREG_HOTPLUG_RST_CNTR3
+
 #define MLXREG_HOTPLUG_PROP_OKAY   "okay"
 #define MLXREG_HOTPLUG_PROP_DISABLED   "disabled"
 #define MLXREG_HOTPLUG_PROP_STATUS "status"
 
-#define MLXREG_HOTPLUG_ATTRS_NUM   8
-
-/**
- * enum mlxreg_hotplug_attr_type - sysfs attributes for hotplug events:
- * @MLXREG_HOTPLUG_ATTR_TYPE_PSU: power supply unit attribute;
- * @MLXREG_HOTPLUG_ATTR_TYPE_PWR: power cable attribute;
- * @MLXREG_HOTPLUG_ATTR_TYPE_FAN: FAN drawer attribute;
- */
-enum mlxreg_hotplug_attr_type {
-   MLXREG_HOTPLUG_ATTR_TYPE_PSU,
-   MLXREG_HOTPLUG_ATTR_TYPE_PWR,
-   MLXREG_HOTPLUG_ATTR_TYPE_FAN,
-};
+#define MLXREG_HOTPLUG_ATTRS_MAX   24
 
 /**
  * struct mlxreg_hotplug_priv_data - platform private data:
- * @irq: platform interrupt number;
+ * @irq: platform device interrupt number;
  * @pdev: platform device;
  * @plat: platform data;
+ * @dwork: delayed work template;
+ * @lock: spin lock;
  * @hwmon: hwmon device;
  * @mlxreg_hotplug_attr: sysfs attributes array;
  * @mlxreg_hotplug_dev_attr: sysfs sensor device attribute array;
  * @group: sysfs attribute group;
  * @groups: list of sysfs attribute group for hwmon registration;
- * @dwork: delayed work template;
- * @lock: spin lock;
+ * @cell: location of top aggregation interrupt register;
+ * @mask: top aggregation interrupt common mask;
  * @aggr_cache: last value of aggregation register status;
- * @psu_cache: last value of PSU register status;
- * @pwr_cache: last value of power register status;
- * @fan_cache: last value of FAN register status;
  */
 struct mlxreg_hotplug_priv_data {
int irq;
+   struct device *dev;
struct platform_device *pdev;
struct mlxreg_hotplug_platform_data *plat;
+   struct regmap *regmap;
+   struct delayed_work dwork_irq;
+   struct delayed_work dwork;
+   spinlock_t lock; /* sync with interrupt */
struct device *hwmon;
-   struct attribute *mlxreg_hotplug_attr[MLXREG_HOTPLUG_ATTRS_NUM + 1];
+   struct attribute *mlxreg_hotplug_attr[MLXREG_HOTPLUG_ATTRS_MAX + 1];
struct sensor_device_attribute_2
-   mlxreg_hotplug_dev_attr[MLXREG_HOTPLUG_ATTRS_NUM];
+   mlxreg_hotplug_dev_attr[MLXREG_HOTPLUG_ATTRS_MAX];
struct attribute_group group;
const struct 

[patch v7 3/3] platform/mellanox: mlxreg-hotplug: modify to use regmap intreface

2018-01-08 Thread Vadim Pasternak
It includes:
- restructuring  of mlxreg header file for unification of hotplug items
  definition;
- unification of hotplug items to allow any kind of item (power
  controller, fan eeprom, psu eeprom, asic health in common way);
- utilization of regmap interface to allow independency of underlying
  hardware. It allows to support hotplug event functionality over
  programmable devices logic, when these devices can be attached to
  different interfaces types, like I2C, LPC, SPI.

Signed-off-by: Vadim Pasternak 
Acked-by: Andy Shevchenko 
---
v6->v7
 Fixes added by Vadim:
 - Remove include  in mlxreg-hotplug.c in this patch.
v5->v6:
 Fixes added by Vadim:
 - rename mlxreg_core_led_platform_data to common name
   mlxreg_core_platform_data;
 - add cell_low and mask_low fields to
   mlxreg_core_hotplug_platform_data for low aggregation interrupt
   registers and check for these fields in mlxreg_hotplug_set_irq and
   mlxreg_hotplug_unset_irq;
v4->v5:
 Comments pointed out by Andy:
 - use suffix OFFSET instead of ADDR for aggregation registers;
 - return back MACROS;
 - rearrange mlxreg_hotplug_attr_init routine;
---
 drivers/platform/mellanox/Kconfig  |   1 +
 drivers/platform/mellanox/mlxreg-hotplug.c | 629 +
 drivers/platform/x86/mlx-platform.c| 231 ---
 include/linux/platform_data/mlxreg.h   | 126 --
 4 files changed, 645 insertions(+), 342 deletions(-)

diff --git a/drivers/platform/mellanox/Kconfig 
b/drivers/platform/mellanox/Kconfig
index 0267e1d..591bccd 100644
--- a/drivers/platform/mellanox/Kconfig
+++ b/drivers/platform/mellanox/Kconfig
@@ -16,6 +16,7 @@ if MELLANOX_PLATFORM
 
 config MLXREG_HOTPLUG
tristate "Mellanox platform hotplug driver support"
+   depends on REGMAP
depends on HWMON
depends on I2C
---help---
diff --git a/drivers/platform/mellanox/mlxreg-hotplug.c 
b/drivers/platform/mellanox/mlxreg-hotplug.c
index d609520..ba9241e 100644
--- a/drivers/platform/mellanox/mlxreg-hotplug.c
+++ b/drivers/platform/mellanox/mlxreg-hotplug.c
@@ -37,68 +37,63 @@
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 
-/* Offset of event and mask registers from status register */
+/* Offset of event and mask registers from status register. */
 #define MLXREG_HOTPLUG_EVENT_OFF   1
-#define MLXREG_HOTPLUG_MASK_OFF2
+#define MLXREG_HOTPLUG_MASK_OFF2
 #define MLXREG_HOTPLUG_AGGR_MASK_OFF   1
 
+/* ASIC health parameters. */
+#define MLXREG_HOTPLUG_HEALTH_MASK 0x02
+#define MLXREG_HOTPLUG_RST_CNTR3
+
 #define MLXREG_HOTPLUG_PROP_OKAY   "okay"
 #define MLXREG_HOTPLUG_PROP_DISABLED   "disabled"
 #define MLXREG_HOTPLUG_PROP_STATUS "status"
 
-#define MLXREG_HOTPLUG_ATTRS_NUM   8
-
-/**
- * enum mlxreg_hotplug_attr_type - sysfs attributes for hotplug events:
- * @MLXREG_HOTPLUG_ATTR_TYPE_PSU: power supply unit attribute;
- * @MLXREG_HOTPLUG_ATTR_TYPE_PWR: power cable attribute;
- * @MLXREG_HOTPLUG_ATTR_TYPE_FAN: FAN drawer attribute;
- */
-enum mlxreg_hotplug_attr_type {
-   MLXREG_HOTPLUG_ATTR_TYPE_PSU,
-   MLXREG_HOTPLUG_ATTR_TYPE_PWR,
-   MLXREG_HOTPLUG_ATTR_TYPE_FAN,
-};
+#define MLXREG_HOTPLUG_ATTRS_MAX   24
 
 /**
  * struct mlxreg_hotplug_priv_data - platform private data:
- * @irq: platform interrupt number;
+ * @irq: platform device interrupt number;
  * @pdev: platform device;
  * @plat: platform data;
+ * @dwork: delayed work template;
+ * @lock: spin lock;
  * @hwmon: hwmon device;
  * @mlxreg_hotplug_attr: sysfs attributes array;
  * @mlxreg_hotplug_dev_attr: sysfs sensor device attribute array;
  * @group: sysfs attribute group;
  * @groups: list of sysfs attribute group for hwmon registration;
- * @dwork: delayed work template;
- * @lock: spin lock;
+ * @cell: location of top aggregation interrupt register;
+ * @mask: top aggregation interrupt common mask;
  * @aggr_cache: last value of aggregation register status;
- * @psu_cache: last value of PSU register status;
- * @pwr_cache: last value of power register status;
- * @fan_cache: last value of FAN register status;
  */
 struct mlxreg_hotplug_priv_data {
int irq;
+   struct device *dev;
struct platform_device *pdev;
struct mlxreg_hotplug_platform_data *plat;
+   struct regmap *regmap;
+   struct delayed_work dwork_irq;
+   struct delayed_work dwork;
+   spinlock_t lock; /* sync with interrupt */
struct device *hwmon;
-   struct attribute *mlxreg_hotplug_attr[MLXREG_HOTPLUG_ATTRS_NUM + 1];
+   struct attribute *mlxreg_hotplug_attr[MLXREG_HOTPLUG_ATTRS_MAX + 1];
struct sensor_device_attribute_2
-   mlxreg_hotplug_dev_attr[MLXREG_HOTPLUG_ATTRS_NUM];
+   mlxreg_hotplug_dev_attr[MLXREG_HOTPLUG_ATTRS_MAX];
struct attribute_group group;
const struct attribute_group *groups[2];
-   struct delayed_work