Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1205893 > unrolled thread

[PATCH 13/20] regmap: regmap max_raw_io getter function

Started byMarkus Pargmann <mpa@pengutronix.de>
First post2015-08-12 12:20 +0200
Last post2015-08-12 15:00 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 13/20] regmap: regmap max_raw_io getter function Markus Pargmann <mpa@pengutronix.de> - 2015-08-12 12:20 +0200
    Re: [PATCH 13/20] regmap: regmap max_raw_io getter function Mark Brown <broonie@kernel.org> - 2015-08-12 14:00 +0200
      Re: [PATCH 13/20] regmap: regmap max_raw_io getter function Markus Pargmann <mpa@pengutronix.de> - 2015-08-12 15:00 +0200

#1205893 — [PATCH 13/20] regmap: regmap max_raw_io getter function

FromMarkus Pargmann <mpa@pengutronix.de>
Date2015-08-12 12:20 +0200
Subject[PATCH 13/20] regmap: regmap max_raw_io getter function
Message-ID<pWBiz-1oV-49@gated-at.bofh.it>
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
 drivers/base/regmap/regmap.c | 22 ++++++++++++++++++++++
 include/linux/regmap.h       |  2 ++
 2 files changed, 24 insertions(+)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 6ad4ca849055..8c2be516a100 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -1393,6 +1393,28 @@ bool regmap_can_raw_write(struct regmap *map)
 }
 EXPORT_SYMBOL_GPL(regmap_can_raw_write);
 
+/**
+ * regmap_get_raw_io_max - Get the maximum size we can read/write
+ *
+ * @map: Map to check.
+ */
+size_t regmap_get_raw_io_max(struct regmap *map)
+{
+	return map->max_raw_io;
+}
+EXPORT_SYMBOL_GPL(regmap_get_raw_io_max);
+
+/**
+ * regmap_get_raw_read_max - Get the maximum size we can read
+ *
+ * @map: Map to check.
+ */
+size_t regmap_get_raw_read_max(struct regmap *map)
+{
+	return map->max_raw_io;
+}
+EXPORT_SYMBOL_GPL(regmap_get_raw_read_max);
+
 static int _regmap_bus_formatted_write(void *context, unsigned int reg,
 				       unsigned int val)
 {
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 2cb62d141761..b236f884f642 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -441,6 +441,8 @@ int regmap_get_max_register(struct regmap *map);
 int regmap_get_reg_stride(struct regmap *map);
 int regmap_async_complete(struct regmap *map);
 bool regmap_can_raw_write(struct regmap *map);
+size_t regmap_get_raw_write_max(struct regmap *map);
+size_t regmap_get_raw_io_max(struct regmap *map);
 
 int regcache_sync(struct regmap *map);
 int regcache_sync_region(struct regmap *map, unsigned int min,
-- 
2.4.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1205988

FromMark Brown <broonie@kernel.org>
Date2015-08-12 14:00 +0200
Message-ID<pWCRk-3tG-23@gated-at.bofh.it>
In reply to#1205893

[Multipart message — attachments visible in raw view] — view raw

On Wed, Aug 12, 2015 at 12:12:38PM +0200, Markus Pargmann wrote:
> Signed-off-by: Markus Pargmann <mpa@pengutronix.de>

Your changelog doesn't mention why anything would reasonably want to use
this and...

> +size_t regmap_get_raw_io_max(struct regmap *map)
> +{
> +	return map->max_raw_io;
> +}
> +EXPORT_SYMBOL_GPL(regmap_get_raw_io_max);
> +
> +/**
> + * regmap_get_raw_read_max - Get the maximum size we can read
> + *
> + * @map: Map to check.
> + */

...it is adding two functions which don't seem very symmetrically named.

> @@ -441,6 +441,8 @@ int regmap_get_max_register(struct regmap *map);
>  int regmap_get_reg_stride(struct regmap *map);
>  int regmap_async_complete(struct regmap *map);
>  bool regmap_can_raw_write(struct regmap *map);
> +size_t regmap_get_raw_write_max(struct regmap *map);
> +size_t regmap_get_raw_io_max(struct regmap *map);

Do we want stubs here?

[toc] | [prev] | [next] | [standalone]


#1206064

FromMarkus Pargmann <mpa@pengutronix.de>
Date2015-08-12 15:00 +0200
Message-ID<pWDNo-4Q9-21@gated-at.bofh.it>
In reply to#1205988

[Multipart message — attachments visible in raw view] — view raw

On Wed, Aug 12, 2015 at 12:51:36PM +0100, Mark Brown wrote:
> On Wed, Aug 12, 2015 at 12:12:38PM +0200, Markus Pargmann wrote:
> > Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
> 
> Your changelog doesn't mention why anything would reasonably want to use
> this and...

Right, this is used later in the driver code of bmc150 to find out how
much we can read from the sensor in one run.

> 
> > +size_t regmap_get_raw_io_max(struct regmap *map)
> > +{
> > +	return map->max_raw_io;
> > +}
> > +EXPORT_SYMBOL_GPL(regmap_get_raw_io_max);
> > +
> > +/**
> > + * regmap_get_raw_read_max - Get the maximum size we can read
> > + *
> > + * @map: Map to check.
> > + */
> 
> ...it is adding two functions which don't seem very symmetrically named.

Oh, this is half of my previous version where raw_read_max and
raw_write_max where separate. Will fix it along with your comment that
these should be different values for read and write.

Thanks,

Markus

> 
> > @@ -441,6 +441,8 @@ int regmap_get_max_register(struct regmap *map);
> >  int regmap_get_reg_stride(struct regmap *map);
> >  int regmap_async_complete(struct regmap *map);
> >  bool regmap_can_raw_write(struct regmap *map);
> > +size_t regmap_get_raw_write_max(struct regmap *map);
> > +size_t regmap_get_raw_io_max(struct regmap *map);
> 
> Do we want stubs here?



-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web