|
@@ -125,6 +125,13 @@ static void regmap_format_16(void *buf, unsigned int val)
|
|
|
b[0] = cpu_to_be16(val);
|
|
|
}
|
|
|
|
|
|
+static void regmap_format_32(void *buf, unsigned int val)
|
|
|
+{
|
|
|
+ __be32 *b = buf;
|
|
|
+
|
|
|
+ b[0] = cpu_to_be32(val);
|
|
|
+}
|
|
|
+
|
|
|
static unsigned int regmap_parse_8(void *buf)
|
|
|
{
|
|
|
u8 *b = buf;
|
|
@@ -141,6 +148,15 @@ static unsigned int regmap_parse_16(void *buf)
|
|
|
return b[0];
|
|
|
}
|
|
|
|
|
|
+static unsigned int regmap_parse_32(void *buf)
|
|
|
+{
|
|
|
+ __be32 *b = buf;
|
|
|
+
|
|
|
+ b[0] = be32_to_cpu(b[0]);
|
|
|
+
|
|
|
+ return b[0];
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* regmap_init(): Initialise register map
|
|
|
*
|
|
@@ -239,6 +255,10 @@ struct regmap *regmap_init(struct device *dev,
|
|
|
map->format.format_reg = regmap_format_16;
|
|
|
break;
|
|
|
|
|
|
+ case 32:
|
|
|
+ map->format.format_reg = regmap_format_32;
|
|
|
+ break;
|
|
|
+
|
|
|
default:
|
|
|
goto err_map;
|
|
|
}
|
|
@@ -252,6 +272,10 @@ struct regmap *regmap_init(struct device *dev,
|
|
|
map->format.format_val = regmap_format_16;
|
|
|
map->format.parse_val = regmap_parse_16;
|
|
|
break;
|
|
|
+ case 32:
|
|
|
+ map->format.format_val = regmap_format_32;
|
|
|
+ map->format.parse_val = regmap_parse_32;
|
|
|
+ break;
|
|
|
}
|
|
|
|
|
|
if (!map->format.format_write &&
|