* [PATCH 1/3] mc13xxx: Added dummy definitions if CONFIG_MFD_MC13XXX is not set
@ 2012-07-21 4:50 Alexander Shiyan
2012-07-21 4:50 ` [PATCH 2/3] mc13xxx: Hide struct mc13xxx from board support code Alexander Shiyan
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Alexander Shiyan @ 2012-07-21 4:50 UTC (permalink / raw)
To: barebox
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
arch/arm/boards/pcm038/pcm038.c | 2 --
include/mfd/mc13xxx.h | 23 ++++++++++++++++++++++-
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
index badc978..ffd8d87 100644
--- a/arch/arm/boards/pcm038/pcm038.c
+++ b/arch/arm/boards/pcm038/pcm038.c
@@ -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;
diff --git a/include/mfd/mc13xxx.h b/include/mfd/mc13xxx.h
index 2880307..632c9fb 100644
--- a/include/mfd/mc13xxx.h
+++ b/include/mfd/mc13xxx.h
@@ -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 */
--
1.7.3.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/3] mc13xxx: Hide struct mc13xxx from board support code
2012-07-21 4:50 [PATCH 1/3] mc13xxx: Added dummy definitions if CONFIG_MFD_MC13XXX is not set Alexander Shiyan
@ 2012-07-21 4:50 ` Alexander Shiyan
2012-07-21 5:11 ` Alexander Shiyan
2012-07-21 4:50 ` [PATCH 3/3] PCM038: Added setup for OTG host pins Alexander Shiyan
2012-07-23 20:13 ` [PATCH 1/3] mc13xxx: Added dummy definitions if CONFIG_MFD_MC13XXX is not set Sascha Hauer
2 siblings, 1 reply; 5+ messages in thread
From: Alexander Shiyan @ 2012-07-21 4:50 UTC (permalink / raw)
To: barebox
Board support units should use only provided functions.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
drivers/mfd/mc13xxx.c | 13 +++++++++++++
include/mfd/mc13xxx.h | 13 +------------
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/drivers/mfd/mc13xxx.c b/drivers/mfd/mc13xxx.c
index 2934e9d..b1417c8 100644
--- a/drivers/mfd/mc13xxx.c
+++ b/drivers/mfd/mc13xxx.c
@@ -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;
diff --git a/include/mfd/mc13xxx.h b/include/mfd/mc13xxx.h
index 632c9fb..f4e3302 100644
--- a/include/mfd/mc13xxx.h
+++ b/include/mfd/mc13xxx.h
@@ -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);
--
1.7.3.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 3/3] PCM038: Added setup for OTG host pins
2012-07-21 4:50 [PATCH 1/3] mc13xxx: Added dummy definitions if CONFIG_MFD_MC13XXX is not set Alexander Shiyan
2012-07-21 4:50 ` [PATCH 2/3] mc13xxx: Hide struct mc13xxx from board support code Alexander Shiyan
@ 2012-07-21 4:50 ` Alexander Shiyan
2012-07-23 20:13 ` [PATCH 1/3] mc13xxx: Added dummy definitions if CONFIG_MFD_MC13XXX is not set Sascha Hauer
2 siblings, 0 replies; 5+ messages in thread
From: Alexander Shiyan @ 2012-07-21 4:50 UTC (permalink / raw)
To: barebox
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
arch/arm/boards/pcm038/pcm038.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
index ffd8d87..fdf7431 100644
--- a/arch/arm/boards/pcm038/pcm038.c
+++ b/arch/arm/boards/pcm038/pcm038.c
@@ -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,
--
1.7.3.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/3] mc13xxx: Added dummy definitions if CONFIG_MFD_MC13XXX is not set
2012-07-21 4:50 [PATCH 1/3] mc13xxx: Added dummy definitions if CONFIG_MFD_MC13XXX is not set Alexander Shiyan
2012-07-21 4:50 ` [PATCH 2/3] mc13xxx: Hide struct mc13xxx from board support code Alexander Shiyan
2012-07-21 4:50 ` [PATCH 3/3] PCM038: Added setup for OTG host pins Alexander Shiyan
@ 2012-07-23 20:13 ` Sascha Hauer
2 siblings, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2012-07-23 20:13 UTC (permalink / raw)
To: Alexander Shiyan; +Cc: barebox
On Sat, Jul 21, 2012 at 08:50:07AM +0400, Alexander Shiyan wrote:
>
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Applied 1/3 and 3/3. Thanks
Sascha
> ---
> arch/arm/boards/pcm038/pcm038.c | 2 --
> include/mfd/mc13xxx.h | 23 ++++++++++++++++++++++-
> 2 files changed, 22 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/boards/pcm038/pcm038.c b/arch/arm/boards/pcm038/pcm038.c
> index badc978..ffd8d87 100644
> --- a/arch/arm/boards/pcm038/pcm038.c
> +++ b/arch/arm/boards/pcm038/pcm038.c
> @@ -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;
> diff --git a/include/mfd/mc13xxx.h b/include/mfd/mc13xxx.h
> index 2880307..632c9fb 100644
> --- a/include/mfd/mc13xxx.h
> +++ b/include/mfd/mc13xxx.h
> @@ -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 */
> --
> 1.7.3.4
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-07-23 20:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-21 4:50 [PATCH 1/3] mc13xxx: Added dummy definitions if CONFIG_MFD_MC13XXX is not set Alexander Shiyan
2012-07-21 4:50 ` [PATCH 2/3] mc13xxx: Hide struct mc13xxx from board support code Alexander Shiyan
2012-07-21 5:11 ` Alexander Shiyan
2012-07-21 4:50 ` [PATCH 3/3] PCM038: Added setup for OTG host pins Alexander Shiyan
2012-07-23 20:13 ` [PATCH 1/3] mc13xxx: Added dummy definitions if CONFIG_MFD_MC13XXX is not set Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox