Re: [RFC 2/2] omap4: board-omap4pcm049: add Phytec phyCORE-OMAP4

2011-07-21 Thread Tony Lindgren
* Jan Weitzel j.weit...@phytec.de [110719 04:40]:
 --- a/arch/arm/mach-omap2/Makefile
 +++ b/arch/arm/mach-omap2/Makefile
 @@ -240,6 +240,10 @@ obj-$(CONFIG_MACH_OMAP4_PANDA)   += 
 board-omap4panda.o \
  board-omap4panda-common.o \
  hsmmc.o \
  omap_phy_internal.o
 +obj-$(CONFIG_MACH_MACH_PCM049)   += board-pcm049.o \


Extra mach above?

 +board-omap4panda-common.o \
 +hsmmc.o \
 +omap_phy_internal.o
  
  obj-$(CONFIG_MACH_OMAP3517EVM)   += board-am3517evm.o \
  omap_phy_internal.o \

Maybe use just board-panda-common.o here instead? And in the Makefile
it can be compiled in with something like:

obj-$(CONFIG_MACH_OMAP4_PANDA)  += board-panda-common.o
obj-$(CONFIG_MACH_PCM049)   += board-panda-common.o
...

obj-$(CONFIG_MACH_OMAP4_PANDA)  += board-omap4panda.o
obj-$(CONFIG_MACH_PCM049)   += board-pcm049.o
...

I already posted a patch to get rid of repeating the hsmmc.o
for each board using it.

 +#include linux/kernel.h
 +#include linux/init.h
 +#include linux/platform_device.h
 +#include linux/clk.h
 +#include linux/io.h
 +#include linux/leds.h
 +#include linux/gpio.h
 +#include linux/usb/otg.h
 +#include linux/i2c/twl.h
 +#include linux/i2c/at24.h
 +#include linux/mfd/stmpe.h
 +#include linux/leds-pca9532.h
 +#include linux/regulator/machine.h
 +#include linux/regulator/fixed.h
 +#include linux/wl12xx.h
 +#include linux/smsc911x.h
 +
 +#include mach/hardware.h
 +#include mach/omap4-common.h
 +#include asm/mach-types.h
 +#include asm/mach/arch.h
 +#include asm/mach/map.h
 +#include video/omapdss.h
 +
 +#include plat/board.h
 +#include plat/common.h
 +#include plat/usb.h
 +#include plat/gpmc.h
 +#include plat/gpmc-smsc911x.h
 +#include plat/mmc.h
 +#include video/omap-panel-generic-dpi.h
 +
 +#include hsmmc.h
 +#include control.h
 +#include mux.h
 +#include common-board-devices.h
 +#include board-omap4panda-common.h

Maybe check which includes are now needed with the panda-common?

 +struct omap_dss_device pcm049_dpi_device = {
 + .type   = OMAP_DISPLAY_TYPE_DPI,
 + .name   = dpi,
 + .driver_name= generic_dpi_panel,
 + .data   = omap4_dpi_panel,
 + .phy.dpi.data_lines = 24,
 + .channel= OMAP_DSS_CHANNEL_LCD2,
 +};

Usually tabs are used for aligning the structs like above..

 +static struct omap_dss_device  pcm049_dvi_device = {
 + .name = dvi,
 + .driver_name = hdmi_panel,
 + .type = OMAP_DISPLAY_TYPE_HDMI,

.. so please align the structs with tabs for the new data too.
Please check the data structs in all your patches while at it.
Also looks like there's an extra space above before
pcm049_dvi_device.

 +static struct stmpe_platform_data pba_stm_pdata = {
 + .blocks = STMPE_BLOCK_GPIO | STMPE_BLOCK_TOUCHSCREEN,
 + .irq_base = TWL6030_IRQ_END,
 + .irq_trigger = IRQF_TRIGGER_RISING,
 + .irq_invert_polarity = true,
 + .gpio = pba_gpio_stm_data,
 + .ts = pba_ts_stm_pdata,
 +};

Here too please check the alignment.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC 2/2] omap4: board-omap4pcm049: add Phytec phyCORE-OMAP4

2011-07-19 Thread Jan Weitzel
Adds support for the Phytec OMAP4430 board called phyCORE-OMAP4 PCM049.

Signed-off-by: Jan Weitzel j.weit...@phytec.de
---
 arch/arm/mach-omap2/Kconfig  |6 +
 arch/arm/mach-omap2/Makefile |4 +
 arch/arm/mach-omap2/board-omap4pcm049.c  |  368 ++
 arch/arm/plat-omap/include/plat/uncompress.h |1 +
 4 files changed, 379 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-omap2/board-omap4pcm049.c

diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 6b88799..d5e4b60 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -333,6 +333,12 @@ config MACH_OMAP4_PANDA
select OMAP_PACKAGE_CBS
select REGULATOR_FIXED_VOLTAGE
 
+config MACH_PCM049
+   bool OMAP4 based phyCORE OMAP4
+   depends on ARCH_OMAP4
+   default y
+   select OMAP_PACKAGE_CBS
+
 config OMAP3_EMU
bool OMAP3 debugging peripherals
depends on ARCH_OMAP3
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 5d829d6..6cc4ccb 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -240,6 +240,10 @@ obj-$(CONFIG_MACH_OMAP4_PANDA) += 
board-omap4panda.o \
   board-omap4panda-common.o \
   hsmmc.o \
   omap_phy_internal.o
+obj-$(CONFIG_MACH_MACH_PCM049) += board-pcm049.o \
+  board-omap4panda-common.o \
+  hsmmc.o \
+  omap_phy_internal.o
 
 obj-$(CONFIG_MACH_OMAP3517EVM) += board-am3517evm.o \
   omap_phy_internal.o \
diff --git a/arch/arm/mach-omap2/board-omap4pcm049.c 
b/arch/arm/mach-omap2/board-omap4pcm049.c
new file mode 100644
index 000..117334e
--- /dev/null
+++ b/arch/arm/mach-omap2/board-omap4pcm049.c
@@ -0,0 +1,368 @@
+/*
+ * Board support file for Phytec phyCORE-OMAP4 Board.
+ *
+ * Copyright (C) 2011 Phytec Messtechnik GmbH
+ *
+ * Author: Jan Weitzel armli...@phytec.de
+ *
+ * Based on mach-omap2/board-omap4panda.c
+ *
+ * Author: David Anders x0132...@ti.com
+ *
+ * Author: Santosh Shilimkar santosh.shilim...@ti.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/kernel.h
+#include linux/init.h
+#include linux/platform_device.h
+#include linux/clk.h
+#include linux/io.h
+#include linux/leds.h
+#include linux/gpio.h
+#include linux/usb/otg.h
+#include linux/i2c/twl.h
+#include linux/i2c/at24.h
+#include linux/mfd/stmpe.h
+#include linux/leds-pca9532.h
+#include linux/regulator/machine.h
+#include linux/regulator/fixed.h
+#include linux/wl12xx.h
+#include linux/smsc911x.h
+
+#include mach/hardware.h
+#include mach/omap4-common.h
+#include asm/mach-types.h
+#include asm/mach/arch.h
+#include asm/mach/map.h
+#include video/omapdss.h
+
+#include plat/board.h
+#include plat/common.h
+#include plat/usb.h
+#include plat/gpmc.h
+#include plat/gpmc-smsc911x.h
+#include plat/mmc.h
+#include video/omap-panel-generic-dpi.h
+
+#include hsmmc.h
+#include control.h
+#include mux.h
+#include common-board-devices.h
+#include board-omap4panda-common.h
+
+#define OMAP4_PCM049_ETH_GPIO_IRQ  121
+#define OMAP4_PCM049_ETH_CS5
+#define OMAP4_PCM049_STMPE811_GPIO_IRQ 117
+#define OMAP4_PCM049_LCD_ENABLE118
+
+/* phyCORE OMAP4 */
+#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
+static struct omap_smsc911x_platform_data __initdata board_smsc911x_data = {
+   .cs = OMAP4_PCM049_ETH_CS,
+   .gpio_irq   = OMAP4_PCM049_ETH_GPIO_IRQ,
+   .gpio_reset = -EINVAL,
+   .flags  = SMSC911X_USE_16BIT,
+};
+
+static inline void __init pcm049_init_smsc911x(void)
+{
+   omap_mux_init_gpio(OMAP4_PCM049_ETH_GPIO_IRQ, OMAP_PIN_INPUT);
+   gpmc_smsc911x_init(board_smsc911x_data);
+}
+#else
+static inline void __init pcm049_init_smsc911x(void) { return; }
+#endif
+
+/* Fixed regulator for max1027 */
+static struct regulator_consumer_supply pcm049_vcc_3v3_consumer_supply[] = {
+   REGULATOR_SUPPLY(vcc, 4-0064),
+};
+
+struct regulator_init_data pcm049_vcc_3v3_initdata = {
+   .consumer_supplies = pcm049_vcc_3v3_consumer_supply,
+   .num_consumer_supplies = ARRAY_SIZE(pcm049_vcc_3v3_consumer_supply),
+   .constraints = {
+   .valid_ops_mask = REGULATOR_CHANGE_STATUS,
+   },
+};
+
+static struct fixed_voltage_config pcm049_vcc_3v3_config = {
+   .supply_name= pcm049_vcc_3v3,
+   .microvolts = 330,
+   .gpio   = -EINVAL,
+   .enabled_at_boot= 1,
+   .init_data  =