commit: http://blackfin.uclinux.org/git/?p=linux-kernel;a=commitdiff;h=ae2a7c2479d5347076aef7bd732977341afe1506
branch: http://blackfin.uclinux.org/git/?p=linux-kernel;a=shortlog;h=refs/heads/2011R1

Signed-off-by: Lars-Peter Clausen <[email protected]>
---
 drivers/base/regmap/regmap.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index a471083..bb29f6d 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -104,6 +104,15 @@ static void regmap_format_16(void *buf, unsigned int val)
 	b[0] = cpu_to_be16(val);
 }
 
+static void regmap_format_24(void *buf, unsigned int val)
+{
+	u8 *b = buf;
+
+	b[0] = (val >> 16) & 0xff;
+	b[1] = (val >> 8) & 0xff;
+	b[2] = val & 0xff;
+}
+
 static unsigned int regmap_parse_8(void *buf)
 {
 	u8 *b = buf;
@@ -202,6 +211,10 @@ struct regmap *regmap_init(struct device *dev,
 		map->format.format_reg = regmap_format_16;
 		break;
 
+	case 24:
+		map->format.format_reg = regmap_format_24;
+		break;
+
 	default:
 		goto err_map;
 	}
@@ -215,6 +228,9 @@ struct regmap *regmap_init(struct device *dev,
 		map->format.format_val = regmap_format_16;
 		map->format.parse_val = regmap_parse_16;
 		break;
+	case 24:
+		map->format.format_val = regmap_format_24;
+		break;
 	}
 
 	if (!map->format.format_write &&
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to