public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] driver: regmap: add regmap_parse_val api
@ 2014-02-19  5:19 Nenghua Cao
  2014-02-19  5:28 ` Nenghua Cao
  0 siblings, 1 reply; 12+ messages in thread
From: Nenghua Cao @ 2014-02-19  5:19 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Greg Kroah-Hartman, linux-kernel; +Cc: Nenghua Cao

From: Nenghua Cao <nhcao@marvell.com>

    In some cases, we need regmap's format parse_val function
to do be/le translation according to the bus configuration.
For example, snd_soc_bytes_put() uses regmap to write/read values,
and use cpu_to_be() directly to covert MASK into big endian. This
is a defect, and should use regmap's format function to do it according
to bus configuration.

Signed-off-by: Nenghua Cao <nhcao@marvell.com>
---
 drivers/base/regmap/regmap.c |   12 ++++++++++++
 include/linux/regmap.h       |    9 +++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 6a19515..4b2ed0c 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -2240,6 +2240,18 @@ int regmap_get_val_bytes(struct regmap *map)
 }
 EXPORT_SYMBOL_GPL(regmap_get_val_bytes);
 
+int regmap_parse_val(struct regmap *map, const void *buf,
+			unsigned int *val)
+{
+	if (!map->format.parse_val)
+		return -EINVAL;
+
+	*val = map->format.parse_val(buf);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(regmap_parse_val);
+
 static int __init regmap_initcall(void)
 {
 	regmap_debugfs_initcall();
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 4149f1a..3e1a2e4 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -423,6 +423,8 @@ bool regmap_check_range_table(struct regmap *map, unsigned int reg,
 
 int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
 			  int num_regs);
+int regmap_parse_val(struct regmap *map, const void *buf,
+				unsigned int *val);
 
 static inline bool regmap_reg_in_range(unsigned int reg,
 				       const struct regmap_range *range)
@@ -695,6 +697,13 @@ static inline int regmap_register_patch(struct regmap *map,
 	return -EINVAL;
 }
 
+static inline int regmap_parse_val(struct regmap *map, const void *buf,
+				unsigned int *val)
+{
+	WARN_ONCE(1, "regmap API is disabled");
+	return -EINVAL;
+}
+
 static inline struct regmap *dev_get_regmap(struct device *dev,
 					    const char *name)
 {
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] driver: regmap: add regmap_parse_val api
  2014-02-19  5:19 [PATCH 1/2] driver: regmap: add regmap_parse_val api Nenghua Cao
@ 2014-02-19  5:28 ` Nenghua Cao
  2014-02-19  7:50   ` Mark Brown
  0 siblings, 1 reply; 12+ messages in thread
From: Nenghua Cao @ 2014-02-19  5:28 UTC (permalink / raw)
  To: Nenghua Cao
  Cc: Liam Girdwood, Mark Brown, Greg Kroah-Hartman,
	linux-kernel@vger.kernel.org

   Update Liam and Mark's mail.

On 02/19/2014 01:19 PM, Nenghua Cao wrote:
> From: Nenghua Cao <nhcao@marvell.com>
> 
>     In some cases, we need regmap's format parse_val function
> to do be/le translation according to the bus configuration.
> For example, snd_soc_bytes_put() uses regmap to write/read values,
> and use cpu_to_be() directly to covert MASK into big endian. This
> is a defect, and should use regmap's format function to do it according
> to bus configuration.
> 
> Signed-off-by: Nenghua Cao <nhcao@marvell.com>
> ---
>  drivers/base/regmap/regmap.c |   12 ++++++++++++
>  include/linux/regmap.h       |    9 +++++++++
>  2 files changed, 21 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
> index 6a19515..4b2ed0c 100644
> --- a/drivers/base/regmap/regmap.c
> +++ b/drivers/base/regmap/regmap.c
> @@ -2240,6 +2240,18 @@ int regmap_get_val_bytes(struct regmap *map)
>  }
>  EXPORT_SYMBOL_GPL(regmap_get_val_bytes);
>  
> +int regmap_parse_val(struct regmap *map, const void *buf,
> +			unsigned int *val)
> +{
> +	if (!map->format.parse_val)
> +		return -EINVAL;
> +
> +	*val = map->format.parse_val(buf);
> +
> +	return 0;
> +}
> +EXPORT_SYMBOL_GPL(regmap_parse_val);
> +
>  static int __init regmap_initcall(void)
>  {
>  	regmap_debugfs_initcall();
> diff --git a/include/linux/regmap.h b/include/linux/regmap.h
> index 4149f1a..3e1a2e4 100644
> --- a/include/linux/regmap.h
> +++ b/include/linux/regmap.h
> @@ -423,6 +423,8 @@ bool regmap_check_range_table(struct regmap *map, unsigned int reg,
>  
>  int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
>  			  int num_regs);
> +int regmap_parse_val(struct regmap *map, const void *buf,
> +				unsigned int *val);
>  
>  static inline bool regmap_reg_in_range(unsigned int reg,
>  				       const struct regmap_range *range)
> @@ -695,6 +697,13 @@ static inline int regmap_register_patch(struct regmap *map,
>  	return -EINVAL;
>  }
>  
> +static inline int regmap_parse_val(struct regmap *map, const void *buf,
> +				unsigned int *val)
> +{
> +	WARN_ONCE(1, "regmap API is disabled");
> +	return -EINVAL;
> +}
> +
>  static inline struct regmap *dev_get_regmap(struct device *dev,
>  					    const char *name)
>  {
> 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] driver: regmap: add regmap_parse_val api
  2014-02-19  5:28 ` Nenghua Cao
@ 2014-02-19  7:50   ` Mark Brown
  2014-02-19 10:50     ` Nenghua Cao
  0 siblings, 1 reply; 12+ messages in thread
From: Mark Brown @ 2014-02-19  7:50 UTC (permalink / raw)
  To: Nenghua Cao
  Cc: Liam Girdwood, Greg Kroah-Hartman, linux-kernel@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 209 bytes --]

On Wed, Feb 19, 2014 at 01:28:43PM +0800, Nenghua Cao wrote:
>    Update Liam and Mark's mail.

I can't do anything useful with patches that are quoted, sorry.  None of
the tools know how to strip out quotes.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/2] driver: regmap: add regmap_parse_val api
@ 2014-02-19 10:44 Nenghua Cao
  2014-02-20  8:24 ` Nenghua Cao
  2014-03-06  9:41 ` Mark Brown
  0 siblings, 2 replies; 12+ messages in thread
From: Nenghua Cao @ 2014-02-19 10:44 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Greg Kroah-Hartman, linux-kernel; +Cc: Nenghua Cao

From: Nenghua Cao <nhcao@marvell.com>

    In some cases, we need regmap's format parse_val function
to do be/le translation according to the bus configuration.
For example, snd_soc_bytes_put() uses regmap to write/read values,
and use cpu_to_be() directly to covert MASK into big endian. This
is a defect, and should use regmap's format function to do it according
to bus configuration.

Signed-off-by: Nenghua Cao <nhcao@marvell.com>
---
 drivers/base/regmap/regmap.c |   12 ++++++++++++
 include/linux/regmap.h       |    9 +++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 6a19515..4b2ed0c 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -2240,6 +2240,18 @@ int regmap_get_val_bytes(struct regmap *map)
 }
 EXPORT_SYMBOL_GPL(regmap_get_val_bytes);
 
+int regmap_parse_val(struct regmap *map, const void *buf,
+			unsigned int *val)
+{
+	if (!map->format.parse_val)
+		return -EINVAL;
+
+	*val = map->format.parse_val(buf);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(regmap_parse_val);
+
 static int __init regmap_initcall(void)
 {
 	regmap_debugfs_initcall();
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 4149f1a..3e1a2e4 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -423,6 +423,8 @@ bool regmap_check_range_table(struct regmap *map, unsigned int reg,
 
 int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
 			  int num_regs);
+int regmap_parse_val(struct regmap *map, const void *buf,
+				unsigned int *val);
 
 static inline bool regmap_reg_in_range(unsigned int reg,
 				       const struct regmap_range *range)
@@ -695,6 +697,13 @@ static inline int regmap_register_patch(struct regmap *map,
 	return -EINVAL;
 }
 
+static inline int regmap_parse_val(struct regmap *map, const void *buf,
+				unsigned int *val)
+{
+	WARN_ONCE(1, "regmap API is disabled");
+	return -EINVAL;
+}
+
 static inline struct regmap *dev_get_regmap(struct device *dev,
 					    const char *name)
 {
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] driver: regmap: add regmap_parse_val api
  2014-02-19  7:50   ` Mark Brown
@ 2014-02-19 10:50     ` Nenghua Cao
  0 siblings, 0 replies; 12+ messages in thread
From: Nenghua Cao @ 2014-02-19 10:50 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Greg Kroah-Hartman, linux-kernel@vger.kernel.org

On 02/19/2014 03:50 PM, Mark Brown wrote:
> On Wed, Feb 19, 2014 at 01:28:43PM +0800, Nenghua Cao wrote:
>>    Update Liam and Mark's mail.
> 
> I can't do anything useful with patches that are quoted, sorry.  None of
> the tools know how to strip out quotes.
> 
Hi ,Mark

         Sorry for giving you trouble. I also don't know how to remove
the quotes. So i just submit the patches again. Thanks!

BR
Nenghua

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] driver: regmap: add regmap_parse_val api
  2014-02-19 10:44 Nenghua Cao
@ 2014-02-20  8:24 ` Nenghua Cao
  2014-02-20  8:55   ` Mark Brown
  2014-03-06  9:41 ` Mark Brown
  1 sibling, 1 reply; 12+ messages in thread
From: Nenghua Cao @ 2014-02-20  8:24 UTC (permalink / raw)
  To: Nenghua Cao
  Cc: Liam Girdwood, Mark Brown, Greg Kroah-Hartman,
	linux-kernel@vger.kernel.org

Hi, Mark:

     Do you still have any other problem which have impact on evaluating
these two patches?

BR
Nenghua

On 02/19/2014 06:44 PM, Nenghua Cao wrote:
> From: Nenghua Cao <nhcao@marvell.com>
> 
>     In some cases, we need regmap's format parse_val function
> to do be/le translation according to the bus configuration.
> For example, snd_soc_bytes_put() uses regmap to write/read values,
> and use cpu_to_be() directly to covert MASK into big endian. This
> is a defect, and should use regmap's format function to do it according
> to bus configuration.
> 
> Signed-off-by: Nenghua Cao <nhcao@marvell.com>
> ---
>  drivers/base/regmap/regmap.c |   12 ++++++++++++
>  include/linux/regmap.h       |    9 +++++++++
>  2 files changed, 21 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
> index 6a19515..4b2ed0c 100644
> --- a/drivers/base/regmap/regmap.c
> +++ b/drivers/base/regmap/regmap.c
> @@ -2240,6 +2240,18 @@ int regmap_get_val_bytes(struct regmap *map)
>  }
>  EXPORT_SYMBOL_GPL(regmap_get_val_bytes);
>  
> +int regmap_parse_val(struct regmap *map, const void *buf,
> +			unsigned int *val)
> +{
> +	if (!map->format.parse_val)
> +		return -EINVAL;
> +
> +	*val = map->format.parse_val(buf);
> +
> +	return 0;
> +}
> +EXPORT_SYMBOL_GPL(regmap_parse_val);
> +
>  static int __init regmap_initcall(void)
>  {
>  	regmap_debugfs_initcall();
> diff --git a/include/linux/regmap.h b/include/linux/regmap.h
> index 4149f1a..3e1a2e4 100644
> --- a/include/linux/regmap.h
> +++ b/include/linux/regmap.h
> @@ -423,6 +423,8 @@ bool regmap_check_range_table(struct regmap *map, unsigned int reg,
>  
>  int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
>  			  int num_regs);
> +int regmap_parse_val(struct regmap *map, const void *buf,
> +				unsigned int *val);
>  
>  static inline bool regmap_reg_in_range(unsigned int reg,
>  				       const struct regmap_range *range)
> @@ -695,6 +697,13 @@ static inline int regmap_register_patch(struct regmap *map,
>  	return -EINVAL;
>  }
>  
> +static inline int regmap_parse_val(struct regmap *map, const void *buf,
> +				unsigned int *val)
> +{
> +	WARN_ONCE(1, "regmap API is disabled");
> +	return -EINVAL;
> +}
> +
>  static inline struct regmap *dev_get_regmap(struct device *dev,
>  					    const char *name)
>  {
> 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] driver: regmap: add regmap_parse_val api
  2014-02-20  8:24 ` Nenghua Cao
@ 2014-02-20  8:55   ` Mark Brown
  2014-02-20 12:09     ` Nenghua Cao
  0 siblings, 1 reply; 12+ messages in thread
From: Mark Brown @ 2014-02-20  8:55 UTC (permalink / raw)
  To: Nenghua Cao
  Cc: Liam Girdwood, Greg Kroah-Hartman, linux-kernel@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

On Thu, Feb 20, 2014 at 04:24:06PM +0800, Nenghua Cao wrote:

>      Do you still have any other problem which have impact on evaluating
> these two patches?

You're chasing me for a reply after a day - that's way too soon, please
allow a reasonable time for a response.  A week or so is usually a good
minimum.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] driver: regmap: add regmap_parse_val api
  2014-02-20  8:55   ` Mark Brown
@ 2014-02-20 12:09     ` Nenghua Cao
  2014-02-20 13:42       ` Mark Brown
  0 siblings, 1 reply; 12+ messages in thread
From: Nenghua Cao @ 2014-02-20 12:09 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Greg Kroah-Hartman, linux-kernel@vger.kernel.org

On 02/20/2014 04:55 PM, Mark Brown wrote:
> On Thu, Feb 20, 2014 at 04:24:06PM +0800, Nenghua Cao wrote:
> 
>>      Do you still have any other problem which have impact on evaluating
>> these two patches?
> 
> You're chasing me for a reply after a day - that's way too soon, please
> allow a reasonable time for a response.  A week or so is usually a good
> minimum.
> 
Hi, Mark:

     My intention is not chasing you. I am just afraid if there is any
other mistake when submitting this patch to open source. Please do what
you want to do. Thanks!

BR
Nenghua

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] driver: regmap: add regmap_parse_val api
  2014-02-20 12:09     ` Nenghua Cao
@ 2014-02-20 13:42       ` Mark Brown
  2014-03-03 10:44         ` Nenghua Cao
  0 siblings, 1 reply; 12+ messages in thread
From: Mark Brown @ 2014-02-20 13:42 UTC (permalink / raw)
  To: Nenghua Cao
  Cc: Liam Girdwood, Greg Kroah-Hartman, linux-kernel@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 299 bytes --]

On Thu, Feb 20, 2014 at 08:09:51PM +0800, Nenghua Cao wrote:

>      My intention is not chasing you. I am just afraid if there is any
> other mistake when submitting this patch to open source. Please do what
> you want to do. Thanks!

It's certainly fine in terms of submission, no problems there!

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] driver: regmap: add regmap_parse_val api
  2014-02-20 13:42       ` Mark Brown
@ 2014-03-03 10:44         ` Nenghua Cao
  2014-03-05  2:03           ` Mark Brown
  0 siblings, 1 reply; 12+ messages in thread
From: Nenghua Cao @ 2014-03-03 10:44 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Greg Kroah-Hartman, linux-kernel@vger.kernel.org

On 02/20/2014 09:42 PM, Mark Brown wrote:
> On Thu, Feb 20, 2014 at 08:09:51PM +0800, Nenghua Cao wrote:
> 
>>      My intention is not chasing you. I am just afraid if there is any
>> other mistake when submitting this patch to open source. Please do what
>> you want to do. Thanks!
> 
> It's certainly fine in terms of submission, no problems there!
> 
Hi, Mark

      Do you have any comments about these two patches? Thanks!

BR
Nenghua

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] driver: regmap: add regmap_parse_val api
  2014-03-03 10:44         ` Nenghua Cao
@ 2014-03-05  2:03           ` Mark Brown
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Brown @ 2014-03-05  2:03 UTC (permalink / raw)
  To: Nenghua Cao
  Cc: Liam Girdwood, Greg Kroah-Hartman, linux-kernel@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 662 bytes --]

On Mon, Mar 03, 2014 at 06:44:21PM +0800, Nenghua Cao wrote:

>       Do you have any comments about these two patches? Thanks!

I've not looked at it yet, please don't nag - one of the reasons it got
bumped down my priority list is that you nagged previously.  I tend to
do this partly as a function of looking at the nag making me feel like I
looked at the code and partly as a deliberate method for discouraging
nags.

Looking at this I do also notice that you didn't use a subject line
matching the style for the subsystem which means it's going to be less
likely to be looked at.  Patches that aren't for subsystems I maintain
tend to get a lower priority.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] driver: regmap: add regmap_parse_val api
  2014-02-19 10:44 Nenghua Cao
  2014-02-20  8:24 ` Nenghua Cao
@ 2014-03-06  9:41 ` Mark Brown
  1 sibling, 0 replies; 12+ messages in thread
From: Mark Brown @ 2014-03-06  9:41 UTC (permalink / raw)
  To: Nenghua Cao; +Cc: Liam Girdwood, Greg Kroah-Hartman, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]

On Wed, Feb 19, 2014 at 06:44:13PM +0800, Nenghua Cao wrote:
> From: Nenghua Cao <nhcao@marvell.com>
> 
>     In some cases, we need regmap's format parse_val function
> to do be/le translation according to the bus configuration.
> For example, snd_soc_bytes_put() uses regmap to write/read values,
> and use cpu_to_be() directly to covert MASK into big endian. This
> is a defect, and should use regmap's format function to do it according
> to bus configuration.

Applied, thanks.  Please use subject lines matching the style for the
subsystem.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-03-06  9:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-19  5:19 [PATCH 1/2] driver: regmap: add regmap_parse_val api Nenghua Cao
2014-02-19  5:28 ` Nenghua Cao
2014-02-19  7:50   ` Mark Brown
2014-02-19 10:50     ` Nenghua Cao
  -- strict thread matches above, loose matches on Subject: below --
2014-02-19 10:44 Nenghua Cao
2014-02-20  8:24 ` Nenghua Cao
2014-02-20  8:55   ` Mark Brown
2014-02-20 12:09     ` Nenghua Cao
2014-02-20 13:42       ` Mark Brown
2014-03-03 10:44         ` Nenghua Cao
2014-03-05  2:03           ` Mark Brown
2014-03-06  9:41 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox