From mboxrd@z Thu Jan 1 00:00:00 1970 From: git@ipfire.org To: ipfire-scm@lists.ipfire.org Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 983203fa03b187602dc9f3d7e6d2793af0b77133 Date: Sat, 15 Feb 2014 17:51:01 +0100 Message-ID: <20140215165102.15CBC21069@argus.ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0705280485174111285==" List-Id: --===============0705280485174111285== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree". The branch, next has been updated via 983203fa03b187602dc9f3d7e6d2793af0b77133 (commit) via e1279cb36c29193bb2a505014924a4ae21c3e439 (commit) via 841193ead5980056d913346dca5ef5f2412db520 (commit) via 3bf58b324c24be0a43b15a55304958b6e02937fb (commit) via d006af40db7fdc48afe034d316aae045087a7569 (commit) from c59be1252d82439b2c6ea9a08a730dbf35950f3c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 983203fa03b187602dc9f3d7e6d2793af0b77133 Author: Arne Fitzenreiter Date: Sat Feb 15 17:50:00 2014 +0100 u-boot: limit videores to 800x600. =20 pandaboard has display problems on console with higher resolutions. commit e1279cb36c29193bb2a505014924a4ae21c3e439 Author: Arne Fitzenreiter Date: Sat Feb 15 17:49:17 2014 +0100 kernel: disable cpu-idle and debug_ll on arm-multiarch kernel. commit 841193ead5980056d913346dca5ef5f2412db520 Merge: 3bf58b3 c59be12 Author: Arne Fitzenreiter Date: Sat Feb 15 17:48:35 2014 +0100 Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next commit 3bf58b324c24be0a43b15a55304958b6e02937fb Merge: d006af4 e3cbe60 Author: Arne Fitzenreiter Date: Fri Feb 14 23:41:45 2014 +0100 Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next commit d006af40db7fdc48afe034d316aae045087a7569 Author: Arne Fitzenreiter Date: Fri Feb 14 23:41:13 2014 +0100 kernel: add some omap/pandaboard patches. ----------------------------------------------------------------------- Summary of changes: config/kernel/kernel.config.armv5tel-ipfire-multi | 34 +- config/u-boot/boot.scr | Bin 460 -> 453 bytes config/u-boot/boot.script | 2 +- lfs/linux | 36 +- ...wl-common-Add-default-power-configuration.patch | 88 ++++ ...1-omap3isp-Use-the-common-clock-framework.patch | 444 +++++++++++++++++++= ++ .../omap/3isp/0002-mt9m032-Fix-PLL-setup.patch | 91 +++++ ...03-mt9m032-Define-MT9M032_READ_MODE1-bits.patch | 55 +++ .../0004-mt9p031-Use-devm_-managed-helpers.patch | 62 +++ .../0005-mt9p031-Add-support-for-regulators.patch | 82 ++++ ...06-mt9p031-Use-the-common-clock-framework.patch | 110 +++++ ...b-add-Toshiba-LTA070B220F-800x480-support.patch | 30 ++ ...ght-Add-TLC59108-backlight-control-driver.patch | 217 ++++++++++ ...003-tlc59108-adjust-for-beagleboard-uLCD7.patch | 124 ++++++ .../omap/beagle/0004-zeroMAP-Open-your-eyes.patch | 31 ++ ...P-Beagle-use-TWL4030-generic-reset-script.patch | 29 ++ .../0006-DSS2-use-DSI-PLL-for-DPI-with-OMAP3.patch | 28 ++ ...nsion-add-buddy-param-for-expansionboard-.patch | 63 +++ .../0002-Beagle-expansion-add-zippy.patch | 242 +++++++++++ .../0003-Beagle-expansion-add-zippy2.patch | 86 ++++ .../0004-Beagle-expansion-add-trainer.patch | 55 +++ ...agle-expansion-add-CircuitCo-ulcd-Support.patch | 285 +++++++++++++ .../expansion/0006-Beagle-expansion-add-wifi.patch | 180 +++++++++ .../0007-Beagle-expansion-add-beaglefpga.patch | 117 ++++++ .../0008-Beagle-expansion-add-spidev.patch | 35 ++ ...Beagle-expansion-add-Aptina-li5m03-camera.patch | 217 ++++++++++ ...gle-expansion-add-LSR-COM6L-Adapter-Board.patch | 123 ++++++ ...nsion-LSR-COM6L-Adapter-Board-also-initia.patch | 73 ++++ ...P-Beagle-expansion-extend-spidev-to-uart2.patch | 43 ++ .../panda/0001-panda-fix-wl12xx-regulator.patch | 27 ++ .../0002-ti-st-st-kim-fixing-firmware-path.patch | 36 ++ .../panda/0003-Panda-expansion-add-spidev.patch | 112 ++++++ ...andaES-disable-cpufreq-so-board-will-boot.patch | 38 ++ ...kpoint-Enable-debug-powerdown-only-if-sys.patch | 122 ++++++ ...gulator-twl-Remove-TWL6030_FIXED_RESOURCE.patch | 39 ++ ...lator-twl-Remove-another-unused-variable-.patch | 34 ++ ...lator-twl-Remove-references-to-the-twl403.patch | 28 ++ ...lator-twl-Remove-references-to-32kHz-cloc.patch | 49 +++ .../panda/0011-panda-spidev-setup-pinmux.patch | 50 +++ ...MAP-DSS2-add-bootarg-for-selecting-svideo.patch | 78 ++++ .../sakoman/0002-video-add-timings-for-hd720.patch | 28 ++ ...cache-flush-management-symbols-when-MULTI.patch | 34 ++ 42 files changed, 3624 insertions(+), 33 deletions(-) create mode 100644 src/patches/kernel/omap/0002-omap2-twl-common-Add-default= -power-configuration.patch create mode 100644 src/patches/kernel/omap/3isp/0001-omap3isp-Use-the-common= -clock-framework.patch create mode 100644 src/patches/kernel/omap/3isp/0002-mt9m032-Fix-PLL-setup.p= atch create mode 100644 src/patches/kernel/omap/3isp/0003-mt9m032-Define-MT9M032_= READ_MODE1-bits.patch create mode 100644 src/patches/kernel/omap/3isp/0004-mt9p031-Use-devm_-manag= ed-helpers.patch create mode 100644 src/patches/kernel/omap/3isp/0005-mt9p031-Add-support-for= -regulators.patch create mode 100644 src/patches/kernel/omap/3isp/0006-mt9p031-Use-the-common-= clock-framework.patch create mode 100644 src/patches/kernel/omap/beagle/0001-meego-modedb-add-Tosh= iba-LTA070B220F-800x480-support.patch create mode 100644 src/patches/kernel/omap/beagle/0002-backlight-Add-TLC5910= 8-backlight-control-driver.patch create mode 100644 src/patches/kernel/omap/beagle/0003-tlc59108-adjust-for-b= eagleboard-uLCD7.patch create mode 100644 src/patches/kernel/omap/beagle/0004-zeroMAP-Open-your-eye= s.patch create mode 100644 src/patches/kernel/omap/beagle/0005-ARM-OMAP-Beagle-use-T= WL4030-generic-reset-script.patch create mode 100644 src/patches/kernel/omap/beagle/0006-DSS2-use-DSI-PLL-for-= DPI-with-OMAP3.patch create mode 100644 src/patches/kernel/omap/beagle/expansion/0001-Beagle-expa= nsion-add-buddy-param-for-expansionboard-.patch create mode 100644 src/patches/kernel/omap/beagle/expansion/0002-Beagle-expa= nsion-add-zippy.patch create mode 100644 src/patches/kernel/omap/beagle/expansion/0003-Beagle-expa= nsion-add-zippy2.patch create mode 100644 src/patches/kernel/omap/beagle/expansion/0004-Beagle-expa= nsion-add-trainer.patch create mode 100644 src/patches/kernel/omap/beagle/expansion/0005-Beagle-expa= nsion-add-CircuitCo-ulcd-Support.patch create mode 100644 src/patches/kernel/omap/beagle/expansion/0006-Beagle-expa= nsion-add-wifi.patch create mode 100644 src/patches/kernel/omap/beagle/expansion/0007-Beagle-expa= nsion-add-beaglefpga.patch create mode 100644 src/patches/kernel/omap/beagle/expansion/0008-Beagle-expa= nsion-add-spidev.patch create mode 100644 src/patches/kernel/omap/beagle/expansion/0009-Beagle-expa= nsion-add-Aptina-li5m03-camera.patch create mode 100644 src/patches/kernel/omap/beagle/expansion/0010-Beagle-expa= nsion-add-LSR-COM6L-Adapter-Board.patch create mode 100644 src/patches/kernel/omap/beagle/expansion/0011-Beagle-expa= nsion-LSR-COM6L-Adapter-Board-also-initia.patch create mode 100644 src/patches/kernel/omap/beagle/expansion/0011-WIP-Beagle-= expansion-extend-spidev-to-uart2.patch create mode 100644 src/patches/kernel/omap/panda/0001-panda-fix-wl12xx-regul= ator.patch create mode 100644 src/patches/kernel/omap/panda/0002-ti-st-st-kim-fixing-fi= rmware-path.patch create mode 100644 src/patches/kernel/omap/panda/0003-Panda-expansion-add-sp= idev.patch create mode 100644 src/patches/kernel/omap/panda/0004-HACK-PandaES-disable-c= pufreq-so-board-will-boot.patch create mode 100644 src/patches/kernel/omap/panda/0006-ARM-hw_breakpoint-Enab= le-debug-powerdown-only-if-sys.patch create mode 100644 src/patches/kernel/omap/panda/0007-Revert-regulator-twl-R= emove-TWL6030_FIXED_RESOURCE.patch create mode 100644 src/patches/kernel/omap/panda/0008-Revert-regulator-twl-R= emove-another-unused-variable-.patch create mode 100644 src/patches/kernel/omap/panda/0009-Revert-regulator-twl-R= emove-references-to-the-twl403.patch create mode 100644 src/patches/kernel/omap/panda/0010-Revert-regulator-twl-R= emove-references-to-32kHz-cloc.patch create mode 100644 src/patches/kernel/omap/panda/0011-panda-spidev-setup-pin= mux.patch create mode 100644 src/patches/kernel/omap/sakoman/0001-OMAP-DSS2-add-bootar= g-for-selecting-svideo.patch create mode 100644 src/patches/kernel/omap/sakoman/0002-video-add-timings-fo= r-hd720.patch create mode 100644 src/patches/kernel/omap/sgx/0001-arm-Export-cache-flush-m= anagement-symbols-when-MULTI.patch Difference in files: diff --git a/config/kernel/kernel.config.armv5tel-ipfire-multi b/config/kerne= l/kernel.config.armv5tel-ipfire-multi index 128742d..d35e569 100644 --- a/config/kernel/kernel.config.armv5tel-ipfire-multi +++ b/config/kernel/kernel.config.armv5tel-ipfire-multi @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 3.10.27-ipfire-multi Kernel Configuration +# Linux/arm 3.10.29-ipfire-multi Kernel Configuration # CONFIG_ARM=3Dy CONFIG_MIGHT_HAVE_PCI=3Dy @@ -649,7 +649,7 @@ CONFIG_GENERIC_CPUFREQ_CPU0=3Dy CONFIG_ARM_IMX6Q_CPUFREQ=3Dm # CONFIG_ARM_KIRKWOOD_CPUFREQ is not set CONFIG_ARM_OMAP2PLUS_CPUFREQ=3Dy -CONFIG_CPU_IDLE=3Dy +# CONFIG_CPU_IDLE is not set CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=3Dy CONFIG_CPU_IDLE_GOV_LADDER=3Dy CONFIG_CPU_IDLE_GOV_MENU=3Dy @@ -3631,6 +3631,7 @@ CONFIG_BACKLIGHT_CLASS_DEVICE=3Dy # CONFIG_BACKLIGHT_LM3639 is not set # CONFIG_BACKLIGHT_LP855X is not set # CONFIG_BACKLIGHT_PANDORA is not set +# CONFIG_BACKLIGHT_TLC59108 is not set =20 # # Console display driver support @@ -4926,35 +4927,10 @@ CONFIG_STRICT_DEVMEM=3Dy CONFIG_ARM_UNWIND=3Dy CONFIG_OLD_MCOUNT=3Dy # CONFIG_DEBUG_USER is not set -CONFIG_DEBUG_LL=3Dy -# CONFIG_DEBUG_ZYNQ_UART0 is not set -# CONFIG_DEBUG_ZYNQ_UART1 is not set -# CONFIG_DEBUG_IMX51_UART is not set -# CONFIG_DEBUG_IMX53_UART is not set -# CONFIG_DEBUG_IMX6Q_UART is not set -CONFIG_DEBUG_OMAP2PLUS_UART=3Dy -# CONFIG_DEBUG_VEXPRESS_UART0_DETECT is not set -# CONFIG_DEBUG_VEXPRESS_UART0_CA9 is not set -# CONFIG_DEBUG_VEXPRESS_UART0_RS1 is not set -# CONFIG_DEBUG_VT8500_UART0 is not set -# CONFIG_DEBUG_ICEDCC is not set -# CONFIG_DEBUG_SEMIHOSTING is not set +# CONFIG_DEBUG_LL is not set CONFIG_DEBUG_IMX_UART_PORT=3D1 -# CONFIG_DEBUG_OMAP2UART1 is not set -# CONFIG_DEBUG_OMAP2UART2 is not set -# CONFIG_DEBUG_OMAP2UART3 is not set -# CONFIG_DEBUG_OMAP3UART3 is not set -CONFIG_DEBUG_OMAP4UART3=3Dy -# CONFIG_DEBUG_OMAP3UART4 is not set -# CONFIG_DEBUG_OMAP4UART4 is not set -# CONFIG_DEBUG_TI81XXUART1 is not set -# CONFIG_DEBUG_TI81XXUART2 is not set -# CONFIG_DEBUG_TI81XXUART3 is not set -# CONFIG_DEBUG_AM33XXUART1 is not set -# CONFIG_DEBUG_ZOOM_UART is not set -CONFIG_DEBUG_LL_INCLUDE=3D"debug/omap2plus.S" +CONFIG_DEBUG_LL_INCLUDE=3D"mach/debug-macro.S" CONFIG_UNCOMPRESS_INCLUDE=3D"debug/uncompress.h" -CONFIG_EARLY_PRINTK=3Dy CONFIG_OC_ETM=3Dy # CONFIG_PID_IN_CONTEXTIDR is not set =20 diff --git a/config/u-boot/boot.scr b/config/u-boot/boot.scr index 0d36a6b..672b152 100755 Binary files a/config/u-boot/boot.scr and b/config/u-boot/boot.scr differ diff --git a/config/u-boot/boot.script b/config/u-boot/boot.script index 49e6c9c..66d7628 100755 --- a/config/u-boot/boot.script +++ b/config/u-boot/boot.script @@ -1,7 +1,7 @@ fatload mmc 0:1 0x82000000 zImage-ipfire-multi fatload mmc 0:1 0x85000000 uInit-ipfire-multi #fatload mmc 0:1 ${fdtaddr} omap4-${board_name}.dtb -setenv bootargs vram=3D32M earlyprintk console=3Dtty1 rootwait smsc95xx.maca= ddr=3D$usbethaddr root=3D/dev/mmcblk0p3 ro +setenv bootargs video=3D800x600 console=3Dtty1 rootwait smsc95xx.macaddr=3D$= usbethaddr root=3D/dev/mmcblk0p3 ro # Pandaboard has serious Problems in dt mode with kernel 3.10.x #bootz 0x82000000 0x85000000 ${fdtaddr} bootz 0x82000000 0x85000000 diff --git a/lfs/linux b/lfs/linux index 2a7eb32..d460708 100644 --- a/lfs/linux +++ b/lfs/linux @@ -163,11 +163,41 @@ endif =20 ifeq "$(KCFG)" "-multi" cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.27-fs-exec-= atomic64-operand-requires-impossible-reload.patch -# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2-0001-panda-= wlan-fix.patch -# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2-0002-panda-= i2c.patch -# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2-panda-reboo= t.patch cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10-smsc95xx-ad= d_mac_addr_param.patch =20 + # Patchset for Omap (beagle/panda). + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/0002-omap2= -twl-common-Add-default-power-configuration.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/sakoman/00= 01-OMAP-DSS2-add-bootarg-for-selecting-svideo.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/sakoman/00= 02-video-add-timings-for-hd720.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/beagle/exp= ansion/0001-Beagle-expansion-add-buddy-param-for-expansionboard-.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/beagle/exp= ansion/0002-Beagle-expansion-add-zippy.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/beagle/exp= ansion/0003-Beagle-expansion-add-zippy2.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/beagle/exp= ansion/0004-Beagle-expansion-add-trainer.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/beagle/exp= ansion/0005-Beagle-expansion-add-CircuitCo-ulcd-Support.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/beagle/exp= ansion/0006-Beagle-expansion-add-wifi.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/beagle/exp= ansion/0007-Beagle-expansion-add-beaglefpga.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/beagle/exp= ansion/0008-Beagle-expansion-add-spidev.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/beagle/exp= ansion/0009-Beagle-expansion-add-Aptina-li5m03-camera.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/beagle/exp= ansion/0010-Beagle-expansion-add-LSR-COM6L-Adapter-Board.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/beagle/exp= ansion/0011-Beagle-expansion-LSR-COM6L-Adapter-Board-also-initia.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/beagle/000= 1-meego-modedb-add-Toshiba-LTA070B220F-800x480-support.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/beagle/000= 2-backlight-Add-TLC59108-backlight-control-driver.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/beagle/000= 3-tlc59108-adjust-for-beagleboard-uLCD7.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/beagle/000= 4-zeroMAP-Open-your-eyes.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/beagle/000= 5-ARM-OMAP-Beagle-use-TWL4030-generic-reset-script.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/beagle/000= 6-DSS2-use-DSI-PLL-for-DPI-with-OMAP3.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/panda/0001= -panda-fix-wl12xx-regulator.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/panda/0002= -ti-st-st-kim-fixing-firmware-path.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/panda/0003= -Panda-expansion-add-spidev.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/panda/0004= -HACK-PandaES-disable-cpufreq-so-board-will-boot.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/panda/0006= -ARM-hw_breakpoint-Enable-debug-powerdown-only-if-sys.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/panda/0007= -Revert-regulator-twl-Remove-TWL6030_FIXED_RESOURCE.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/panda/0008= -Revert-regulator-twl-Remove-another-unused-variable-.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/panda/0009= -Revert-regulator-twl-Remove-references-to-the-twl403.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/panda/0010= -Revert-regulator-twl-Remove-references-to-32kHz-cloc.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/panda/0011= -panda-spidev-setup-pinmux.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/omap/sgx/0001-a= rm-Export-cache-flush-management-symbols-when-MULTI.patch + # Patchset for Wandboard. cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/wandboard/dts/0= 001-imx6qdl-wandboard-dts-backport.patch cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/kernel/wandboard/dts/0= 002-ARM-dts-imx6qdl-wandboard-add-gpio-lines-to-wandboar.patch diff --git a/src/patches/kernel/omap/0002-omap2-twl-common-Add-default-power-= configuration.patch b/src/patches/kernel/omap/0002-omap2-twl-common-Add-defau= lt-power-configuration.patch new file mode 100644 index 0000000..d27ad54 --- /dev/null +++ b/src/patches/kernel/omap/0002-omap2-twl-common-Add-default-power-configu= ration.patch @@ -0,0 +1,88 @@ +From 2e908aeebd6804296e7d14a96de6be1e2de38e93 Mon Sep 17 00:00:00 2001 +From: Matthias Brugger +Date: Wed, 23 Jan 2013 19:50:38 +0100 +Subject: [PATCH 2/2] omap2: twl-common: Add default power configuration + +This patch adds a generic power script configuration. +When rebooting an OMAP3530 at 125 MHz, the reboot hangs. +With the generic power script, TWL4030 will be reset +when a warm reset occures. This way the OMAP3530 does not +hang on reboot. + +Signed-off-by: Matthias Brugger +--- + arch/arm/mach-omap2/twl-common.c | 38 +++++++++++++++++++++++++++++++++++= +++ + arch/arm/mach-omap2/twl-common.h | 1 + + 2 files changed, 39 insertions(+) + +diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-comm= on.c +index e49b40b..f096beb 100644 +--- a/arch/arm/mach-omap2/twl-common.c ++++ b/arch/arm/mach-omap2/twl-common.c +@@ -120,6 +120,41 @@ static struct twl4030_audio_data omap3_audio_pdata =3D { + .codec =3D &omap3_codec, + }; +=20 ++static struct twl4030_ins wrst_seq[] __initdata =3D { ++ {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2}, ++ {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15}, ++ {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15}, ++ {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60}, ++ {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2}, ++ {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2}, ++}; ++ ++static struct twl4030_script wrst_script __initdata =3D { ++ .script =3D wrst_seq, ++ .size =3D ARRAY_SIZE(wrst_seq), ++ .flags =3D TWL4030_WRST_SCRIPT, ++}; ++ ++static struct twl4030_script *omap3_power_scripts[] __initdata =3D { ++ &wrst_script, ++}; ++ ++static struct twl4030_resconfig omap3_rconfig[] =3D { ++ { .resource =3D RES_HFCLKOUT, .devgroup =3D DEV_GRP_P3, .type =3D -1, ++ .type2 =3D -1 }, ++ { .resource =3D RES_VDD1, .devgroup =3D DEV_GRP_P1, .type =3D -1, ++ .type2 =3D -1 }, ++ { .resource =3D RES_VDD2, .devgroup =3D DEV_GRP_P1, .type =3D -1, ++ .type2 =3D -1 }, ++ { 0, 0}, ++}; ++ ++static struct twl4030_power_data omap3_power_pdata =3D { ++ .scripts =3D omap3_power_scripts, ++ .num =3D ARRAY_SIZE(omap3_power_scripts), ++ .resource_config =3D omap3_rconfig, ++}; ++ + static struct regulator_consumer_supply omap3_vdda_dac_supplies[] =3D { + REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), + }; +@@ -224,6 +259,9 @@ void __init omap3_pmic_get_config(struct twl4030_platfor= m_data *pmic_data, + if (pdata_flags & TWL_COMMON_PDATA_AUDIO && !pmic_data->audio) + pmic_data->audio =3D &omap3_audio_pdata; +=20 ++ if (pdata_flags & TWL_COMMON_PDATA_POWER && !pmic_data->power) ++ pmic_data->power =3D &omap3_power_pdata; ++ + /* Common regulator configurations */ + if (regulators_flags & TWL_COMMON_REGULATOR_VDAC && !pmic_data->vdac) + pmic_data->vdac =3D &omap3_vdac_idata; +diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-comm= on.h +index dcfbad5..dbeb905 100644 +--- a/arch/arm/mach-omap2/twl-common.h ++++ b/arch/arm/mach-omap2/twl-common.h +@@ -7,6 +7,7 @@ + #define TWL_COMMON_PDATA_BCI (1 << 1) + #define TWL_COMMON_PDATA_MADC (1 << 2) + #define TWL_COMMON_PDATA_AUDIO (1 << 3) ++#define TWL_COMMON_PDATA_POWER (1 << 4) +=20 + /* Common LDO regulators for TWL4030/TWL6030 */ + #define TWL_COMMON_REGULATOR_VDAC (1 << 0) +--=20 +1.7.10.4 + diff --git a/src/patches/kernel/omap/3isp/0001-omap3isp-Use-the-common-clock-= framework.patch b/src/patches/kernel/omap/3isp/0001-omap3isp-Use-the-common-c= lock-framework.patch new file mode 100644 index 0000000..a61d5b8 --- /dev/null +++ b/src/patches/kernel/omap/3isp/0001-omap3isp-Use-the-common-clock-framewo= rk.patch @@ -0,0 +1,444 @@ +From 369b60c157f67a71a6f302ab9843ae2de1805a2a Mon Sep 17 00:00:00 2001 +From: Laurent Pinchart +Date: Mon, 22 Oct 2012 15:43:00 +0200 +Subject: [PATCH 1/6] omap3isp: Use the common clock framework + +Expose the two ISP external clocks XCLKA and XCLKB as common clocks for +subdev drivers. + +Signed-off-by: Laurent Pinchart +Acked-by: Mike Turquette +--- + drivers/media/platform/omap3isp/isp.c | 277 ++++++++++++++++++++++++------= --- + drivers/media/platform/omap3isp/isp.h | 22 ++- + include/media/omap3isp.h | 10 +- + 3 files changed, 225 insertions(+), 84 deletions(-) + +diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/= omap3isp/isp.c +index 6e5ad8e..1d7dbd5 100644 +--- a/drivers/media/platform/omap3isp/isp.c ++++ b/drivers/media/platform/omap3isp/isp.c +@@ -55,6 +55,7 @@ + #include +=20 + #include ++#include + #include + #include + #include +@@ -148,6 +149,201 @@ void omap3isp_flush(struct isp_device *isp) + isp_reg_readl(isp, OMAP3_ISP_IOMEM_MAIN, ISP_REVISION); + } +=20 ++/* ------------------------------------------------------------------------= ----- ++ * XCLK ++ */ ++ ++#define to_isp_xclk(_hw) container_of(_hw, struct isp_xclk, hw) ++ ++static void isp_xclk_update(struct isp_xclk *xclk, u32 divider) ++{ ++ switch (xclk->id) { ++ case ISP_XCLK_A: ++ isp_reg_clr_set(xclk->isp, OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL, ++ ISPTCTRL_CTRL_DIVA_MASK, ++ divider << ISPTCTRL_CTRL_DIVA_SHIFT); ++ break; ++ case ISP_XCLK_B: ++ isp_reg_clr_set(xclk->isp, OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL, ++ ISPTCTRL_CTRL_DIVB_MASK, ++ divider << ISPTCTRL_CTRL_DIVB_SHIFT); ++ break; ++ } ++} ++ ++static int isp_xclk_prepare(struct clk_hw *hw) ++{ ++ struct isp_xclk *xclk =3D to_isp_xclk(hw); ++ ++ omap3isp_get(xclk->isp); ++ ++ return 0; ++} ++ ++static void isp_xclk_unprepare(struct clk_hw *hw) ++{ ++ struct isp_xclk *xclk =3D to_isp_xclk(hw); ++ ++ omap3isp_put(xclk->isp); ++} ++ ++static int isp_xclk_enable(struct clk_hw *hw) ++{ ++ struct isp_xclk *xclk =3D to_isp_xclk(hw); ++ unsigned long flags; ++ ++ spin_lock_irqsave(&xclk->lock, flags); ++ isp_xclk_update(xclk, xclk->divider); ++ xclk->enabled =3D true; ++ spin_unlock_irqrestore(&xclk->lock, flags); ++ ++ return 0; ++} ++ ++static void isp_xclk_disable(struct clk_hw *hw) ++{ ++ struct isp_xclk *xclk =3D to_isp_xclk(hw); ++ unsigned long flags; ++ ++ spin_lock_irqsave(&xclk->lock, flags); ++ isp_xclk_update(xclk, 0); ++ xclk->enabled =3D false; ++ spin_unlock_irqrestore(&xclk->lock, flags); ++} ++ ++static unsigned long isp_xclk_recalc_rate(struct clk_hw *hw, ++ unsigned long parent_rate) ++{ ++ struct isp_xclk *xclk =3D to_isp_xclk(hw); ++ ++ return parent_rate / xclk->divider; ++} ++ ++static u32 isp_xclk_calc_divider(unsigned long *rate, unsigned long parent_= rate) ++{ ++ u32 divider; ++ ++ if (*rate >=3D parent_rate) { ++ *rate =3D parent_rate; ++ return ISPTCTRL_CTRL_DIV_BYPASS; ++ } ++ ++ divider =3D DIV_ROUND_CLOSEST(parent_rate, *rate); ++ if (divider >=3D ISPTCTRL_CTRL_DIV_BYPASS) ++ divider =3D ISPTCTRL_CTRL_DIV_BYPASS - 1; ++ ++ *rate =3D parent_rate / divider; ++ return divider; ++} ++ ++static long isp_xclk_round_rate(struct clk_hw *hw, unsigned long rate, ++ unsigned long *parent_rate) ++{ ++ isp_xclk_calc_divider(&rate, *parent_rate); ++ return rate; ++} ++ ++static int isp_xclk_set_rate(struct clk_hw *hw, unsigned long rate, ++ unsigned long parent_rate) ++{ ++ struct isp_xclk *xclk =3D to_isp_xclk(hw); ++ unsigned long flags; ++ u32 divider; ++ ++ divider =3D isp_xclk_calc_divider(&rate, parent_rate); ++ ++ spin_lock_irqsave(&xclk->lock, flags); ++ ++ xclk->divider =3D divider; ++ if (xclk->enabled) ++ isp_xclk_update(xclk, divider); ++ ++ spin_unlock_irqrestore(&xclk->lock, flags); ++ ++ dev_dbg(xclk->isp->dev, "%s: cam_xclk%c set to %lu Hz (div %u)\n", ++ __func__, xclk->id =3D=3D ISP_XCLK_A ? 'a' : 'b', rate, divider); ++ return 0; ++} ++ ++static const struct clk_ops isp_xclk_ops =3D { ++ .prepare =3D isp_xclk_prepare, ++ .unprepare =3D isp_xclk_unprepare, ++ .enable =3D isp_xclk_enable, ++ .disable =3D isp_xclk_disable, ++ .recalc_rate =3D isp_xclk_recalc_rate, ++ .round_rate =3D isp_xclk_round_rate, ++ .set_rate =3D isp_xclk_set_rate, ++}; ++ ++static const char *isp_xclk_parent_name =3D "cam_mclk"; ++ ++static const struct clk_init_data isp_xclk_init_data =3D { ++ .name =3D "cam_xclk", ++ .ops =3D &isp_xclk_ops, ++ .parent_names =3D &isp_xclk_parent_name, ++ .num_parents =3D 1, ++}; ++ ++static int isp_xclk_init(struct isp_device *isp) ++{ ++ struct isp_platform_data *pdata =3D isp->pdata; ++ struct clk_init_data init; ++ unsigned int i; ++ ++ for (i =3D 0; i < ARRAY_SIZE(isp->xclks); ++i) { ++ struct isp_xclk *xclk =3D &isp->xclks[i]; ++ struct clk *clk; ++ ++ xclk->isp =3D isp; ++ xclk->id =3D i =3D=3D 0 ? ISP_XCLK_A : ISP_XCLK_B; ++ xclk->divider =3D 1; ++ spin_lock_init(&xclk->lock); ++ ++ init.name =3D i =3D=3D 0 ? "cam_xclka" : "cam_xclkb"; ++ init.ops =3D &isp_xclk_ops; ++ init.parent_names =3D &isp_xclk_parent_name; ++ init.num_parents =3D 1; ++ ++ xclk->hw.init =3D &init; ++ ++ clk =3D devm_clk_register(isp->dev, &xclk->hw); ++ if (IS_ERR(clk)) ++ return PTR_ERR(clk); ++ ++ if (pdata->xclks[i].con_id =3D=3D NULL && ++ pdata->xclks[i].dev_id =3D=3D NULL) ++ continue; ++ ++ xclk->lookup =3D kzalloc(sizeof(*xclk->lookup), GFP_KERNEL); ++ if (xclk->lookup =3D=3D NULL) ++ return -ENOMEM; ++ ++ xclk->lookup->con_id =3D pdata->xclks[i].con_id; ++ xclk->lookup->dev_id =3D pdata->xclks[i].dev_id; ++ xclk->lookup->clk =3D clk; ++ ++ clkdev_add(xclk->lookup); ++ } ++ ++ return 0; ++} ++ ++static void isp_xclk_cleanup(struct isp_device *isp) ++{ ++ unsigned int i; ++ ++ for (i =3D 0; i < ARRAY_SIZE(isp->xclks); ++i) { ++ struct isp_xclk *xclk =3D &isp->xclks[i]; ++ ++ if (xclk->lookup) ++ clkdev_drop(xclk->lookup); ++ } ++} ++ ++/* ------------------------------------------------------------------------= ----- ++ * Interrupts ++ */ ++ + /* + * isp_enable_interrupts - Enable ISP interrupts. + * @isp: OMAP3 ISP device +@@ -180,80 +376,6 @@ static void isp_disable_interrupts(struct isp_device *i= sp) + isp_reg_writel(isp, 0, OMAP3_ISP_IOMEM_MAIN, ISP_IRQ0ENABLE); + } +=20 +-/** +- * isp_set_xclk - Configures the specified cam_xclk to the desired frequenc= y. +- * @isp: OMAP3 ISP device +- * @xclk: Desired frequency of the clock in Hz. 0 =3D stable low, 1 is stab= le high +- * @xclksel: XCLK to configure (0 =3D A, 1 =3D B). +- * +- * Configures the specified MCLK divisor in the ISP timing control register +- * (TCTRL_CTRL) to generate the desired xclk clock value. +- * +- * Divisor =3D cam_mclk_hz / xclk +- * +- * Returns the final frequency that is actually being generated +- **/ +-static u32 isp_set_xclk(struct isp_device *isp, u32 xclk, u8 xclksel) +-{ +- u32 divisor; +- u32 currentxclk; +- unsigned long mclk_hz; +- +- if (!omap3isp_get(isp)) +- return 0; +- +- mclk_hz =3D clk_get_rate(isp->clock[ISP_CLK_CAM_MCLK]); +- +- if (xclk >=3D mclk_hz) { +- divisor =3D ISPTCTRL_CTRL_DIV_BYPASS; +- currentxclk =3D mclk_hz; +- } else if (xclk >=3D 2) { +- divisor =3D mclk_hz / xclk; +- if (divisor >=3D ISPTCTRL_CTRL_DIV_BYPASS) +- divisor =3D ISPTCTRL_CTRL_DIV_BYPASS - 1; +- currentxclk =3D mclk_hz / divisor; +- } else { +- divisor =3D xclk; +- currentxclk =3D 0; +- } +- +- switch (xclksel) { +- case ISP_XCLK_A: +- isp_reg_clr_set(isp, OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL, +- ISPTCTRL_CTRL_DIVA_MASK, +- divisor << ISPTCTRL_CTRL_DIVA_SHIFT); +- dev_dbg(isp->dev, "isp_set_xclk(): cam_xclka set to %d Hz\n", +- currentxclk); +- break; +- case ISP_XCLK_B: +- isp_reg_clr_set(isp, OMAP3_ISP_IOMEM_MAIN, ISP_TCTRL_CTRL, +- ISPTCTRL_CTRL_DIVB_MASK, +- divisor << ISPTCTRL_CTRL_DIVB_SHIFT); +- dev_dbg(isp->dev, "isp_set_xclk(): cam_xclkb set to %d Hz\n", +- currentxclk); +- break; +- case ISP_XCLK_NONE: +- default: +- omap3isp_put(isp); +- dev_dbg(isp->dev, "ISP_ERR: isp_set_xclk(): Invalid requested " +- "xclk. Must be 0 (A) or 1 (B).\n"); +- return -EINVAL; +- } +- +- /* Do we go from stable whatever to clock? */ +- if (divisor >=3D 2 && isp->xclk_divisor[xclksel - 1] < 2) +- omap3isp_get(isp); +- /* Stopping the clock. */ +- else if (divisor < 2 && isp->xclk_divisor[xclksel - 1] >=3D 2) +- omap3isp_put(isp); +- +- isp->xclk_divisor[xclksel - 1] =3D divisor; +- +- omap3isp_put(isp); +- +- return currentxclk; +-} +- + /* + * isp_core_init - ISP core settings + * @isp: OMAP3 ISP device +@@ -1969,6 +2091,7 @@ static int isp_remove(struct platform_device *pdev) +=20 + isp_unregister_entities(isp); + isp_cleanup_modules(isp); ++ isp_xclk_cleanup(isp); +=20 + __omap3isp_get(isp, false); + iommu_detach_device(isp->domain, &pdev->dev); +@@ -2042,7 +2165,6 @@ static int isp_probe(struct platform_device *pdev) + } +=20 + isp->autoidle =3D autoidle; +- isp->platform_cb.set_xclk =3D isp_set_xclk; +=20 + mutex_init(&isp->isp_mutex); + spin_lock_init(&isp->stat_lock); +@@ -2093,6 +2215,10 @@ static int isp_probe(struct platform_device *pdev) + if (ret < 0) + goto error_isp; +=20 ++ ret =3D isp_xclk_init(isp); ++ if (ret < 0) ++ goto error_isp; ++ + /* Memory resources */ + for (m =3D 0; m < ARRAY_SIZE(isp_res_maps); m++) + if (isp->revision =3D=3D isp_res_maps[m].isp_rev) +@@ -2162,6 +2288,7 @@ detach_dev: + free_domain: + iommu_domain_free(isp->domain); + error_isp: ++ isp_xclk_cleanup(isp); + omap3isp_put(isp); + error: + platform_set_drvdata(pdev, NULL); +diff --git a/drivers/media/platform/omap3isp/isp.h b/drivers/media/platform/= omap3isp/isp.h +index c77e1f2..cd3eff4 100644 +--- a/drivers/media/platform/omap3isp/isp.h ++++ b/drivers/media/platform/omap3isp/isp.h +@@ -29,6 +29,7 @@ +=20 + #include + #include ++#include + #include + #include + #include +@@ -125,8 +126,20 @@ struct isp_reg { + u32 val; + }; +=20 +-struct isp_platform_callback { +- u32 (*set_xclk)(struct isp_device *isp, u32 xclk, u8 xclksel); ++enum isp_xclk_id { ++ ISP_XCLK_A, ++ ISP_XCLK_B, ++}; ++ ++struct isp_xclk { ++ struct isp_device *isp; ++ struct clk_hw hw; ++ struct clk_lookup *lookup; ++ enum isp_xclk_id id; ++ ++ spinlock_t lock; /* Protects enabled and divider */ ++ bool enabled; ++ unsigned int divider; + }; +=20 + /* +@@ -149,6 +162,7 @@ struct isp_platform_callback { + * @cam_mclk: Pointer to camera functional clock structure. + * @csi2_fck: Pointer to camera CSI2 complexIO clock structure. + * @l3_ick: Pointer to OMAP3 L3 bus interface clock. ++ * @xclks: External clocks provided by the ISP + * @irq: Currently attached ISP ISR callbacks information structure. + * @isp_af: Pointer to current settings for ISP AutoFocus SCM. + * @isp_hist: Pointer to current settings for ISP Histogram SCM. +@@ -185,12 +199,12 @@ struct isp_device { + int has_context; + int ref_count; + unsigned int autoidle; +- u32 xclk_divisor[2]; /* Two clocks, a and b. */ + #define ISP_CLK_CAM_ICK 0 + #define ISP_CLK_CAM_MCLK 1 + #define ISP_CLK_CSI2_FCK 2 + #define ISP_CLK_L3_ICK 3 + struct clk *clock[4]; ++ struct isp_xclk xclks[2]; +=20 + /* ISP modules */ + struct ispstat isp_af; +@@ -209,8 +223,6 @@ struct isp_device { + unsigned int subclk_resources; +=20 + struct iommu_domain *domain; +- +- struct isp_platform_callback platform_cb; + }; +=20 + #define v4l2_dev_to_isp_device(dev) \ +diff --git a/include/media/omap3isp.h b/include/media/omap3isp.h +index 9584269..c9d06d9 100644 +--- a/include/media/omap3isp.h ++++ b/include/media/omap3isp.h +@@ -29,10 +29,6 @@ + struct i2c_board_info; + struct isp_device; +=20 +-#define ISP_XCLK_NONE 0 +-#define ISP_XCLK_A 1 +-#define ISP_XCLK_B 2 +- + enum isp_interface_type { + ISP_INTERFACE_PARALLEL, + ISP_INTERFACE_CSI2A_PHY2, +@@ -153,7 +149,13 @@ struct isp_v4l2_subdevs_group { + } bus; /* gcc < 4.6.0 chokes on anonymous union initializers */ + }; +=20 ++struct isp_platform_xclk { ++ const char *dev_id; ++ const char *con_id; ++}; ++ + struct isp_platform_data { ++ struct isp_platform_xclk xclks[2]; + struct isp_v4l2_subdevs_group *subdevs; + void (*set_constraints)(struct isp_device *isp, bool enable); + }; +--=20 +1.7.10.4 + diff --git a/src/patches/kernel/omap/3isp/0002-mt9m032-Fix-PLL-setup.patch b/= src/patches/kernel/omap/3isp/0002-mt9m032-Fix-PLL-setup.patch new file mode 100644 index 0000000..9d2b19c --- /dev/null +++ b/src/patches/kernel/omap/3isp/0002-mt9m032-Fix-PLL-setup.patch @@ -0,0 +1,91 @@ +From 7c44c8a989ad01bd7cd02370d4ca4a742db218be Mon Sep 17 00:00:00 2001 +From: Laurent Pinchart +Date: Tue, 25 Sep 2012 15:46:34 +0200 +Subject: [PATCH 2/6] mt9m032: Fix PLL setup + +The MT9M032 PLL was assumed to be identical to the MT9P031 PLL but +differs significantly. Update the registers definitions and PLL limits +according to the datasheet. + +Signed-off-by: Laurent Pinchart +--- + drivers/media/i2c/mt9m032.c | 24 +++++++++++++----------- + 1 file changed, 13 insertions(+), 11 deletions(-) + +diff --git a/drivers/media/i2c/mt9m032.c b/drivers/media/i2c/mt9m032.c +index f80c1d7e..30d755a 100644 +--- a/drivers/media/i2c/mt9m032.c ++++ b/drivers/media/i2c/mt9m032.c +@@ -87,7 +87,7 @@ + #define MT9M032_RESTART 0x0b + #define MT9M032_RESET 0x0d + #define MT9M032_PLL_CONFIG1 0x11 +-#define MT9M032_PLL_CONFIG1_OUTDIV_MASK 0x3f ++#define MT9M032_PLL_CONFIG1_PREDIV_MASK 0x3f + #define MT9M032_PLL_CONFIG1_MUL_SHIFT 8 + #define MT9M032_READ_MODE1 0x1e + #define MT9M032_READ_MODE2 0x20 +@@ -106,6 +106,8 @@ + #define MT9M032_GAIN_AMUL_SHIFT 6 + #define MT9M032_GAIN_ANALOG_MASK 0x3f + #define MT9M032_FORMATTER1 0x9e ++#define MT9M032_FORMATTER1_PLL_P1_6 (1 << 8) ++#define MT9M032_FORMATTER1_PARALLEL (1 << 12) + #define MT9M032_FORMATTER2 0x9f + #define MT9M032_FORMATTER2_DOUT_EN 0x1000 + #define MT9M032_FORMATTER2_PIXCLK_EN 0x2000 +@@ -121,8 +123,6 @@ + #define MT9P031_PLL_CONTROL_PWROFF 0x0050 + #define MT9P031_PLL_CONTROL_PWRON 0x0051 + #define MT9P031_PLL_CONTROL_USEPLL 0x0052 +-#define MT9P031_PLL_CONFIG2 0x11 +-#define MT9P031_PLL_CONFIG2_P1_DIV_MASK 0x1f +=20 + struct mt9m032 { + struct v4l2_subdev subdev; +@@ -255,13 +255,14 @@ static int mt9m032_setup_pll(struct mt9m032 *sensor) + .n_max =3D 64, + .m_min =3D 16, + .m_max =3D 255, +- .p1_min =3D 1, +- .p1_max =3D 128, ++ .p1_min =3D 6, ++ .p1_max =3D 7, + }; +=20 + struct i2c_client *client =3D v4l2_get_subdevdata(&sensor->subdev); + struct mt9m032_platform_data *pdata =3D sensor->pdata; + struct aptina_pll pll; ++ u16 reg_val; + int ret; +=20 + pll.ext_clock =3D pdata->ext_clock; +@@ -274,18 +275,19 @@ static int mt9m032_setup_pll(struct mt9m032 *sensor) + sensor->pix_clock =3D pdata->pix_clock; +=20 + ret =3D mt9m032_write(client, MT9M032_PLL_CONFIG1, +- (pll.m << MT9M032_PLL_CONFIG1_MUL_SHIFT) +- | (pll.p1 - 1)); +- if (!ret) +- ret =3D mt9m032_write(client, MT9P031_PLL_CONFIG2, pll.n - 1); ++ (pll.m << MT9M032_PLL_CONFIG1_MUL_SHIFT) | ++ ((pll.n - 1) & MT9M032_PLL_CONFIG1_PREDIV_MASK)); + if (!ret) + ret =3D mt9m032_write(client, MT9P031_PLL_CONTROL, + MT9P031_PLL_CONTROL_PWRON | + MT9P031_PLL_CONTROL_USEPLL); + if (!ret) /* more reserved, Continuous, Master Mode */ + ret =3D mt9m032_write(client, MT9M032_READ_MODE1, 0x8006); +- if (!ret) /* Set 14-bit mode, select 7 divider */ +- ret =3D mt9m032_write(client, MT9M032_FORMATTER1, 0x111e); ++ if (!ret) { ++ reg_val =3D (pll.p1 =3D=3D 6 ? MT9M032_FORMATTER1_PLL_P1_6 : 0) ++ | MT9M032_FORMATTER1_PARALLEL | 0x001e; /* 14-bit */ ++ ret =3D mt9m032_write(client, MT9M032_FORMATTER1, reg_val); ++ } +=20 + return ret; + } +--=20 +1.7.10.4 + diff --git a/src/patches/kernel/omap/3isp/0003-mt9m032-Define-MT9M032_READ_MO= DE1-bits.patch b/src/patches/kernel/omap/3isp/0003-mt9m032-Define-MT9M032_REA= D_MODE1-bits.patch new file mode 100644 index 0000000..c80e876 --- /dev/null +++ b/src/patches/kernel/omap/3isp/0003-mt9m032-Define-MT9M032_READ_MODE1-bit= s.patch @@ -0,0 +1,55 @@ +From 1115becbb4875d62abb10f94a9510c81f376606f Mon Sep 17 00:00:00 2001 +From: Laurent Pinchart +Date: Wed, 26 Sep 2012 10:54:17 +0200 +Subject: [PATCH 3/6] mt9m032: Define MT9M032_READ_MODE1 bits + +Replace hardcoded values with #define's. + +Signed-off-by: Laurent Pinchart +--- + drivers/media/i2c/mt9m032.c | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +diff --git a/drivers/media/i2c/mt9m032.c b/drivers/media/i2c/mt9m032.c +index 30d755a..de150d3 100644 +--- a/drivers/media/i2c/mt9m032.c ++++ b/drivers/media/i2c/mt9m032.c +@@ -90,6 +90,24 @@ + #define MT9M032_PLL_CONFIG1_PREDIV_MASK 0x3f + #define MT9M032_PLL_CONFIG1_MUL_SHIFT 8 + #define MT9M032_READ_MODE1 0x1e ++#define MT9M032_READ_MODE1_OUTPUT_BAD_FRAMES (1 << 13) ++#define MT9M032_READ_MODE1_MAINTAIN_FRAME_RATE (1 << 12) ++#define MT9M032_READ_MODE1_XOR_LINE_VALID (1 << 11) ++#define MT9M032_READ_MODE1_CONT_LINE_VALID (1 << 10) ++#define MT9M032_READ_MODE1_INVERT_TRIGGER (1 << 9) ++#define MT9M032_READ_MODE1_SNAPSHOT (1 << 8) ++#define MT9M032_READ_MODE1_GLOBAL_RESET (1 << 7) ++#define MT9M032_READ_MODE1_BULB_EXPOSURE (1 << 6) ++#define MT9M032_READ_MODE1_INVERT_STROBE (1 << 5) ++#define MT9M032_READ_MODE1_STROBE_ENABLE (1 << 4) ++#define MT9M032_READ_MODE1_STROBE_START_TRIG1 (0 << 2) ++#define MT9M032_READ_MODE1_STROBE_START_EXP (1 << 2) ++#define MT9M032_READ_MODE1_STROBE_START_SHUTTER (2 << 2) ++#define MT9M032_READ_MODE1_STROBE_START_TRIG2 (3 << 2) ++#define MT9M032_READ_MODE1_STROBE_END_TRIG1 (0 << 0) ++#define MT9M032_READ_MODE1_STROBE_END_EXP (1 << 0) ++#define MT9M032_READ_MODE1_STROBE_END_SHUTTER (2 << 0) ++#define MT9M032_READ_MODE1_STROBE_END_TRIG2 (3 << 0) + #define MT9M032_READ_MODE2 0x20 + #define MT9M032_READ_MODE2_VFLIP_SHIFT 15 + #define MT9M032_READ_MODE2_HFLIP_SHIFT 14 +@@ -282,7 +300,9 @@ static int mt9m032_setup_pll(struct mt9m032 *sensor) + MT9P031_PLL_CONTROL_PWRON | + MT9P031_PLL_CONTROL_USEPLL); + if (!ret) /* more reserved, Continuous, Master Mode */ +- ret =3D mt9m032_write(client, MT9M032_READ_MODE1, 0x8006); ++ ret =3D mt9m032_write(client, MT9M032_READ_MODE1, 0x8000 | ++ MT9M032_READ_MODE1_STROBE_START_EXP | ++ MT9M032_READ_MODE1_STROBE_END_SHUTTER); + if (!ret) { + reg_val =3D (pll.p1 =3D=3D 6 ? MT9M032_FORMATTER1_PLL_P1_6 : 0) + | MT9M032_FORMATTER1_PARALLEL | 0x001e; /* 14-bit */ +--=20 +1.7.10.4 + diff --git a/src/patches/kernel/omap/3isp/0004-mt9p031-Use-devm_-managed-help= ers.patch b/src/patches/kernel/omap/3isp/0004-mt9p031-Use-devm_-managed-helpe= rs.patch new file mode 100644 index 0000000..bcc4360 --- /dev/null +++ b/src/patches/kernel/omap/3isp/0004-mt9p031-Use-devm_-managed-helpers.pat= ch @@ -0,0 +1,62 @@ +From d3f188f38eaa34acf6375d5d88fe27971aae1170 Mon Sep 17 00:00:00 2001 +From: Laurent Pinchart +Date: Fri, 21 Dec 2012 20:34:06 +0100 +Subject: [PATCH 4/6] mt9p031: Use devm_* managed helpers + +Replace kzalloc and gpio_request_one by their managed equivalents. + +Signed-off-by: Laurent Pinchart +--- + drivers/media/i2c/mt9p031.c | 13 +++---------- + 1 file changed, 3 insertions(+), 10 deletions(-) + +diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c +index e328332..e0bad59 100644 +--- a/drivers/media/i2c/mt9p031.c ++++ b/drivers/media/i2c/mt9p031.c +@@ -927,7 +927,7 @@ static int mt9p031_probe(struct i2c_client *client, + return -EIO; + } +=20 +- mt9p031 =3D kzalloc(sizeof(*mt9p031), GFP_KERNEL); ++ mt9p031 =3D devm_kzalloc(&client->dev, sizeof(*mt9p031), GFP_KERNEL); + if (mt9p031 =3D=3D NULL) + return -ENOMEM; +=20 +@@ -1001,8 +1001,8 @@ static int mt9p031_probe(struct i2c_client *client, + mt9p031->format.colorspace =3D V4L2_COLORSPACE_SRGB; +=20 + if (pdata->reset !=3D -1) { +- ret =3D gpio_request_one(pdata->reset, GPIOF_OUT_INIT_LOW, +- "mt9p031_rst"); ++ ret =3D devm_gpio_request_one(&client->dev, pdata->reset, ++ GPIOF_OUT_INIT_LOW, "mt9p031_rst"); + if (ret < 0) + goto done; +=20 +@@ -1013,12 +1013,8 @@ static int mt9p031_probe(struct i2c_client *client, +=20 + done: + if (ret < 0) { +- if (mt9p031->reset !=3D -1) +- gpio_free(mt9p031->reset); +- + v4l2_ctrl_handler_free(&mt9p031->ctrls); + media_entity_cleanup(&mt9p031->subdev.entity); +- kfree(mt9p031); + } +=20 + return ret; +@@ -1032,9 +1028,6 @@ static int mt9p031_remove(struct i2c_client *client) + v4l2_ctrl_handler_free(&mt9p031->ctrls); + v4l2_device_unregister_subdev(subdev); + media_entity_cleanup(&subdev->entity); +- if (mt9p031->reset !=3D -1) +- gpio_free(mt9p031->reset); +- kfree(mt9p031); +=20 + return 0; + } +--=20 +1.7.10.4 + diff --git a/src/patches/kernel/omap/3isp/0005-mt9p031-Add-support-for-regula= tors.patch b/src/patches/kernel/omap/3isp/0005-mt9p031-Add-support-for-regula= tors.patch new file mode 100644 index 0000000..57c80fd --- /dev/null +++ b/src/patches/kernel/omap/3isp/0005-mt9p031-Add-support-for-regulators.pa= tch @@ -0,0 +1,82 @@ +From 9ff2bc0c9458f0eecde6d9b52a899fd2bb1dd3a3 Mon Sep 17 00:00:00 2001 +From: Laurent Pinchart +Date: Tue, 8 May 2012 15:10:36 +0200 +Subject: [PATCH 5/6] mt9p031: Add support for regulators + +Enable the regulators when powering the sensor up, and disable them when +powering it down. + +The regulators are mandatory. Boards that don't allow controlling the +sensor power lines must provide fixed voltage regulators. + +Signed-off-by: Laurent Pinchart +--- + drivers/media/i2c/mt9p031.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c +index e0bad59..ecf4492 100644 +--- a/drivers/media/i2c/mt9p031.c ++++ b/drivers/media/i2c/mt9p031.c +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include + #include +=20 +@@ -121,6 +122,10 @@ struct mt9p031 { + struct mutex power_lock; /* lock to protect power_count */ + int power_count; +=20 ++ struct regulator *vaa; ++ struct regulator *vdd; ++ struct regulator *vdd_io; ++ + enum mt9p031_model model; + struct aptina_pll pll; + int reset; +@@ -264,6 +269,11 @@ static int mt9p031_power_on(struct mt9p031 *mt9p031) + usleep_range(1000, 2000); + } +=20 ++ /* Bring up the supplies */ ++ regulator_enable(mt9p031->vdd); ++ regulator_enable(mt9p031->vdd_io); ++ regulator_enable(mt9p031->vaa); ++ + /* Emable clock */ + if (mt9p031->pdata->set_xclk) + mt9p031->pdata->set_xclk(&mt9p031->subdev, +@@ -285,6 +295,10 @@ static void mt9p031_power_off(struct mt9p031 *mt9p031) + usleep_range(1000, 2000); + } +=20 ++ regulator_disable(mt9p031->vaa); ++ regulator_disable(mt9p031->vdd_io); ++ regulator_disable(mt9p031->vdd); ++ + if (mt9p031->pdata->set_xclk) + mt9p031->pdata->set_xclk(&mt9p031->subdev, 0); + } +@@ -937,6 +951,16 @@ static int mt9p031_probe(struct i2c_client *client, + mt9p031->model =3D did->driver_data; + mt9p031->reset =3D -1; +=20 ++ mt9p031->vaa =3D devm_regulator_get(&client->dev, "vaa"); ++ mt9p031->vdd =3D devm_regulator_get(&client->dev, "vdd"); ++ mt9p031->vdd_io =3D devm_regulator_get(&client->dev, "vdd_io"); ++ ++ if (IS_ERR(mt9p031->vaa) || IS_ERR(mt9p031->vdd) || ++ IS_ERR(mt9p031->vdd_io)) { ++ dev_err(&client->dev, "Unable to get regulators\n"); ++ return -ENODEV; ++ } ++ + v4l2_ctrl_handler_init(&mt9p031->ctrls, ARRAY_SIZE(mt9p031_ctrls) + 6); +=20 + v4l2_ctrl_new_std(&mt9p031->ctrls, &mt9p031_ctrl_ops, +--=20 +1.7.10.4 + diff --git a/src/patches/kernel/omap/3isp/0006-mt9p031-Use-the-common-clock-f= ramework.patch b/src/patches/kernel/omap/3isp/0006-mt9p031-Use-the-common-clo= ck-framework.patch new file mode 100644 index 0000000..fc8d583 --- /dev/null +++ b/src/patches/kernel/omap/3isp/0006-mt9p031-Use-the-common-clock-framewor= k.patch @@ -0,0 +1,110 @@ +From 6cd62f5ae305142c0490e80caa04f99f00029b68 Mon Sep 17 00:00:00 2001 +From: Laurent Pinchart +Date: Fri, 21 Dec 2012 20:11:55 +0100 +Subject: [PATCH 6/6] mt9p031: Use the common clock framework + +Configure the device external clock using the common clock framework +instead of a board code callback function. + +Signed-off-by: Laurent Pinchart +Acked-by: Sakari Ailus +--- + drivers/media/i2c/mt9p031.c | 21 ++++++++++++++------- + include/media/mt9p031.h | 2 -- + 2 files changed, 14 insertions(+), 9 deletions(-) + +diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c +index ecf4492..28cf95b 100644 +--- a/drivers/media/i2c/mt9p031.c ++++ b/drivers/media/i2c/mt9p031.c +@@ -12,6 +12,7 @@ + * published by the Free Software Foundation. + */ +=20 ++#include + #include + #include + #include +@@ -122,6 +123,7 @@ struct mt9p031 { + struct mutex power_lock; /* lock to protect power_count */ + int power_count; +=20 ++ struct clk *clk; + struct regulator *vaa; + struct regulator *vdd; + struct regulator *vdd_io; +@@ -200,7 +202,7 @@ static int mt9p031_reset(struct mt9p031 *mt9p031) + 0); + } +=20 +-static int mt9p031_pll_setup(struct mt9p031 *mt9p031) ++static int mt9p031_clk_setup(struct mt9p031 *mt9p031) + { + static const struct aptina_pll_limits limits =3D { + .ext_clock_min =3D 6000000, +@@ -221,6 +223,12 @@ static int mt9p031_pll_setup(struct mt9p031 *mt9p031) + struct i2c_client *client =3D v4l2_get_subdevdata(&mt9p031->subdev); + struct mt9p031_platform_data *pdata =3D mt9p031->pdata; +=20 ++ mt9p031->clk =3D devm_clk_get(&client->dev, NULL); ++ if (IS_ERR(mt9p031->clk)) ++ return PTR_ERR(mt9p031->clk); ++ ++ clk_set_rate(mt9p031->clk, pdata->ext_freq); ++ + mt9p031->pll.ext_clock =3D pdata->ext_freq; + mt9p031->pll.pix_clock =3D pdata->target_freq; +=20 +@@ -275,9 +283,8 @@ static int mt9p031_power_on(struct mt9p031 *mt9p031) + regulator_enable(mt9p031->vaa); +=20 + /* Emable clock */ +- if (mt9p031->pdata->set_xclk) +- mt9p031->pdata->set_xclk(&mt9p031->subdev, +- mt9p031->pdata->ext_freq); ++ if (mt9p031->clk) ++ clk_prepare_enable(mt9p031->clk); +=20 + /* Now RESET_BAR must be high */ + if (mt9p031->reset !=3D -1) { +@@ -299,8 +306,8 @@ static void mt9p031_power_off(struct mt9p031 *mt9p031) + regulator_disable(mt9p031->vdd_io); + regulator_disable(mt9p031->vdd); +=20 +- if (mt9p031->pdata->set_xclk) +- mt9p031->pdata->set_xclk(&mt9p031->subdev, 0); ++ if (mt9p031->clk) ++ clk_disable_unprepare(mt9p031->clk); + } +=20 + static int __mt9p031_set_power(struct mt9p031 *mt9p031, bool on) +@@ -1033,7 +1040,7 @@ static int mt9p031_probe(struct i2c_client *client, + mt9p031->reset =3D pdata->reset; + } +=20 +- ret =3D mt9p031_pll_setup(mt9p031); ++ ret =3D mt9p031_clk_setup(mt9p031); +=20 + done: + if (ret < 0) { +diff --git a/include/media/mt9p031.h b/include/media/mt9p031.h +index 0c97b19..b1e63f2 100644 +--- a/include/media/mt9p031.h ++++ b/include/media/mt9p031.h +@@ -5,13 +5,11 @@ struct v4l2_subdev; +=20 + /* + * struct mt9p031_platform_data - MT9P031 platform data +- * @set_xclk: Clock frequency set callback + * @reset: Chip reset GPIO (set to -1 if not used) + * @ext_freq: Input clock frequency + * @target_freq: Pixel clock frequency + */ + struct mt9p031_platform_data { +- int (*set_xclk)(struct v4l2_subdev *subdev, int hz); + int reset; + int ext_freq; + int target_freq; +--=20 +1.7.10.4 + diff --git a/src/patches/kernel/omap/beagle/0001-meego-modedb-add-Toshiba-LTA= 070B220F-800x480-support.patch b/src/patches/kernel/omap/beagle/0001-meego-mo= dedb-add-Toshiba-LTA070B220F-800x480-support.patch new file mode 100644 index 0000000..34d6034 --- /dev/null +++ b/src/patches/kernel/omap/beagle/0001-meego-modedb-add-Toshiba-LTA070B220= F-800x480-support.patch @@ -0,0 +1,30 @@ +From 6ac98647956cbff190954b4cac6bd71fdbb8647b Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Wed, 23 Mar 2011 08:37:54 -0500 +Subject: [PATCH 1/5] meego: modedb add Toshiba LTA070B220F 800x480 support + + from http://wiki.meego.com/ARM/Meego_on_Beagleboard_from_scratch + +Signed-off-by: Robert Nelson +--- + drivers/video/modedb.c | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c +index 5b686de..69ad1ec 100644 +--- a/drivers/video/modedb.c ++++ b/drivers/video/modedb.c +@@ -293,6 +293,10 @@ static const struct fb_videomode modedb[] =3D { + /* 864x480 @ 60 Hz, 35.15 kHz hsync */ + { NULL, 60, 864, 480, 27777, 1, 1, 1, 1, 0, 0, + 0, FB_VMODE_NONINTERLACED }, ++ ++ /* 800x480 @ 60 Hz, Toshiba LTA070B220F 7 inch LCD */ ++ { NULL, 60, 800, 480, 32787, 48, 80, 33, 31, 32, 2, ++ FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED }, + }; +=20 + #ifdef CONFIG_FB_MODE_HELPERS +--=20 +1.7.7.6 + diff --git a/src/patches/kernel/omap/beagle/0002-backlight-Add-TLC59108-backl= ight-control-driver.patch b/src/patches/kernel/omap/beagle/0002-backlight-Add= -TLC59108-backlight-control-driver.patch new file mode 100644 index 0000000..ce4df82 --- /dev/null +++ b/src/patches/kernel/omap/beagle/0002-backlight-Add-TLC59108-backlight-co= ntrol-driver.patch @@ -0,0 +1,217 @@ +From e989473bea15beef8d480b822a619e7b8fca860c Mon Sep 17 00:00:00 2001 +From: "Manjunathappa, Prakash" +Date: Mon, 1 Aug 2011 18:25:11 +0530 +Subject: [PATCH 2/5] backlight: Add TLC59108 backlight control driver + +This patch adds support for I2C configurable TLC59108 backlight +control driver. + +Signed-off-by: Manjunathappa, Prakash +Signed-off-by: Vaibhav Hiremath +--- + drivers/video/backlight/Kconfig | 8 ++ + drivers/video/backlight/Makefile | 1 + + drivers/video/backlight/tlc59108.c | 160 +++++++++++++++++++++++++++++++++= +++ + 3 files changed, 169 insertions(+) + create mode 100644 drivers/video/backlight/tlc59108.c + +diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconf= ig +index db10d01..04a2275 100644 +--- a/drivers/video/backlight/Kconfig ++++ b/drivers/video/backlight/Kconfig +@@ -418,6 +418,14 @@ config BACKLIGHT_AS3711 + If you have an Austrian Microsystems AS3711 say Y to enable the + backlight driver. +=20 ++config BACKLIGHT_TLC59108 ++ tristate "TLC59108 LCD Backlight Driver" ++ depends on I2C && BACKLIGHT_CLASS_DEVICE ++ default n ++ help ++ If you have an LCD Panel with backlight control via TLC59108, ++ say Y to enable its LCD control driver. ++ + endif # BACKLIGHT_CLASS_DEVICE +=20 + endif # BACKLIGHT_LCD_SUPPORT +diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Make= file +index 96c4d62..3687852 100644 +--- a/drivers/video/backlight/Makefile ++++ b/drivers/video/backlight/Makefile +@@ -41,6 +41,7 @@ obj-$(CONFIG_BACKLIGHT_LP855X) +=3D lp855x_bl.o + obj-$(CONFIG_BACKLIGHT_LP8788) +=3D lp8788_bl.o + obj-$(CONFIG_BACKLIGHT_MAX8925) +=3D max8925_bl.o + obj-$(CONFIG_BACKLIGHT_OMAP1) +=3D omap1_bl.o ++obj-$(CONFIG_BACKLIGHT_TLC59108) +=3D tlc59108.o + obj-$(CONFIG_BACKLIGHT_OT200) +=3D ot200_bl.o + obj-$(CONFIG_BACKLIGHT_PANDORA) +=3D pandora_bl.o + obj-$(CONFIG_BACKLIGHT_PCF50633) +=3D pcf50633-backlight.o +diff --git a/drivers/video/backlight/tlc59108.c b/drivers/video/backlight/tl= c59108.c +new file mode 100644 +index 0000000..4f4ea34 +--- /dev/null ++++ b/drivers/video/backlight/tlc59108.c +@@ -0,0 +1,160 @@ ++/* ++ * ti81xxhdmi_tlc59108.c ++ * ++ * Copyright (C) 2011 Texas Instruments ++ * Author: Senthil Natarajan ++ * ++ * tlc59108 HDMI Driver ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, but WITH= OUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for ++ * more details. ++ * ++ * You should have received a copy of the GNU General Public License along = with ++ * this program. If not, see . ++ * History: ++ * ++ * Senthil Natarajan July 2011 I2C driver for tlc59108 ++ * backlight control ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#define tlc59108_MODULE_NAME "tlc59108" ++#define TLC59108_MODE1 0x00 ++#define TLC59108_PWM2 0x04 ++#define TLC59108_LEDOUT0 0x0c ++#define TLC59108_LEDOUT1 0x0d ++#define TLC59108_MAX_BRIGHTNESS 0xFF ++ ++struct tlc59108_bl { ++ struct i2c_client *client; ++ struct backlight_device *bl; ++}; ++ ++static void tlc59108_bl_set_backlight(struct tlc59108_bl *data, int brightn= ess) ++{ ++ /* Set Mode1 Register */ ++ i2c_smbus_write_byte_data(data->client, TLC59108_MODE1, 0x00); ++ ++ /* Set LEDOUT0 Register */ ++ i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT0, 0x21); ++ ++ /* Set Backlight Duty Cycle*/ ++ i2c_smbus_write_byte_data(data->client, TLC59108_PWM2, ++ brightness & 0xff); ++} ++ ++static int tlc59108_bl_get_brightness(struct backlight_device *dev) ++{ ++ struct backlight_properties *props =3D &dev->props; ++ ++ return props->brightness; ++} ++ ++static int tlc59108_bl_update_status(struct backlight_device *dev) ++{ ++ struct backlight_properties *props =3D &dev->props; ++ struct tlc59108_bl *data =3D dev_get_drvdata(&dev->dev); ++ int brightness =3D props->brightness; ++ ++ tlc59108_bl_set_backlight(data, brightness); ++ ++ return 0; ++} ++ ++static const struct backlight_ops bl_ops =3D { ++ .get_brightness =3D tlc59108_bl_get_brightness, ++ .update_status =3D tlc59108_bl_update_status, ++}; ++ ++static int tlc59108_probe(struct i2c_client *c, const struct i2c_device_id = *id) ++{ ++ struct backlight_properties props; ++ struct tlc59108_bl *data =3D kzalloc(sizeof(struct tlc59108_bl), ++ GFP_KERNEL); ++ int ret =3D 0; ++ ++ if (!data) ++ return -ENOMEM; ++ ++ i2c_set_clientdata(c, data); ++ data->client =3D c; ++ ++ memset(&props, 0, sizeof(struct backlight_properties)); ++ props.max_brightness =3D TLC59108_MAX_BRIGHTNESS; ++ props.type =3D BACKLIGHT_RAW; ++ data->bl =3D backlight_device_register("tlc59108-bl", &c->dev, data, ++ &bl_ops, &props); ++ if (IS_ERR(data->bl)) { ++ ret =3D PTR_ERR(data->bl); ++ goto err_reg; ++ } ++ ++ data->bl->props.brightness =3D TLC59108_MAX_BRIGHTNESS; ++ ++ backlight_update_status(data->bl); ++ ++ return 0; ++ ++err_reg: ++ data->bl =3D NULL; ++ kfree(data); ++ return ret; ++} ++ ++static int tlc59108_remove(struct i2c_client *c) ++{ ++ struct tlc59108_bl *data =3D i2c_get_clientdata(c); ++ ++ backlight_device_unregister(data->bl); ++ data->bl =3D NULL; ++ ++ kfree(data); ++ ++ return 0; ++} ++ ++/* I2C Device ID table */ ++static const struct i2c_device_id tlc59108_id[] =3D { ++ { "tlc59108", 0 }, ++ { } ++}; ++MODULE_DEVICE_TABLE(i2c, tlc59108_id); ++ ++/* I2C driver data */ ++static struct i2c_driver tlc59108_driver =3D { ++ .driver =3D { ++ .owner =3D THIS_MODULE, ++ .name =3D tlc59108_MODULE_NAME, ++ }, ++ .probe =3D tlc59108_probe, ++ .remove =3D tlc59108_remove, ++ .id_table =3D tlc59108_id, ++}; ++ ++static int __init tlc59108_init(void) ++{ ++ return i2c_add_driver(&tlc59108_driver); ++} ++ ++static void __exit tlc59108_exit(void) ++{ ++ i2c_del_driver(&tlc59108_driver); ++} ++ ++module_init(tlc59108_init); ++module_exit(tlc59108_exit); ++ ++MODULE_DESCRIPTION("LCD/Backlight control for TLC59108"); ++MODULE_AUTHOR("Senthil Natarajan "); ++MODULE_LICENSE("GPL v2"); +--=20 +1.7.10.4 + diff --git a/src/patches/kernel/omap/beagle/0003-tlc59108-adjust-for-beaglebo= ard-uLCD7.patch b/src/patches/kernel/omap/beagle/0003-tlc59108-adjust-for-bea= gleboard-uLCD7.patch new file mode 100644 index 0000000..5c9659b --- /dev/null +++ b/src/patches/kernel/omap/beagle/0003-tlc59108-adjust-for-beagleboard-uLC= D7.patch @@ -0,0 +1,124 @@ +From 40cbddde06a9f0e1845810b904502f922fc3288f Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Fri, 27 Apr 2012 21:30:00 +0200 +Subject: [PATCH 3/5] tlc59108: adjust for beagleboard+uLCD7 + +Signed-off-by: Koen Kooi +--- + drivers/video/backlight/tlc59108.c | 46 ++++++++++++++++++++++++---------= -- + 1 files changed, 31 insertions(+), 15 deletions(-) + +diff --git a/drivers/video/backlight/tlc59108.c b/drivers/video/backlight/tl= c59108.c +index 4f4ea34..40a21e7 100644 +--- a/drivers/video/backlight/tlc59108.c ++++ b/drivers/video/backlight/tlc59108.c +@@ -29,9 +29,16 @@ + #include + #include +=20 +-#define tlc59108_MODULE_NAME "tlc59108" + #define TLC59108_MODE1 0x00 +-#define TLC59108_PWM2 0x04 ++#define TLC59108_MODE2 0x01 ++#define TLC59108_PWM0 0x02 ++#define TLC59108_PWM1 0x03 ++#define TLC59108_PWM2 0x04 ++#define TLC59108_PWM3 0x05 ++#define TLC59108_PWM4 0x06 ++#define TLC59108_PWM5 0x07 ++#define TLC59108_PWM6 0x08 ++#define TLC59108_PWM7 0x09 + #define TLC59108_LEDOUT0 0x0c + #define TLC59108_LEDOUT1 0x0d + #define TLC59108_MAX_BRIGHTNESS 0xFF +@@ -43,15 +50,9 @@ struct tlc59108_bl { +=20 + static void tlc59108_bl_set_backlight(struct tlc59108_bl *data, int brightn= ess) + { +- /* Set Mode1 Register */ +- i2c_smbus_write_byte_data(data->client, TLC59108_MODE1, 0x00); +- +- /* Set LEDOUT0 Register */ +- i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT0, 0x21); +- + /* Set Backlight Duty Cycle*/ + i2c_smbus_write_byte_data(data->client, TLC59108_PWM2, +- brightness & 0xff); ++ 0xff - brightness ); + } +=20 + static int tlc59108_bl_get_brightness(struct backlight_device *dev) +@@ -65,8 +66,18 @@ static int tlc59108_bl_update_status(struct backlight_dev= ice *dev) + { + struct backlight_properties *props =3D &dev->props; + struct tlc59108_bl *data =3D dev_get_drvdata(&dev->dev); ++ + int brightness =3D props->brightness; +=20 ++ if (dev->props.state & BL_CORE_FBBLANK) { ++ brightness =3D 0; ++ /* Set LEDOUT0 Register */ ++ i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT0, 0x10); ++ } else { ++ /* Set LEDOUT0 Register */ ++ i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT0, 0x30); ++ } ++ + tlc59108_bl_set_backlight(data, brightness); +=20 + return 0; +@@ -77,7 +88,7 @@ static const struct backlight_ops bl_ops =3D { + .update_status =3D tlc59108_bl_update_status, + }; +=20 +-static int tlc59108_probe(struct i2c_client *c, const struct i2c_device_id = *id) ++static int __devinit tlc59108_probe(struct i2c_client *c, const struct i2c_= device_id *id) + { + struct backlight_properties props; + struct tlc59108_bl *data =3D kzalloc(sizeof(struct tlc59108_bl), +@@ -104,6 +115,11 @@ static int tlc59108_probe(struct i2c_client *c, const s= truct i2c_device_id *id) +=20 + backlight_update_status(data->bl); +=20 ++ i2c_smbus_write_byte_data(data->client, TLC59108_MODE1, 0x00); ++ i2c_smbus_write_byte_data(data->client, TLC59108_PWM2, 0x80); ++ i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT1, 0x05); ++ i2c_smbus_write_byte_data(data->client, TLC59108_LEDOUT1, 0x15); ++ + return 0; +=20 + err_reg: +@@ -125,7 +141,7 @@ static int tlc59108_remove(struct i2c_client *c) + } +=20 + /* I2C Device ID table */ +-static const struct i2c_device_id tlc59108_id[] =3D { ++static struct i2c_device_id tlc59108_id[] =3D { + { "tlc59108", 0 }, + { } + }; +@@ -134,12 +150,12 @@ MODULE_DEVICE_TABLE(i2c, tlc59108_id); + /* I2C driver data */ + static struct i2c_driver tlc59108_driver =3D { + .driver =3D { +- .owner =3D THIS_MODULE, +- .name =3D tlc59108_MODULE_NAME, ++ .owner =3D THIS_MODULE, ++ .name =3D "tlc59108" + }, ++ .id_table =3D tlc59108_id, + .probe =3D tlc59108_probe, + .remove =3D tlc59108_remove, +- .id_table =3D tlc59108_id, + }; +=20 + static int __init tlc59108_init(void) +@@ -157,4 +173,4 @@ module_exit(tlc59108_exit); +=20 + MODULE_DESCRIPTION("LCD/Backlight control for TLC59108"); + MODULE_AUTHOR("Senthil Natarajan "); +-MODULE_LICENSE("GPL v2"); ++MODULE_LICENSE("GPL"); +--=20 +1.7.7.6 + diff --git a/src/patches/kernel/omap/beagle/0004-zeroMAP-Open-your-eyes.patch= b/src/patches/kernel/omap/beagle/0004-zeroMAP-Open-your-eyes.patch new file mode 100644 index 0000000..d179420 --- /dev/null +++ b/src/patches/kernel/omap/beagle/0004-zeroMAP-Open-your-eyes.patch @@ -0,0 +1,31 @@ +From 81ff7627ad0d958a5c156cb7d880af8707e14f47 Mon Sep 17 00:00:00 2001 +From: Alexander Holler +Date: Wed, 4 Jul 2012 00:03:04 +0200 +Subject: [PATCH 4/5] zeroMAP: Open your eyes! + +Signed-off-by: Alexander Holler +--- + kernel/printk.c | 7 +++++++ + 1 files changed, 7 insertions(+), 0 deletions(-) + +diff --git a/kernel/printk.c b/kernel/printk.c +index 22e070f..3678740 100644 +--- a/kernel/printk.c ++++ b/kernel/printk.c +@@ -1759,6 +1759,13 @@ static int __init console_setup(char *str) + char *s, *options, *brl_options =3D NULL; + int idx; +=20 ++#ifdef CONFIG_SERIAL_OMAP ++ if (!strncmp(str, "tty0", 4) && '0' <=3D str[4] && '9' >=3D str[4]) { ++ str[3] =3D 'O'; ++ pr_warn("We are opening your eyes, assuming you want to use an OMAP based= serial driver and not a zeroMAP based one! ;)\n"); ++ pr_warn("Which means 'tty0%s' was changed to 'ttyO%s' automagically for y= our pleasure.\n", str+4, str+4); ++ } ++#endif + #ifdef CONFIG_A11Y_BRAILLE_CONSOLE + if (!memcmp(str, "brl,", 4)) { + brl_options =3D ""; +--=20 +1.7.7.6 + diff --git a/src/patches/kernel/omap/beagle/0005-ARM-OMAP-Beagle-use-TWL4030-= generic-reset-script.patch b/src/patches/kernel/omap/beagle/0005-ARM-OMAP-Bea= gle-use-TWL4030-generic-reset-script.patch new file mode 100644 index 0000000..ffb5ffb --- /dev/null +++ b/src/patches/kernel/omap/beagle/0005-ARM-OMAP-Beagle-use-TWL4030-generic= -reset-script.patch @@ -0,0 +1,29 @@ +From f2ec859cb99e6137d78b457f8a6693e69e3b1f33 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Thu, 24 Jan 2013 09:43:51 -0600 +Subject: [PATCH 5/5] ARM: OMAP: Beagle: use TWL4030 generic reset script + +Enable TWL_COMMON_PDATA_POWER such that OMAP3530 revisions of the +Beagle (Bx/Cx) will not hang on reboot when running at 125 Mhz. + +Signed-off-by: Robert Nelson +--- + arch/arm/mach-omap2/board-omap3beagle.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/b= oard-omap3beagle.c +index 5b57885..9a2c80b 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -831,7 +831,7 @@ static int __init omap3_beagle_i2c_init(void) + { + omap3_pmic_get_config(&beagle_twldata, + TWL_COMMON_PDATA_USB | TWL_COMMON_PDATA_MADC | +- TWL_COMMON_PDATA_AUDIO, ++ TWL_COMMON_PDATA_AUDIO | TWL_COMMON_PDATA_POWER, + TWL_COMMON_REGULATOR_VDAC | TWL_COMMON_REGULATOR_VPLL2); +=20 + beagle_twldata.vpll2->constraints.name =3D "VDVI"; +--=20 +1.7.10.4 + diff --git a/src/patches/kernel/omap/beagle/0006-DSS2-use-DSI-PLL-for-DPI-wit= h-OMAP3.patch b/src/patches/kernel/omap/beagle/0006-DSS2-use-DSI-PLL-for-DPI-= with-OMAP3.patch new file mode 100644 index 0000000..56879cb --- /dev/null +++ b/src/patches/kernel/omap/beagle/0006-DSS2-use-DSI-PLL-for-DPI-with-OMAP3= .patch @@ -0,0 +1,28 @@ +From 40d889a09a05765138f3b737becadfe927c9b004 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 19 Mar 2013 13:40:50 -0500 +Subject: [PATCH 6/6] DSS2: use DSI PLL for DPI with OMAP3 + +Signed-off-by: Robert Nelson +--- + drivers/video/omap2/dss/dpi.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c +index 757b57f..12ed14f 100644 +--- a/drivers/video/omap2/dss/dpi.c ++++ b/drivers/video/omap2/dss/dpi.c +@@ -58,10 +58,6 @@ static struct platform_device *dpi_get_dsidev(enum omap_c= hannel channel) + */ + switch (omapdss_get_version()) { + case OMAPDSS_VER_OMAP24xx: +- case OMAPDSS_VER_OMAP34xx_ES1: +- case OMAPDSS_VER_OMAP34xx_ES3: +- case OMAPDSS_VER_OMAP3630: +- case OMAPDSS_VER_AM35xx: + return NULL; +=20 + case OMAPDSS_VER_OMAP4430_ES1: +--=20 +1.7.10.4 + diff --git a/src/patches/kernel/omap/beagle/expansion/0001-Beagle-expansion-a= dd-buddy-param-for-expansionboard-.patch b/src/patches/kernel/omap/beagle/exp= ansion/0001-Beagle-expansion-add-buddy-param-for-expansionboard-.patch new file mode 100644 index 0000000..44a1ae3 --- /dev/null +++ b/src/patches/kernel/omap/beagle/expansion/0001-Beagle-expansion-add-budd= y-param-for-expansionboard-.patch @@ -0,0 +1,63 @@ +From c070885eaf883884f89a77e2f71def5b447f914b Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 11 Dec 2012 06:25:27 -0600 +Subject: [PATCH 01/10] Beagle: expansion: add buddy param for expansionboard + names + +Signed-off-by: Robert Nelson +--- + arch/arm/mach-omap2/board-omap3beagle.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/b= oard-omap3beagle.c +index c3558f9..29d549c 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -191,6 +192,8 @@ static void __init omap3_beagle_init_rev(void) + } + } +=20 ++char expansionboard_name[16]; ++ + static struct mtd_partition omap3beagle_nand_partitions[] =3D { + /* All the partition sizes are listed in terms of NAND block size */ + { +@@ -470,6 +473,18 @@ static struct omap_board_mux board_mux[] __initdata =3D= { + }; + #endif +=20 ++static int __init expansionboard_setup(char *str) ++{ ++ if (!machine_is_omap3_beagle()) ++ return 0; ++ ++ if (!str) ++ return -EINVAL; ++ strncpy(expansionboard_name, str, 16); ++ pr_info("Beagle expansionboard: %s\n", expansionboard_name); ++ return 0; ++} ++ + static int __init beagle_opp_init(void) + { + int r =3D 0; +@@ -559,6 +574,8 @@ static void __init omap3_beagle_init(void) + pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup)); + } +=20 ++early_param("buddy", expansionboard_setup); ++ + MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") + /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ + .atag_offset =3D 0x100, +--=20 +1.7.10.4 + diff --git a/src/patches/kernel/omap/beagle/expansion/0002-Beagle-expansion-a= dd-zippy.patch b/src/patches/kernel/omap/beagle/expansion/0002-Beagle-expansi= on-add-zippy.patch new file mode 100644 index 0000000..fff6243 --- /dev/null +++ b/src/patches/kernel/omap/beagle/expansion/0002-Beagle-expansion-add-zipp= y.patch @@ -0,0 +1,242 @@ +From e71075202707e044a28604bd929fd6f7a89adeae Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Mon, 21 Jan 2013 11:47:02 -0600 +Subject: [PATCH 02/10] Beagle: expansion: add zippy + +v2: add #include +build fix from Pantelis Antoniou + +Signed-off-by: Robert Nelson +--- + arch/arm/mach-omap2/board-omap3beagle.c | 164 ++++++++++++++++++++++++++++= +-- + 1 file changed, 158 insertions(+), 6 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/b= oard-omap3beagle.c +index 4e6e767..b3685ed 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -37,6 +37,7 @@ + #include +=20 + #include ++#include + #include +=20 + #include +@@ -195,6 +196,86 @@ static void __init omap3_beagle_init_rev(void) +=20 + char expansionboard_name[16]; +=20 ++enum { ++ EXPANSION_MMC_NONE =3D 0, ++ EXPANSION_MMC_ZIPPY, ++ EXPANSION_MMC_WIFI, ++}; ++ ++enum { ++ EXPANSION_I2C_NONE =3D 0, ++ EXPANSION_I2C_ZIPPY, ++}; ++ ++static struct { ++ int mmc_settings; ++ int i2c_settings; ++} expansion_config =3D { ++ .mmc_settings =3D EXPANSION_MMC_NONE, ++ .i2c_settings =3D EXPANSION_I2C_NONE, ++}; ++ ++//rcn-ee: this is just a fake regulator, the zippy hardware provides 3.3/1.= 8 with jumper.. ++static struct fixed_voltage_config beagle_vzippy =3D { ++ .supply_name =3D "vzippy", ++ .microvolts =3D 3300000, /* 3.3V */ ++ .startup_delay =3D 70000, /* 70ms */ ++ .enable_high =3D 1, ++ .enabled_at_boot =3D 0, ++ .init_data =3D &beagle_vmmc2, ++}; ++ ++static struct platform_device omap_zippy_device =3D { ++ .name =3D "reg-fixed-voltage", ++ .id =3D 1, ++ .dev =3D { ++ .platform_data =3D &beagle_vzippy, ++ }, ++}; ++ ++#define OMAP3BEAGLE_GPIO_ZIPPY_MMC_WP 141 ++#define OMAP3BEAGLE_GPIO_ZIPPY_MMC_CD 162 ++ ++#if IS_ENABLED(CONFIG_ENC28J60) ++#include ++#include ++ ++#define OMAP3BEAGLE_GPIO_ENC28J60_IRQ 157 ++ ++static struct omap2_mcspi_device_config enc28j60_spi_chip_info =3D { ++ .turbo_mode =3D 0, ++}; ++ ++static struct spi_board_info omap3beagle_zippy_spi_board_info[] __initdata = =3D { ++ { ++ .modalias =3D "enc28j60", ++ .bus_num =3D 4, ++ .chip_select =3D 0, ++ .max_speed_hz =3D 20000000, ++ .controller_data =3D &enc28j60_spi_chip_info, ++ }, ++}; ++ ++static void __init omap3beagle_enc28j60_init(void) ++{ ++ if ((gpio_request(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, "ENC28J60_IRQ") =3D=3D 0)= && ++ (gpio_direction_input(OMAP3BEAGLE_GPIO_ENC28J60_IRQ) =3D=3D 0)) { ++ gpio_export(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, 0); ++ omap3beagle_zippy_spi_board_info[0].irq =3D gpio_to_irq(OMAP3BEAGLE_GPIO_= ENC28J60_IRQ); ++ irq_set_irq_type(omap3beagle_zippy_spi_board_info[0].irq, IRQ_TYPE_EDGE_F= ALLING); ++ } else { ++ pr_err("Beagle expansionboard: could not obtain gpio for ENC28J60_IRQ\n"); ++ return; ++ } ++ ++ spi_register_board_info(omap3beagle_zippy_spi_board_info, ++ ARRAY_SIZE(omap3beagle_zippy_spi_board_info)); ++} ++ ++#else ++static inline void __init omap3beagle_enc28j60_init(void) { return; } ++#endif ++ + static struct mtd_partition omap3beagle_nand_partitions[] =3D { + /* All the partition sizes are listed in terms of NAND block size */ + { +@@ -271,6 +352,23 @@ static struct omap2_hsmmc_info mmc[] =3D { + {} /* Terminator */ + }; +=20 ++static struct omap2_hsmmc_info mmc_zippy[] =3D { ++ { ++ .mmc =3D 1, ++ .caps =3D MMC_CAP_4_BIT_DATA, ++ .gpio_wp =3D -EINVAL, ++ .deferred =3D true, ++ }, ++ { ++ .mmc =3D 2, ++ .caps =3D MMC_CAP_4_BIT_DATA, ++ .gpio_wp =3D OMAP3BEAGLE_GPIO_ZIPPY_MMC_WP, ++ .gpio_cd =3D OMAP3BEAGLE_GPIO_ZIPPY_MMC_CD, ++ .transceiver =3D true, ++ .deferred =3D true, ++ }, ++ {} /* Terminator */ ++}; + static struct regulator_consumer_supply beagle_vmmc1_supply[] =3D { + REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), + }; +@@ -301,10 +399,21 @@ static int beagle_twl_gpio_setup(struct device *dev, + { + int r; +=20 +- mmc[0].gpio_wp =3D beagle_config.mmc1_gpio_wp; +- /* gpio + 0 is "mmc0_cd" (input/IRQ) */ +- mmc[0].gpio_cd =3D gpio + 0; +- omap_hsmmc_late_init(mmc); ++ switch (expansion_config.mmc_settings) { ++ case EXPANSION_MMC_ZIPPY: ++ mmc_zippy[0].gpio_wp =3D beagle_config.mmc1_gpio_wp; ++ /* gpio + 0 is "mmc0_cd" (input/IRQ) */ ++ mmc_zippy[0].gpio_cd =3D gpio + 0; ++ ++ omap_hsmmc_late_init(mmc_zippy); ++ break; ++ default: ++ mmc[0].gpio_wp =3D beagle_config.mmc1_gpio_wp; ++ /* gpio + 0 is "mmc0_cd" (input/IRQ) */ ++ mmc[0].gpio_cd =3D gpio + 0; ++ ++ omap_hsmmc_late_init(mmc); ++ } +=20 + /* + * TWL4030_GPIO_MAX + 0 =3D=3D ledA, EHCI nEN_USB_PWR (out, XM active +@@ -396,6 +505,14 @@ static struct i2c_board_info __initdata beagle_i2c_eepr= om[] =3D { + }, + }; +=20 ++static struct i2c_board_info __initdata zippy_i2c2_rtc[] =3D { ++#if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE) ++ { ++ I2C_BOARD_INFO("ds1307", 0x68), ++ }, ++#endif ++}; ++ + static int __init omap3_beagle_i2c_init(void) + { + omap3_pmic_get_config(&beagle_twldata, +@@ -406,6 +523,15 @@ static int __init omap3_beagle_i2c_init(void) + beagle_twldata.vpll2->constraints.name =3D "VDVI"; +=20 + omap3_pmic_init("twl4030", &beagle_twldata); ++ ++ switch (expansion_config.i2c_settings) { ++ case EXPANSION_I2C_ZIPPY: ++ omap_register_i2c_bus(2, 400, zippy_i2c2_rtc, ARRAY_SIZE(zippy_i2c2_rtc)); ++ break; ++ default: ++ omap_register_i2c_bus(2, 400, NULL, 0); ++ } ++ + /* Bus 3 is attached to the DVI port where devices like the pico DLP + * projector don't work reliably with 400kHz */ + omap_register_i2c_bus(3, 100, beagle_i2c_eeprom, ARRAY_SIZE(beagle_i2c_eep= rom)); +@@ -548,10 +674,30 @@ static void __init omap3_beagle_init(void) + omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); + omap3_beagle_init_rev(); +=20 ++ if (!strcmp(expansionboard_name, "zippy")) ++ { ++ pr_info("Beagle expansionboard: initializing zippy mmc\n"); ++ platform_device_register(&omap_zippy_device); ++ ++ expansion_config.i2c_settings =3D EXPANSION_I2C_ZIPPY; ++ expansion_config.mmc_settings =3D EXPANSION_MMC_ZIPPY; ++ ++ omap_mux_init_gpio(OMAP3BEAGLE_GPIO_ZIPPY_MMC_WP, OMAP_PIN_INPUT); ++ omap_mux_init_gpio(OMAP3BEAGLE_GPIO_ZIPPY_MMC_CD, OMAP_PIN_INPUT); ++ } ++ + if (gpio_is_valid(beagle_config.mmc1_gpio_wp)) + omap_mux_init_gpio(beagle_config.mmc1_gpio_wp, OMAP_PIN_INPUT); +- mmc[0].caps =3D beagle_config.mmc_caps; +- omap_hsmmc_init(mmc); ++ ++ switch (expansion_config.mmc_settings) { ++ case EXPANSION_MMC_ZIPPY: ++ mmc_zippy[0].caps =3D beagle_config.mmc_caps; ++ omap_hsmmc_init(mmc_zippy); ++ break; ++ default: ++ mmc[0].caps =3D beagle_config.mmc_caps; ++ omap_hsmmc_init(mmc); ++ } +=20 + omap3_beagle_i2c_init(); +=20 +@@ -566,6 +712,12 @@ static void __init omap3_beagle_init(void) + omap_sdrc_init(mt46h32m32lf6_sdrc_params, + mt46h32m32lf6_sdrc_params); +=20 ++ if (!strcmp(expansionboard_name, "zippy")) ++ { ++ pr_info("Beagle expansionboard: initializing enc28j60\n"); ++ omap3beagle_enc28j60_init(); ++ } ++ + usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); + usb_musb_init(NULL); +=20 +--=20 +1.7.10.4 + diff --git a/src/patches/kernel/omap/beagle/expansion/0003-Beagle-expansion-a= dd-zippy2.patch b/src/patches/kernel/omap/beagle/expansion/0003-Beagle-expans= ion-add-zippy2.patch new file mode 100644 index 0000000..b569f92 --- /dev/null +++ b/src/patches/kernel/omap/beagle/expansion/0003-Beagle-expansion-add-zipp= y2.patch @@ -0,0 +1,86 @@ +From 45bed17e65e1a83f753896e250f3458654dcb229 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 11 Dec 2012 06:32:15 -0600 +Subject: [PATCH 03/10] Beagle: expansion: add zippy2 + +Signed-off-by: Robert Nelson +--- + arch/arm/mach-omap2/board-omap3beagle.c | 48 ++++++++++++++++++++++++++++= ++- + 1 file changed, 47 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/b= oard-omap3beagle.c +index b3685ed..74da505 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -276,6 +276,46 @@ static void __init omap3beagle_enc28j60_init(void) + static inline void __init omap3beagle_enc28j60_init(void) { return; } + #endif +=20 ++#if IS_ENABLED(CONFIG_KS8851) ++#include ++#include ++ ++#define OMAP3BEAGLE_GPIO_KS8851_IRQ 157 ++ ++static struct omap2_mcspi_device_config ks8851_spi_chip_info =3D { ++ .turbo_mode =3D 0, ++}; ++ ++static struct spi_board_info omap3beagle_zippy2_spi_board_info[] __initdata= =3D { ++ { ++ .modalias =3D "ks8851", ++ .bus_num =3D 4, ++ .chip_select =3D 0, ++ .max_speed_hz =3D 36000000, ++ .controller_data =3D &ks8851_spi_chip_info, ++ }, ++}; ++ ++static void __init omap3beagle_ks8851_init(void) ++{ ++ if ((gpio_request(OMAP3BEAGLE_GPIO_KS8851_IRQ, "KS8851_IRQ") =3D=3D 0) && ++ (gpio_direction_input(OMAP3BEAGLE_GPIO_KS8851_IRQ) =3D=3D 0)) { ++ gpio_export(OMAP3BEAGLE_GPIO_KS8851_IRQ, 0); ++ omap3beagle_zippy2_spi_board_info[0].irq =3D gpio_to_irq(OMAP3BEAGLE_GPIO= _KS8851_IRQ); ++ irq_set_irq_type(omap3beagle_zippy2_spi_board_info[0].irq, IRQ_TYPE_EDGE_= FALLING); ++ } else { ++ pr_err("Beagle expansionboard: could not obtain gpio for KS8851_IRQ\n"); ++ return; ++ } ++ ++ spi_register_board_info(omap3beagle_zippy2_spi_board_info, ++ ARRAY_SIZE(omap3beagle_zippy2_spi_board_info)); ++} ++ ++#else ++static inline void __init omap3beagle_ks8851_init(void) { return; } ++#endif ++ + static struct mtd_partition omap3beagle_nand_partitions[] =3D { + /* All the partition sizes are listed in terms of NAND block size */ + { +@@ -674,7 +714,7 @@ static void __init omap3_beagle_init(void) + omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); + omap3_beagle_init_rev(); +=20 +- if (!strcmp(expansionboard_name, "zippy")) ++ if ((!strcmp(expansionboard_name, "zippy")) || (!strcmp(expansionboard_nam= e, "zippy2"))) + { + pr_info("Beagle expansionboard: initializing zippy mmc\n"); + platform_device_register(&omap_zippy_device); +@@ -718,6 +758,12 @@ static void __init omap3_beagle_init(void) + omap3beagle_enc28j60_init(); + } +=20 ++ if (!strcmp(expansionboard_name, "zippy2")) ++ { ++ pr_info("Beagle expansionboard: initializing ks_8851\n"); ++ omap3beagle_ks8851_init(); ++ } ++ + usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); + usb_musb_init(NULL); +=20 +--=20 +1.7.10.4 + diff --git a/src/patches/kernel/omap/beagle/expansion/0004-Beagle-expansion-a= dd-trainer.patch b/src/patches/kernel/omap/beagle/expansion/0004-Beagle-expan= sion-add-trainer.patch new file mode 100644 index 0000000..08ace67 --- /dev/null +++ b/src/patches/kernel/omap/beagle/expansion/0004-Beagle-expansion-add-trai= ner.patch @@ -0,0 +1,55 @@ +From 4d9b4e5795e322ed3efed9b8402f604e2e53cc6f Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 11 Dec 2012 06:33:24 -0600 +Subject: [PATCH 04/10] Beagle: expansion: add trainer + +Signed-off-by: Robert Nelson +--- + arch/arm/mach-omap2/board-omap3beagle.c | 31 ++++++++++++++++++++++++++++= +++ + 1 file changed, 31 insertions(+) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/b= oard-omap3beagle.c +index 74da505..b5ed547 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -764,6 +764,37 @@ static void __init omap3_beagle_init(void) + omap3beagle_ks8851_init(); + } +=20 ++ if (!strcmp(expansionboard_name, "trainer")) ++ { ++ pr_info("Beagle expansionboard: exporting GPIOs 130-141,162 to userspace\= n"); ++ gpio_request(130, "sysfs"); ++ gpio_export(130, 1); ++ gpio_request(131, "sysfs"); ++ gpio_export(131, 1); ++ gpio_request(132, "sysfs"); ++ gpio_export(132, 1); ++ gpio_request(133, "sysfs"); ++ gpio_export(133, 1); ++ gpio_request(134, "sysfs"); ++ gpio_export(134, 1); ++ gpio_request(135, "sysfs"); ++ gpio_export(135, 1); ++ gpio_request(136, "sysfs"); ++ gpio_export(136, 1); ++ gpio_request(137, "sysfs"); ++ gpio_export(137, 1); ++ gpio_request(138, "sysfs"); ++ gpio_export(138, 1); ++ gpio_request(139, "sysfs"); ++ gpio_export(139, 1); ++ gpio_request(140, "sysfs"); ++ gpio_export(140, 1); ++ gpio_request(141, "sysfs"); ++ gpio_export(141, 1); ++ gpio_request(162, "sysfs"); ++ gpio_export(162, 1); ++ } ++ + usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); + usb_musb_init(NULL); +=20 +--=20 +1.7.10.4 + diff --git a/src/patches/kernel/omap/beagle/expansion/0005-Beagle-expansion-a= dd-CircuitCo-ulcd-Support.patch b/src/patches/kernel/omap/beagle/expansion/00= 05-Beagle-expansion-add-CircuitCo-ulcd-Support.patch new file mode 100644 index 0000000..8b716ee --- /dev/null +++ b/src/patches/kernel/omap/beagle/expansion/0005-Beagle-expansion-add-Circ= uitCo-ulcd-Support.patch @@ -0,0 +1,285 @@ +From a53e7913a95faefde1ee87a7ea048c04b0850066 Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 11 Dec 2012 06:42:03 -0600 +Subject: [PATCH 05/10] Beagle: expansion: add CircuitCo ulcd Support + +This of a cleanup, squashed both ulcd commits into one: + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +expansion: add ulcd +Signed-off-by: Robert Nelson + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +beagleboard: fix uLCD7 support +Signed-off-by: Koen Kooi + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Signed-off-by: Robert Nelson +--- + arch/arm/mach-omap2/board-omap3beagle.c | 136 +++++++++++++++++++= +++ + drivers/video/omap2/displays/panel-generic-dpi.c | 27 +++++ + 2 files changed, 163 insertions(+) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/b= oard-omap3beagle.c +index 0f9b253..b2807c2 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -118,12 +118,16 @@ static struct { + int dvi_pd_gpio; + int usr_button_gpio; + int mmc_caps; ++ char *lcd_driver_name; ++ int lcd_pwren; + } beagle_config =3D { + .mmc1_gpio_wp =3D -EINVAL, + .usb_pwr_level =3D 0, + .dvi_pd_gpio =3D -EINVAL, + .usr_button_gpio =3D 4, + .mmc_caps =3D MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, ++ .lcd_driver_name =3D "", ++ .lcd_pwren =3D 156, + }; +=20 + static struct gpio omap3_beagle_rev_gpios[] __initdata =3D { +@@ -195,6 +199,7 @@ static void __init omap3_beagle_init_rev(void) + } +=20 + char expansionboard_name[16]; ++char expansionboard2_name[16]; +=20 + enum { + EXPANSION_MMC_NONE =3D 0, +@@ -205,6 +210,7 @@ enum { + enum { + EXPANSION_I2C_NONE =3D 0, + EXPANSION_I2C_ZIPPY, ++ EXPANSION_I2C_7ULCD, + }; +=20 + static struct { +@@ -369,9 +375,53 @@ static struct omap_dss_device beagle_tv_device =3D { + .phy.venc.type =3D OMAP_DSS_VENC_TYPE_SVIDEO, + }; +=20 ++static int beagle_enable_lcd(struct omap_dss_device *dssdev) ++{ ++ if (gpio_is_valid(beagle_config.lcd_pwren)) { ++ pr_info("%s: Enabling LCD\n", __FUNCTION__); ++ gpio_set_value(beagle_config.lcd_pwren, 0); ++ } else { ++ pr_info("%s: Invalid LCD enable GPIO: %d\n", ++ __FUNCTION__, beagle_config.lcd_pwren); ++ } ++ ++ return 0; ++} ++ ++static void beagle_disable_lcd(struct omap_dss_device *dssdev) ++{ ++ if (gpio_is_valid(beagle_config.lcd_pwren)) { ++ pr_info("%s: Disabling LCD\n", __FUNCTION__); ++ gpio_set_value(beagle_config.lcd_pwren, 1); ++ } else { ++ pr_info("%s: Invalid LCD enable GPIO: %d\n", ++ __FUNCTION__, beagle_config.lcd_pwren); ++ } ++ ++ return; ++} ++ ++static struct panel_generic_dpi_data lcd_panel =3D { ++ .name =3D "tfc_s9700rtwv35tr-01b", ++ .platform_enable =3D beagle_enable_lcd, ++ .platform_disable =3D beagle_disable_lcd, ++}; ++ ++static struct omap_dss_device beagle_lcd_device =3D { ++ .type =3D OMAP_DISPLAY_TYPE_DPI, ++ .name =3D "lcd", ++ .driver_name =3D "generic_dpi_panel", ++ .phy.dpi.data_lines =3D 24, ++ .platform_enable =3D beagle_enable_lcd, ++ .platform_disable =3D beagle_disable_lcd, ++ .reset_gpio =3D -EINVAL, ++ .data =3D &lcd_panel, ++}; ++ + static struct omap_dss_device *beagle_dss_devices[] =3D { + &beagle_dvi_device, + &beagle_tv_device, ++ &beagle_lcd_device, + }; +=20 + static struct omap_dss_board_info beagle_dss_data =3D { +@@ -553,6 +603,53 @@ static struct i2c_board_info __initdata zippy_i2c2_rtc[= ] =3D { + #endif + }; +=20 ++#if IS_ENABLED(CONFIG_TOUCHSCREEN_TSC2007) ++/* Touchscreen */ ++#include ++ ++#define OMAP3BEAGLE_TSC2007_GPIO 157 ++ ++static int omap3beagle_tsc2007_get_pendown_state(void) ++{ ++ return !gpio_get_value(OMAP3BEAGLE_TSC2007_GPIO); ++} ++ ++static struct tsc2007_platform_data tsc2007_info =3D { ++ .model =3D 2007, ++ .x_plate_ohms =3D 180, ++ .get_pendown_state =3D omap3beagle_tsc2007_get_pendown_state, ++}; ++ ++static struct i2c_board_info __initdata beagle_i2c2_bbtoys_ulcd[] =3D { ++ { ++ I2C_BOARD_INFO("tlc59108", 0x40), ++ }, ++ { ++ I2C_BOARD_INFO("tsc2007", 0x48), ++ .platform_data =3D &tsc2007_info, ++ }, ++}; ++ ++static void __init omap3beagle_tsc2007_init(void) ++{ ++ int r; ++ ++ omap_mux_init_gpio(OMAP3BEAGLE_TSC2007_GPIO, OMAP_PIN_INPUT_PULLUP); ++ ++ r =3D gpio_request_one(OMAP3BEAGLE_TSC2007_GPIO, GPIOF_IN, "tsc2007_pen_do= wn"); ++ if (r < 0) { ++ pr_err("Beagle expansionboard: failed to request GPIO#%d for " ++ "tsc2007 pen down IRQ\n", OMAP3BEAGLE_TSC2007_GPIO); ++ return; ++ } ++ ++ beagle_i2c2_bbtoys_ulcd[0].irq =3D gpio_to_irq(OMAP3BEAGLE_TSC2007_GPIO); ++ irq_set_irq_type(gpio_to_irq(OMAP3BEAGLE_TSC2007_GPIO), IRQ_TYPE_EDGE_FALL= ING); ++} ++#else ++static struct i2c_board_info __initdata beagle_i2c2_bbtoys_ulcd[] =3D {}; ++#endif ++ + static int __init omap3_beagle_i2c_init(void) + { + omap3_pmic_get_config(&beagle_twldata, +@@ -565,6 +662,10 @@ static int __init omap3_beagle_i2c_init(void) + omap3_pmic_init("twl4030", &beagle_twldata); +=20 + switch (expansion_config.i2c_settings) { ++ case EXPANSION_I2C_7ULCD: ++ omap_register_i2c_bus(2, 400, beagle_i2c2_bbtoys_ulcd, ++ ARRAY_SIZE(beagle_i2c2_bbtoys_ulcd)); ++ break; + case EXPANSION_I2C_ZIPPY: + omap_register_i2c_bus(2, 400, zippy_i2c2_rtc, ARRAY_SIZE(zippy_i2c2_rtc)); + break; +@@ -661,6 +762,18 @@ static int __init expansionboard_setup(char *str) + return 0; + } +=20 ++static int __init expansionboard2_setup(char *str) ++{ ++ if (!machine_is_omap3_beagle()) ++ return 0; ++ ++ if (!str) ++ return -EINVAL; ++ strncpy(expansionboard2_name, str, 16); ++ pr_info("Beagle expansionboard2: %s\n", expansionboard2_name); ++ return 0; ++} ++ + static int __init beagle_opp_init(void) + { + int r =3D 0; +@@ -726,6 +839,20 @@ static void __init omap3_beagle_init(void) + omap_mux_init_gpio(OMAP3BEAGLE_GPIO_ZIPPY_MMC_CD, OMAP_PIN_INPUT); + } +=20 ++ if (!strcmp(expansionboard2_name, "bbtoys-ulcd")) ++ { ++ int r; ++ expansion_config.i2c_settings =3D EXPANSION_I2C_7ULCD; ++ ++ /* TODO: set lcd_driver_name by command line or device tree */ ++ beagle_config.lcd_driver_name =3D "tfc_s9700rtwv35tr-01b", ++ lcd_panel.name =3D beagle_config.lcd_driver_name; ++ ++ r =3D gpio_request_one(beagle_config.lcd_pwren, GPIOF_OUT_INIT_LOW, "LCD = power"); ++ if (r < 0) ++ pr_err("Beagle expansionboard: Unable to get LCD power enable GPIO\n"); ++ } ++ + if (gpio_is_valid(beagle_config.mmc1_gpio_wp)) + omap_mux_init_gpio(beagle_config.mmc1_gpio_wp, OMAP_PIN_INPUT); +=20 +@@ -795,6 +922,14 @@ static void __init omap3_beagle_init(void) + gpio_export(162, 1); + } +=20 ++ if (!strcmp(expansionboard2_name, "bbtoys-ulcd")) ++ { ++ #if IS_ENABLED(CONFIG_TOUCHSCREEN_TSC2007) ++ pr_info("Beagle expansionboard: initializing touchscreen: tsc2007\n"); ++ omap3beagle_tsc2007_init(); ++ #endif ++ } ++ + usb_bind_phy("musb-hdrc.0.auto", 0, "twl4030_usb"); + usb_musb_init(NULL); +=20 +@@ -816,6 +951,7 @@ static void __init omap3_beagle_init(void) + } +=20 + early_param("buddy", expansionboard_setup); ++early_param("buddy2", expansionboard2_setup); +=20 + MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") + /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ +diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/vide= o/omap2/displays/panel-generic-dpi.c +index 97363f7..614031f 100644 +--- a/drivers/video/omap2/displays/panel-generic-dpi.c ++++ b/drivers/video/omap2/displays/panel-generic-dpi.c +@@ -515,6 +515,33 @@ static struct panel_config generic_dpi_panels[] =3D { + }, + .name =3D "primeview_pd104slf", + }, ++ ++ /* ThreeFiveCorp S9700RTWV35TR-01B */ ++ { ++ { ++ .x_res =3D 800, ++ .y_res =3D 480, ++ ++ .pixel_clock =3D 30000, ++ ++ .hsw =3D 49, ++ .hfp =3D 41, ++ .hbp =3D 40, ++ ++ .vsw =3D 4, ++ .vfp =3D 14, ++ .vbp =3D 29, ++ ++ .vsync_level =3D OMAPDSS_SIG_ACTIVE_LOW, ++ .hsync_level =3D OMAPDSS_SIG_ACTIVE_LOW, ++ .data_pclk_edge =3D OMAPDSS_DRIVE_SIG_RISING_EDGE, ++ .de_level =3D OMAPDSS_SIG_ACTIVE_HIGH, ++ .sync_pclk_edge =3D OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES, ++ }, ++ .power_on_delay =3D 50, ++ .power_off_delay =3D 100, ++ .name =3D "tfc_s9700rtwv35tr-01b", ++ }, + }; +=20 + struct panel_drv_data { +--=20 +1.7.10.4 + diff --git a/src/patches/kernel/omap/beagle/expansion/0006-Beagle-expansion-a= dd-wifi.patch b/src/patches/kernel/omap/beagle/expansion/0006-Beagle-expansio= n-add-wifi.patch new file mode 100644 index 0000000..88d48af --- /dev/null +++ b/src/patches/kernel/omap/beagle/expansion/0006-Beagle-expansion-add-wifi= .patch @@ -0,0 +1,180 @@ +From f78cd93d767cd75969c4661723cfce46071e5b1b Mon Sep 17 00:00:00 2001 +From: Robert Nelson +Date: Tue, 11 Dec 2012 06:48:52 -0600 +Subject: [PATCH 06/10] Beagle: expansion: add wifi + +build fixes from Pantelis Antoniou + +Signed-off-by: Robert Nelson +--- + arch/arm/mach-omap2/board-omap3beagle.c | 119 ++++++++++++++++++++++++++++= +++ + 1 file changed, 119 insertions(+) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/b= oard-omap3beagle.c +index a8de97e..2322d6c 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -221,6 +221,73 @@ static struct { + .i2c_settings =3D EXPANSION_I2C_NONE, + }; +=20 ++#if IS_ENABLED(CONFIG_WL12XX) ++#include ++#include ++#include ++ ++#define OMAP_BEAGLE_WLAN_EN_GPIO (139) ++#define OMAP_BEAGLE_BT_EN_GPIO (138) ++#define OMAP_BEAGLE_WLAN_IRQ_GPIO (137) ++#define OMAP_BEAGLE_FM_EN_BT_WU (136) ++ ++struct wl12xx_platform_data omap_beagle_wlan_data __initdata =3D { ++ .board_ref_clock =3D WL12XX_REFCLOCK_38, /* 38.4 MHz */ ++}; ++ ++static struct ti_st_plat_data wilink_platform_data =3D { ++ .nshutdown_gpio =3D OMAP_BEAGLE_BT_EN_GPIO, ++ .dev_name =3D "/dev/ttyO1", ++ .flow_cntrl =3D 1, ++ .baud_rate =3D 3000000, ++ .chip_enable =3D NULL, ++ .suspend =3D NULL, ++ .resume =3D NULL, ++}; ++ ++static struct platform_device wl12xx_device =3D { ++ .name =3D "kim", ++ .id =3D -1, ++ .dev.platform_data =3D &wilink_platform_data, ++}; ++ ++static struct platform_device btwilink_device =3D { ++ .name =3D "btwilink", ++ .id =3D -1, ++}; ++#endif ++ ++static struct regulator_consumer_supply beagle_vmmc2_supply =3D ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); ++ ++static struct regulator_init_data beagle_vmmc2 =3D { ++ .constraints =3D { ++ .valid_ops_mask =3D REGULATOR_CHANGE_STATUS, ++ }, ++ .num_consumer_supplies =3D 1, ++ .consumer_supplies =3D &beagle_vmmc2_supply, ++}; ++ ++#if IS_ENABLED(CONFIG_WL12XX) ++static struct fixed_voltage_config beagle_vwlan =3D { ++ .supply_name =3D "vwl1271", ++ .microvolts =3D 1800000, /* 1.8V */ ++ .gpio =3D OMAP_BEAGLE_WLAN_EN_GPIO, ++ .startup_delay =3D 70000, /* 70ms */ ++ .enable_high =3D 1, ++ .enabled_at_boot =3D 0, ++ .init_data =3D &beagle_vmmc2, ++}; ++ ++static struct platform_device omap_vwlan_device =3D { ++ .name =3D "reg-fixed-voltage", ++ .id =3D 1, ++ .dev =3D { ++ .platform_data =3D &beagle_vwlan, ++ }, ++}; ++#endif ++ + //rcn-ee: this is just a fake regulator, the zippy hardware provides 3.3/1.= 8 with jumper.. + static struct fixed_voltage_config beagle_vzippy =3D { + .supply_name =3D "vzippy", +@@ -459,6 +526,26 @@ static struct omap2_hsmmc_info mmc_zippy[] =3D { + }, + {} /* Terminator */ + }; ++ ++static struct omap2_hsmmc_info mmcbbt[] =3D { ++ { ++ .mmc =3D 1, ++ .caps =3D MMC_CAP_4_BIT_DATA, ++ .gpio_wp =3D -EINVAL, ++ .deferred =3D true, ++ }, ++ { ++ .name =3D "wl1271", ++ .mmc =3D 2, ++ .caps =3D MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD, ++ .gpio_wp =3D -EINVAL, ++ .gpio_cd =3D -EINVAL, ++ .ocr_mask =3D MMC_VDD_165_195, ++ .nonremovable =3D true, ++ }, ++ {} /* Terminator */ ++}; ++ + static struct regulator_consumer_supply beagle_vmmc1_supply[] =3D { + REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), + }; +@@ -490,6 +577,13 @@ static int beagle_twl_gpio_setup(struct device *dev, + int r; +=20 + switch (expansion_config.mmc_settings) { ++ case EXPANSION_MMC_WIFI: ++ mmcbbt[0].gpio_wp =3D beagle_config.mmc1_gpio_wp; ++ /* gpio + 0 is "mmc0_cd" (input/IRQ) */ ++ mmcbbt[0].gpio_cd =3D gpio + 0; ++ ++ omap_hsmmc_late_init(mmcbbt); ++ break; + case EXPANSION_MMC_ZIPPY: + mmc_zippy[0].gpio_wp =3D beagle_config.mmc1_gpio_wp; + /* gpio + 0 is "mmc0_cd" (input/IRQ) */ +@@ -839,6 +933,13 @@ static void __init omap3_beagle_init(void) + omap_mux_init_gpio(OMAP3BEAGLE_GPIO_ZIPPY_MMC_CD, OMAP_PIN_INPUT); + } +=20 ++ if (!strcmp(expansionboard_name, "bbtoys-wifi")) ++ { ++ #if IS_ENABLED(CONFIG_WL12XX) ++ expansion_config.mmc_settings =3D EXPANSION_MMC_WIFI; ++ #endif ++ } ++ + if (!strcmp(expansionboard2_name, "bbtoys-ulcd")) + { + int r; +@@ -857,6 +958,10 @@ static void __init omap3_beagle_init(void) + omap_mux_init_gpio(beagle_config.mmc1_gpio_wp, OMAP_PIN_INPUT); +=20 + switch (expansion_config.mmc_settings) { ++ case EXPANSION_MMC_WIFI: ++ mmcbbt[0].caps =3D beagle_config.mmc_caps; ++ omap_hsmmc_init(mmcbbt); ++ break; + case EXPANSION_MMC_ZIPPY: + mmc_zippy[0].caps =3D beagle_config.mmc_caps; + omap_hsmmc_init(mmc_zippy); +@@ -922,6 +1027,20 @@ static void __init omap3_beagle_init(void) + gpio_export(162, 1); + } +=20 ++ if (!strcmp(expansionboard_name, "bbtoys-wifi")) ++ { ++ #if IS_ENABLED(CONFIG_WL12XX) ++ omap_beagle_wlan_data.irq =3D gpio_to_irq(OMAP_BEAGLE_WLAN_IRQ_GPIO); ++ if (wl12xx_set_platform_data(&omap_beagle_wlan_data)) ++ pr_err("error setting wl12xx data\n"); ++ pr_info("Beagle expansionboard: registering wl12xx bt platform device\n"); ++ platform_device_register(&wl12xx_device); ++ platform_device_register(&btwilink_device); ++ pr_info("Beagle expansionboard: registering wl12xx wifi platform device\n= "); ++ platform_device_register(&omap_vwlan_device); ++ #endif ++ } ++ + if (!strcmp(expansionboard2_name, "bbtoys-ulcd")) + { + #if IS_ENABLED(CONFIG_TOUCHSCREEN_TSC2007) +--=20 +1.7.10.4 + diff --git a/src/patches/kernel/omap/beagle/expansion/0007-Beagle-expansion-a= dd-beaglefpga.patch b/src/patches/kernel/omap/beagle/expansion/0007-Beagle-ex= pansion-add-beaglefpga.patch new file mode 100644 index 0000000..a006c7b --- /dev/null +++ b/src/patches/kernel/omap/beagle/expansion/0007-Beagle-expansion-add-beag= lefpga.patch @@ -0,0 +1,117 @@ +From 0c361e9db10f9ec3598bf062a605a451857ee06e Mon Sep 17 00:00:00 2001 +From: Bas van der Doorn +Date: Tue, 11 Dec 2012 06:52:22 -0600 +Subject: [PATCH 07/10] Beagle: expansion: add beaglefpga + +Added SPI dev and McBSP 3 mux when FPGA is detected + +Signed-off-by: Bas van der Doorn +Signed-off-by: Robert Nelson +--- + arch/arm/mach-omap2/board-omap3beagle.c | 76 ++++++++++++++++++++++++++++= +++ + 1 file changed, 76 insertions(+) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/b= oard-omap3beagle.c +index 2322d6c..c257f3c 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -44,6 +44,7 @@ + #include + #include + #include ++#include +=20 + #include