Skip to content

Commit ede5bbe

Browse files
maquefelarndb
authored andcommitted
ARM: ep93xx: add regmap aux_dev
The following driver's should be instantiated by ep93xx syscon driver: - reboot - pinctrl - clock They all require access to DEVCFG register with a shared lock held, to avoid conflict writing to swlocked parts of DEVCFG. Provide common resources such as base, regmap and spinlock via auxiliary bus framework. Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me> Tested-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Stephen Boyd <sboyd@kernel.org> Acked-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent cbe8e46 commit ede5bbe

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

include/linux/soc/cirrus/ep93xx.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,39 @@
33
#define _SOC_EP93XX_H
44

55
struct platform_device;
6+
struct regmap;
7+
struct spinlock_t;
8+
9+
enum ep93xx_soc_model {
10+
EP93XX_9301_SOC,
11+
EP93XX_9307_SOC,
12+
EP93XX_9312_SOC,
13+
};
14+
15+
#include <linux/auxiliary_bus.h>
16+
#include <linux/compiler_types.h>
17+
#include <linux/container_of.h>
618

719
#define EP93XX_CHIP_REV_D0 3
820
#define EP93XX_CHIP_REV_D1 4
921
#define EP93XX_CHIP_REV_E0 5
1022
#define EP93XX_CHIP_REV_E1 6
1123
#define EP93XX_CHIP_REV_E2 7
1224

25+
struct ep93xx_regmap_adev {
26+
struct auxiliary_device adev;
27+
struct regmap *map;
28+
void __iomem *base;
29+
spinlock_t *lock;
30+
void (*write)(struct regmap *map, spinlock_t *lock, unsigned int reg,
31+
unsigned int val);
32+
void (*update_bits)(struct regmap *map, spinlock_t *lock,
33+
unsigned int reg, unsigned int mask, unsigned int val);
34+
};
35+
36+
#define to_ep93xx_regmap_adev(_adev) \
37+
container_of((_adev), struct ep93xx_regmap_adev, adev)
38+
1339
#ifdef CONFIG_ARCH_EP93XX
1440
int ep93xx_pwm_acquire_gpio(struct platform_device *pdev);
1541
void ep93xx_pwm_release_gpio(struct platform_device *pdev);

0 commit comments

Comments
 (0)