Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Nikita Shubin and committed by
Arnd Bergmann
ede5bbe4 cbe8e464

+26
+26
include/linux/soc/cirrus/ep93xx.h
··· 3 3 #define _SOC_EP93XX_H 4 4 5 5 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> 6 18 7 19 #define EP93XX_CHIP_REV_D0 3 8 20 #define EP93XX_CHIP_REV_D1 4 9 21 #define EP93XX_CHIP_REV_E0 5 10 22 #define EP93XX_CHIP_REV_E1 6 11 23 #define EP93XX_CHIP_REV_E2 7 24 + 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) 12 38 13 39 #ifdef CONFIG_ARCH_EP93XX 14 40 int ep93xx_pwm_acquire_gpio(struct platform_device *pdev);