diff mbox

[7/9] regulator: palmas: Add palmas_pmic_driver_data structure

Message ID 1401272423-25761-8-git-send-email-j-keerthy@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

J, KEERTHY May 28, 2014, 10:20 a.m. UTC
Add palmas_pmic_driver_data structure.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 include/linux/mfd/palmas.h |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

Comments

Lee Jones June 17, 2014, 4:37 p.m. UTC | #1
On Wed, 28 May 2014, Keerthy wrote:

> Add palmas_pmic_driver_data structure.
> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
>  include/linux/mfd/palmas.h |   25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
> index 8d68452..70f0695 100644
> --- a/include/linux/mfd/palmas.h
> +++ b/include/linux/mfd/palmas.h
> @@ -53,6 +53,8 @@ struct palmas_pmic;
>  struct palmas_gpadc;
>  struct palmas_resource;
>  struct palmas_usb;
> +struct palmas_pmic_driver_data;
> +struct palmas_pmic_platform_data;
>  
>  enum palmas_usb_state {
>  	PALMAS_USB_STATE_DISCONNECT,
> @@ -76,6 +78,8 @@ struct palmas {
>  	struct mutex irq_lock;
>  	struct regmap_irq_chip_data *irq_data;
>  
> +	struct palmas_pmic_driver_data *pmic_ddata;
> +
>  	/* Child Devices */
>  	struct palmas_pmic *pmic;
>  	struct palmas_gpadc *gpadc;
> @@ -107,6 +111,27 @@ struct regs_info {
>  	int	sleep_id;
>  };
>  
> +struct palmas_pmic_driver_data {
> +	int smps_start;
> +	int smps_end;
> +	int ldo_begin;
> +	int ldo_end;
> +	int max_reg;
> +	struct regs_info *palmas_regs_info;
> +	struct of_regulator_match *palmas_matches;
> +	struct palmas_sleep_requestor_info *sleep_req_info;
> +	int (*smps_register)(struct palmas_pmic *pmic,
> +			     struct palmas_pmic_driver_data *ddata,
> +			     struct palmas_pmic_platform_data *pdata,
> +			     const char *pdev_name,
> +			     struct regulator_config config);
> +	int (*ldo_register)(struct palmas_pmic *pmic,
> +			    struct palmas_pmic_driver_data *ddata,
> +			    struct palmas_pmic_platform_data *pdata,
> +			    const char *pdev_name,
> +			    struct regulator_config config);

Are you sure you need to store all of this stuff?

Particularly the match pointer.  Do you really re-use it?

> +};
> +
>  struct palmas_gpadc_platform_data {
>  	/* Channel 3 current source is only enabled during conversion */
>  	int ch3_current;
Keerthy June 18, 2014, 5:01 a.m. UTC | #2
On Tuesday 17 June 2014 10:07 PM, Lee Jones wrote:
> On Wed, 28 May 2014, Keerthy wrote:
>
>> Add palmas_pmic_driver_data structure.
>>
>> Signed-off-by: Keerthy <j-keerthy@ti.com>
>> ---
>>   include/linux/mfd/palmas.h |   25 +++++++++++++++++++++++++
>>   1 file changed, 25 insertions(+)
>>
>> diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
>> index 8d68452..70f0695 100644
>> --- a/include/linux/mfd/palmas.h
>> +++ b/include/linux/mfd/palmas.h
>> @@ -53,6 +53,8 @@ struct palmas_pmic;
>>   struct palmas_gpadc;
>>   struct palmas_resource;
>>   struct palmas_usb;
>> +struct palmas_pmic_driver_data;
>> +struct palmas_pmic_platform_data;
>>   
>>   enum palmas_usb_state {
>>   	PALMAS_USB_STATE_DISCONNECT,
>> @@ -76,6 +78,8 @@ struct palmas {
>>   	struct mutex irq_lock;
>>   	struct regmap_irq_chip_data *irq_data;
>>   
>> +	struct palmas_pmic_driver_data *pmic_ddata;
>> +
>>   	/* Child Devices */
>>   	struct palmas_pmic *pmic;
>>   	struct palmas_gpadc *gpadc;
>> @@ -107,6 +111,27 @@ struct regs_info {
>>   	int	sleep_id;
>>   };
>>   
>> +struct palmas_pmic_driver_data {
>> +	int smps_start;
>> +	int smps_end;
>> +	int ldo_begin;
>> +	int ldo_end;
>> +	int max_reg;
>> +	struct regs_info *palmas_regs_info;
>> +	struct of_regulator_match *palmas_matches;
>> +	struct palmas_sleep_requestor_info *sleep_req_info;
>> +	int (*smps_register)(struct palmas_pmic *pmic,
>> +			     struct palmas_pmic_driver_data *ddata,
>> +			     struct palmas_pmic_platform_data *pdata,
>> +			     const char *pdev_name,
>> +			     struct regulator_config config);
>> +	int (*ldo_register)(struct palmas_pmic *pmic,
>> +			    struct palmas_pmic_driver_data *ddata,
>> +			    struct palmas_pmic_platform_data *pdata,
>> +			    const char *pdev_name,
>> +			    struct regulator_config config);
> Are you sure you need to store all of this stuff?
>
> Particularly the match pointer.  Do you really re-use it?

Match pointer is used extensively in the palmas_regulator.c.
This structure is very much used by regulator driver.

>
>> +};
>> +
>>   struct palmas_gpadc_platform_data {
>>   	/* Channel 3 current source is only enabled during conversion */
>>   	int ch3_current;

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lee Jones June 18, 2014, 7:24 a.m. UTC | #3
> >>Add palmas_pmic_driver_data structure.
> >>
> >>Signed-off-by: Keerthy <j-keerthy@ti.com>
> >>---
> >>  include/linux/mfd/palmas.h |   25 +++++++++++++++++++++++++
> >>  1 file changed, 25 insertions(+)
> >>
> >>diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
> >>index 8d68452..70f0695 100644
> >>--- a/include/linux/mfd/palmas.h
> >>+++ b/include/linux/mfd/palmas.h
[...]

> >>+struct palmas_pmic_driver_data {
> >>+	int smps_start;
> >>+	int smps_end;
> >>+	int ldo_begin;
> >>+	int ldo_end;
> >>+	int max_reg;
> >>+	struct regs_info *palmas_regs_info;
> >>+	struct of_regulator_match *palmas_matches;
> >>+	struct palmas_sleep_requestor_info *sleep_req_info;
> >>+	int (*smps_register)(struct palmas_pmic *pmic,
> >>+			     struct palmas_pmic_driver_data *ddata,
> >>+			     struct palmas_pmic_platform_data *pdata,
> >>+			     const char *pdev_name,
> >>+			     struct regulator_config config);
> >>+	int (*ldo_register)(struct palmas_pmic *pmic,
> >>+			    struct palmas_pmic_driver_data *ddata,
> >>+			    struct palmas_pmic_platform_data *pdata,
> >>+			    const char *pdev_name,
> >>+			    struct regulator_config config);
> >Are you sure you need to store all of this stuff?
> >
> >Particularly the match pointer.  Do you really re-use it?
> 
> Match pointer is used extensively in the palmas_regulator.c.
> This structure is very much used by regulator driver.

On closer inspection, I now see that it's a 'of_regulator_match',
rather than an 'of_match' pointer, which were my initial thoughts.  I
think it would have been weird to carry the 'of_match', but the
reality sounds sane.
diff mbox

Patch

diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index 8d68452..70f0695 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -53,6 +53,8 @@  struct palmas_pmic;
 struct palmas_gpadc;
 struct palmas_resource;
 struct palmas_usb;
+struct palmas_pmic_driver_data;
+struct palmas_pmic_platform_data;
 
 enum palmas_usb_state {
 	PALMAS_USB_STATE_DISCONNECT,
@@ -76,6 +78,8 @@  struct palmas {
 	struct mutex irq_lock;
 	struct regmap_irq_chip_data *irq_data;
 
+	struct palmas_pmic_driver_data *pmic_ddata;
+
 	/* Child Devices */
 	struct palmas_pmic *pmic;
 	struct palmas_gpadc *gpadc;
@@ -107,6 +111,27 @@  struct regs_info {
 	int	sleep_id;
 };
 
+struct palmas_pmic_driver_data {
+	int smps_start;
+	int smps_end;
+	int ldo_begin;
+	int ldo_end;
+	int max_reg;
+	struct regs_info *palmas_regs_info;
+	struct of_regulator_match *palmas_matches;
+	struct palmas_sleep_requestor_info *sleep_req_info;
+	int (*smps_register)(struct palmas_pmic *pmic,
+			     struct palmas_pmic_driver_data *ddata,
+			     struct palmas_pmic_platform_data *pdata,
+			     const char *pdev_name,
+			     struct regulator_config config);
+	int (*ldo_register)(struct palmas_pmic *pmic,
+			    struct palmas_pmic_driver_data *ddata,
+			    struct palmas_pmic_platform_data *pdata,
+			    const char *pdev_name,
+			    struct regulator_config config);
+};
+
 struct palmas_gpadc_platform_data {
 	/* Channel 3 current source is only enabled during conversion */
 	int ch3_current;