mc13xxx: Added dummy definitions if CONFIG_MFD_MC13XXX is not set
Subsystems (2)
PATCH 1/3 mc13xxx: Added dummy definitions if CONFIG_MFD_MC13XXX is not set
Signed-off-by Alexander Shiyan <[email protected]>
--- arch/arm/boards/pcm038/pcm038.c | 2 -- include/mfd/mc13xxx.h | 23 ++++++++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-)
arch/arm/boards/pcm038/pcm038.c +0 -2
@@ -125,7 +125,6 @@ static inline uint32_t get_pll_spctl10(void)*/ static int pcm038_power_init (void ) { -#ifdef CONFIG_MFD_MC13XXX uint32_t spctl0 =get_pll_spctl10 ();struct mc13xxx *mc13xxx =mc13xxx_get ();
@@ -159,7 +158,6 @@ static int pcm038_power_init(void)printf ("Failed to initialize PMIC. Will continue with low CPU speed\n" ); } } -#endif /* clock gating enable */ GPCR =0x00050f08 ;
include/mfd/mc13xxx.h +22 -1
@@ -163,10 +163,31 @@ struct mc13xxx {int revision; }; +#ifdef CONFIG_MFD_MC13XXX extern struct mc13xxx *mc13xxx_get (void ); -extern int mc13xxx_reg_read (struct mc13xxx *mc13xxx,u8 reg,u32 *val);extern int mc13xxx_reg_write (struct mc13xxx *mc13xxx,u8 reg,u32 val);extern int mc13xxx_set_bits (struct mc13xxx *mc13xxx,u8 reg,u32 mask,u32 val); +#else +static inline struct mc13xxx *mc13xxx_get (void ) +{ +return NULL ; +} + +static inline int mc13xxx_reg_read (struct mc13xxx *mc13xxx,u8 reg,u32 *val) +{ +return -ENODEV ; +} + +static inline int mc13xxx_reg_write (struct mc13xxx *mc13xxx,u8 reg,u32 val) +{ +return -ENODEV ; +} + +static inline int mc13xxx_set_bits (struct mc13xxx *mc13xxx,u8 reg,u32 mask,u32 val) +{ +return -ENODEV ; +} +#endif #endif /* __MFD_MC13XXX_H */
Signature · 7 lines
1.7.3.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/3 mc13xxx: Hide struct mc13xxx from board support code
Board support units should use only provided functions.
Signed-off-by Alexander Shiyan <[email protected]>
--- drivers/mfd/mc13xxx.c | 13 +++++++++++++ include/mfd/mc13xxx.h | 13 +------------ 2 files changed, 14 insertions(+), 12 deletions(-)
drivers/mfd/mc13xxx.c +13 -0
@@ -32,6 +32,19 @@#define DRIVERNAME "mc13xxx" +enum mc13xxx_mode { +MC13XXX_MODE_I2C , +MC13XXX_MODE_SPI , +}; + +struct mc13xxx { +struct cdev cdev; +struct i2c_client *client; +struct spi_device *spi; +enum mc13xxx_mode mode; +int revision; +}; +#define to_mc13xxx (a) container_of(a, struct mc13xxx, cdev)static struct mc13xxx *mc_dev;
include/mfd/mc13xxx.h +1 -12
@@ -150,18 +150,7 @@#define MC13783_SW1B_SOFTSTART (1 << 17)#define MC13783_SW_PLL_FACTOR (x) (((x) - 28) << 19) -enum mc13xxx_mode { -MC13XXX_MODE_I2C , -MC13XXX_MODE_SPI , -}; - -struct mc13xxx { -struct cdev cdev; -struct i2c_client *client; -struct spi_device *spi; -enum mc13xxx_mode mode; -int revision; -}; +struct mc13xxx ;#ifdef CONFIG_MFD_MC13XXX extern struct mc13xxx *mc13xxx_get (void );
Signature · 7 lines
1.7.3.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/3] mc13xxx: Hide struct mc13xxx from board support code
Hello.
Sat, 21 Jul 2012 08:50:08 +0400 от Alexander Shiyan <[email protected]>:
Quoted 2 lines
Board support units should use only provided functions.
Signed-off-by Alexander Shiyan <[email protected]>
...
After posting this one, I found some problems, so just drop this one patch. Sorry.
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
PATCH 3/3 PCM038: Added setup for OTG host pins
In reply to Alexander ShiyanSigned-off-by Alexander Shiyan <[email protected]>
--- arch/arm/boards/pcm038/pcm038.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
arch/arm/boards/pcm038/pcm038.c +13 -0
@@ -236,6 +236,19 @@ static int pcm038_devices_init(void)PA29_PF_VSYNC ,PA30_PF_CONTRAST ,PA31_PF_OE_ACD , +/* OTG host */ +PC7_PF_USBOTG_DATA5 , +PC8_PF_USBOTG_DATA6 , +PC9_PF_USBOTG_DATA0 , +PC10_PF_USBOTG_DATA2 , +PC11_PF_USBOTG_DATA1 , +PC12_PF_USBOTG_DATA4 , +PC13_PF_USBOTG_DATA3 , +PE0_PF_USBOTG_NXT , +PE1_PF_USBOTG_STP , +PE2_PF_USBOTG_DIR , +PE24_PF_USBOTG_CLK , +PE25_PF_USBOTG_DATA7 ,/* I2C1 */ PD17_PF_I2C_DATA |GPIO_PUEN , PD18_PF_I2C_CLK,
Signature · 7 lines
1.7.3.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 2 lines · Alexander Shiyan
Signed-off-by Alexander Shiyan <[email protected]>
Applied 1/3 and 3/3. Thanks
Sascha
Quoted 71 lines
--- arch/arm/boards/pcm038/pcm038.c | 2 -- include/mfd/mc13xxx.h | 23 ++++++++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-)arch/arm/boards/pcm038/pcm038.c +0
-2@@ -125,7 +125,6 @@ static inline uint32_t get_pll_spctl10(void)*/ static int pcm038_power_init (void ) { -#ifdef CONFIG_MFD_MC13XXX uint32_t spctl0 =get_pll_spctl10 ();struct mc13xxx *mc13xxx =mc13xxx_get ();@@ -159,7 +158,6 @@ static int pcm038_power_init(void)printf ("Failed to initialize PMIC. Will continue with low CPU speed\n" ); } } -#endif /* clock gating enable */ GPCR =0x00050f08 ;include/mfd/mc13xxx.h +22
-1@@ -163,10 +163,31 @@ struct mc13xxx {int revision; }; +#ifdef CONFIG_MFD_MC13XXX extern struct mc13xxx *mc13xxx_get (void ); -extern int mc13xxx_reg_read (struct mc13xxx *mc13xxx,u8 reg,u32 *val);extern int mc13xxx_reg_write (struct mc13xxx *mc13xxx,u8 reg,u32 val);extern int mc13xxx_set_bits (struct mc13xxx *mc13xxx,u8 reg,u32 mask,u32 val); +#else +static inline struct mc13xxx *mc13xxx_get (void ) +{ +return NULL ; +} + +static inline int mc13xxx_reg_read (struct mc13xxx *mc13xxx,u8 reg,u32 *val) +{ +return -ENODEV ; +} + +static inline int mc13xxx_reg_write (struct mc13xxx *mc13xxx,u8 reg,u32 val) +{ +return -ENODEV ; +} + +static inline int mc13xxx_set_bits (struct mc13xxx *mc13xxx,u8 reg,u32 mask,u32 val) +{ +return -ENODEV ; +} +#endif #endif /* __MFD_MC13XXX_H */ Signature · 7 lines
1.7.3.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
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 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox