Re: [PATCH v2] mfd: Provide MACRO to declare commonly defined MFD cell attributes

2016-02-26 Thread Andy Shevchenko
On Wed, Feb 10, 2016 at 5:38 PM, Lee Jones  wrote:
> mfd: Provide MACRO to declare commonly defined MFD cell attributes
>

Commit message?


> +#define MFD_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))

What's wrong with ARRAY_SIZE() ?

> +
> +#define MFD_CELL_ALL(_name, _res, _pdata, _id, _compat, _match)  
>   \

It misses pset. Which makes below set of macros is not sufficient.

> +   {   \
> +   .name = (_name),\
> +   .resources = (_res),\
> +   .num_resources = MFD_ARRAY_SIZE((_res)),\
> +   .platform_data = (_pdata),  \
> +   .pdata_size = MFD_ARRAY_SIZE((_pdata)), \
> +   .of_compatible = (_compat), \
> +   .acpi_match = (_match), \
> +   .id = _id,  \
> +   }
> +
> +#define OF_MFD_CELL(_name, _res, _pdata, _id, _compat) \
> +   MFD_CELL_ALL(_name, _res, _pdata, _id, _compat, NULL)   \
> +
> +#define ACPI_MFD_CELL(_name, _res, _pdata, _id, _match)  
>   \
> +   MFD_CELL_ALL(_name, _res, _pdata, _id, NULL, _match)\
> +
> +#define MFD_CELL_BASIC(_name, _res, _pdata, _id)   \
> +   MFD_CELL_ALL(_name, _res, _pdata, _id, NULL, NULL)  \
> +
> +#define MFD_CELL_NAME(_name)   \
> +   MFD_CELL_ALL(_name, NULL, NULL, 0, NULL, NULL)  \

-- 
With Best Regards,
Andy Shevchenko


Re: [PATCH v2] mfd: Provide MACRO to declare commonly defined MFD cell attributes

2016-02-11 Thread Lee Jones
On Thu, 11 Feb 2016, Laxman Dewangan wrote:

> 
> On Thursday 11 February 2016 02:40 PM, Lee Jones wrote:
> >On Wed, 10 Feb 2016, Laxman Dewangan wrote:
> >
> >>On Wednesday 10 February 2016 09:08 PM, Lee Jones wrote:
> >>>mfd: Provide MACRO to declare commonly defined MFD cell attributes
> >>>Cc: Laxman Dewangan 
> >>>Signed-off-by: Lee Jones 
> >>Build passed with this patch when using it.
> >>
> >>Acked-by: Laxman Dewangan 
> >>
> >>Please let me know if you applying this. I am going to use the macro
> >>from this patch on max77620 series on next spin.
> >As you are the first user, just submit it as 0/1 of your set.
> >
> 
> I saw that it is merged and available in linux-next 20160211.
> So it is fine to not submit this patch again and modify my patch
> assuming it is on tree.

I was going to handle that, but as you wish, either way is fine by
me.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog


Re: [PATCH v2] mfd: Provide MACRO to declare commonly defined MFD cell attributes

2016-02-11 Thread Laxman Dewangan


On Thursday 11 February 2016 02:40 PM, Lee Jones wrote:

On Wed, 10 Feb 2016, Laxman Dewangan wrote:


On Wednesday 10 February 2016 09:08 PM, Lee Jones wrote:

mfd: Provide MACRO to declare commonly defined MFD cell attributes
Cc: Laxman Dewangan 
Signed-off-by: Lee Jones 

Build passed with this patch when using it.

Acked-by: Laxman Dewangan 

Please let me know if you applying this. I am going to use the macro
from this patch on max77620 series on next spin.

As you are the first user, just submit it as 0/1 of your set.



I saw that it is merged and available in linux-next 20160211.
So it is fine to not submit this patch again and modify my patch 
assuming it is on tree.




Re: [PATCH v2] mfd: Provide MACRO to declare commonly defined MFD cell attributes

2016-02-11 Thread Lee Jones
On Wed, 10 Feb 2016, Laxman Dewangan wrote:

> 
> On Wednesday 10 February 2016 09:08 PM, Lee Jones wrote:
> >mfd: Provide MACRO to declare commonly defined MFD cell attributes
> >Cc: Laxman Dewangan 
> >Signed-off-by: Lee Jones 
> 
> Build passed with this patch when using it.
> 
> Acked-by: Laxman Dewangan 
> 
> Please let me know if you applying this. I am going to use the macro
> from this patch on max77620 series on next spin.

As you are the first user, just submit it as 0/1 of your set.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog


Re: [PATCH v2] mfd: Provide MACRO to declare commonly defined MFD cell attributes

2016-02-10 Thread Laxman Dewangan


On Wednesday 10 February 2016 09:08 PM, Lee Jones wrote:

mfd: Provide MACRO to declare commonly defined MFD cell attributes
 
Cc: Laxman Dewangan 

Signed-off-by: Lee Jones 


Build passed with this patch when using it.

Acked-by: Laxman Dewangan 

Please let me know if you applying this. I am going to use the macro 
from this patch on max77620 series on next spin.


[PATCH v2] mfd: Provide MACRO to declare commonly defined MFD cell attributes

2016-02-10 Thread Lee Jones
mfd: Provide MACRO to declare commonly defined MFD cell attributes

Cc: Laxman Dewangan 
Signed-off-by: Lee Jones 

---
 include/linux/mfd/core.h | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h
index bc6f7e0..1a5a87f 100644
--- a/include/linux/mfd/core.h
+++ b/include/linux/mfd/core.h
@@ -16,6 +16,32 @@
 
 #include 
 
+#define MFD_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+
+#define MFD_CELL_ALL(_name, _res, _pdata, _id, _compat, _match)
\
+   {   \
+   .name = (_name),\
+   .resources = (_res),\
+   .num_resources = MFD_ARRAY_SIZE((_res)),\
+   .platform_data = (_pdata),  \
+   .pdata_size = MFD_ARRAY_SIZE((_pdata)), \
+   .of_compatible = (_compat), \
+   .acpi_match = (_match), \
+   .id = _id,  \
+   }
+
+#define OF_MFD_CELL(_name, _res, _pdata, _id, _compat) \
+   MFD_CELL_ALL(_name, _res, _pdata, _id, _compat, NULL)   \
+
+#define ACPI_MFD_CELL(_name, _res, _pdata, _id, _match)
\
+   MFD_CELL_ALL(_name, _res, _pdata, _id, NULL, _match)\
+
+#define MFD_CELL_BASIC(_name, _res, _pdata, _id)   \
+   MFD_CELL_ALL(_name, _res, _pdata, _id, NULL, NULL)  \
+
+#define MFD_CELL_NAME(_name)   \
+   MFD_CELL_ALL(_name, NULL, NULL, 0, NULL, NULL)  \
+
 struct irq_domain;
 struct property_set;