cleanups, compile fix, cbus
Subsystems (6)
cover cleanups, compile fix, cbus
on the following we have section mismatch fixes, compile fix to board-nokia770.c, compile fix to sossi.c, compile fix to hwa742.c, compile fix to tahvo-usb.c and a few cleanups to cbus driver.
It's compile tested only as I don't have 770s or n8x0 with the development jig available right now, so please, if you have any of those boards dusting around, test the following patches.
(looks like everything is compiling fine now)
Felipe Balbi (10):
arm: omap1: clock: fix section mismatch
arm: omap: n770: make it build again
video: omap: sossi: make it build again
video: omap: hwa742: make it build again
cbus: tahvo-usb: make it build again
cbus: switch to kzalloc
cbus: move EXPORT_SYMBOL close to its exported symbols
cbus: separate into several MODULE_AUTHOR entries
cbus: move to platform_driver
cbus: add platform_data to pass gpios
arch/arm/mach-omap1/board-nokia770.c | 18 +++++++- arch/arm/mach-omap1/clock.c | 2 +- arch/arm/mach-omap2/board-n8x0.c | 18 +++++++ arch/arm/plat-omap/include/plat/cbus.h | 31 +++++++++++++ drivers/cbus/cbus.c | 77 ++++++++++++++++++-------------- drivers/cbus/tahvo-usb.c | 12 +++--- drivers/video/omap/hwa742.c | 1 + drivers/video/omap/sossi.c | 1 + 8 files changed, 119 insertions(+), 41 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/cbus.h
PATCH 1/10 arm: omap1: clock: fix section mismatch
omap1_clk_functions was only used by omap1_clk_init() which sits in __init section, so make omap1_clock_functions be __initdata to avoid the section mismatch.
--- arch/arm/mach-omap1/clock.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap1/clock.c +1 -1
@@ -744,7 +744,7 @@ static void __init omap1_clk_disable_unused(struct clk *clk)#define omap1_clk_disable_unused NULL#endif -static struct clk_functions omap1_clk_functions = { +static struct clk_functions omap1_clk_functions__initdata = { .clk_enable = omap1_clk_enable, .clk_disable = omap1_clk_disable, .clk_round_rate = omap1_clk_round_rate,
Signature · 1 line
1.6.6.rc0
PATCH 2/10 arm: omap: n770: make it build again
In reply to Felipe Balbithere's no <plat/omapfb.h> it's now under <linux/omapfb.h>
--- arch/arm/mach-omap1/board-nokia770.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap1/board-nokia770.c +1 -1
@@ -20,6 +20,7 @@#include <linux/spi/ads7846.h> #include <linux/workqueue.h> #include <linux/delay.h> +#include <linux/omapfb.h> #include <mach/hardware.h> #include <asm/mach-types.h>
@@ -33,7 +34,6 @@#include <plat/keypad.h> #include <plat/common.h> #include <plat/dsp_common.h> -#include <plat/omapfb.h> #include <plat/hwa742.h> #include <plat/lcd_mipid.h> #include <plat/mmc.h>
Signature · 1 line
1.6.6.rc0
PATCH 3/10 video: omap: sossi: make it build again
In reply to Felipe Balbiadd missing <linux/interrupt.h>
--- drivers/video/omap/sossi.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/video/omap/sossi.c +1 -0
@@ -23,6 +23,7 @@#include <linux/clk.h> #include <linux/irq.h> #include <linux/io.h> +#include <linux/interrupt.h> #include <plat/dma.h>
Signature · 1 line
1.6.6.rc0
PATCH 4/10 video: omap: hwa742: make it build again
In reply to Felipe Balbiadd missing <linux/interrupt.h>
--- drivers/video/omap/hwa742.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/video/omap/hwa742.c +1 -0
@@ -25,6 +25,7 @@#include <linux/fb.h> #include <linux/delay.h> #include <linux/clk.h> +#include <linux/interrupt.h> #include <plat/dma.h> #include <plat/hwa742.h>
Signature · 1 line
1.6.6.rc0
PATCH 5/10 cbus: tahvo-usb: make it build again
In reply to Felipe Balbiplenty of legacy code sitting there. Make it build again. Later patches will come to clean that up.
--- drivers/cbus/tahvo-usb.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
drivers/cbus/tahvo-usb.c +6 -6
@@ -114,8 +114,8 @@ static struct platform_device *tahvo_otg_dev;static irqreturn_t omap_otg_irq (int irq,void *arg) { -struct platform_device *otg_dev = (struct platform_device *) arg; -struct tahvo_usb *tu = (struct tahvo_usb *) otg_dev->dev.driver_data; +struct platform_device *otg_dev = arg; +struct tahvo_usb *tu =platform_get_drvdata (otg_dev);u16 otg_irq; otg_irq =omap_readw (OTG_IRQ_SRC );
@@ -227,7 +227,7 @@ struct device_driver omap_otg_driver = {static ssize_t vbus_state_show (struct device *device,struct device_attribute *attr,char *buf) { -struct tahvo_usb *tu = (struct tahvo_usb *) device->driver_data; +struct tahvo_usb *tu =dev_get_drvdata (device);return sprintf (buf,"%d\n" , tu->vbus_state); } static DEVICE_ATTR(vbus_state, 0444, vbus_state_show, NULL);
@@ -590,7 +590,7 @@ static void tahvo_usb_vbus_interrupt(unsigned long arg)static ssize_t otg_mode_show (struct device *device,struct device_attribute *attr,char *buf) { -struct tahvo_usb *tu = (struct tahvo_usb *) device->driver_data; +struct tahvo_usb *tu =dev_get_drvdata (device);switch (tu->tahvo_mode) {case TAHVO_MODE_HOST :return sprintf (buf,"host\n" );
@@ -604,7 +604,7 @@ static ssize_t otg_mode_store(struct device *device,struct device_attribute *attr, const char *buf, size_t count) { - struct tahvo_usb *tu = (struct tahvo_usb*) device->driver_data; + struct tahvo_usb *tu = dev_get_drvdata(device);int r; r =strlen (buf);
@@ -706,7 +706,7 @@ static int tahvo_usb_probe(struct device *dev)return ret; } - dev->driver_data = tu; +dev_set_drvdata (dev, tu);/* Act upon current vbus state once at startup. A vbus state irq may or * may not be generated in addition to this. */
Signature · 1 line
1.6.6.rc0
Tony Lindgren
maintainerPATCH 5/10 cbus: tahvo-usb: make it build again
This patch has been applied to the linux-omap
by youw fwiendly patch wobot.
Branch in linux-omap: cbus
Initial commit ID (Likely to change): ea51ab278e51ec3ef596862aae4ec2b63e3e82ad
PatchWorks
http://patchwork.kernel.org/patch/64371/
Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=ea51ab278e51ec3ef596862aae4ec2b63e3e82ad
PATCH 6/10 cbus: switch to kzalloc
In reply to Felipe Balbichange kmalloc() + memset() to kzalloc(), no functional changes.
--- drivers/cbus/cbus.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/cbus/cbus.c +1 -3
@@ -224,12 +224,10 @@ int __init cbus_bus_init(void)struct cbus_host *chost;int ret; - chost =kmalloc (sizeof (*chost),GFP_KERNEL ); + chost =kzalloc (sizeof (*chost),GFP_KERNEL );if (chost ==NULL )return -ENOMEM ; -memset (chost,0 ,sizeof (*chost)); -spin_lock_init (&chost->lock);/* REVISIT: Pass these from board-*.c files in platform_data */
Signature · 1 line
1.6.6.rc0
Tony Lindgren
maintainerPATCH 6/10 cbus: switch to kzalloc
This patch has been applied to the linux-omap
by youw fwiendly patch wobot.
Branch in linux-omap: cbus
Initial commit ID (Likely to change): b57560b33964a00931ebde9deb6d99eb5172f1c2
PatchWorks
http://patchwork.kernel.org/patch/64369/
Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=b57560b33964a00931ebde9deb6d99eb5172f1c2
PATCH 7/10 cbus: move EXPORT_SYMBOL close to its exported symbols
In reply to Felipe Balbiwhile there, also add a missing static to cbus_bus_init().
--- drivers/cbus/cbus.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-)
drivers/cbus/cbus.c +4 -5
@@ -38,6 +38,7 @@#include "cbus.h" struct cbus_host *cbus_host =NULL ; +EXPORT_SYMBOL (cbus_host);#ifdef CONFIG_ARCH_OMAP1 /* We use our own MPUIO functions to get closer to 1MHz bus speed */
@@ -210,6 +211,7 @@ int cbus_read_reg(struct cbus_host *host, int dev, int reg) {return cbus_host ?cbus_transfer (host, dev, reg,-1 ) : -ENODEV ; } +EXPORT_SYMBOL (cbus_read_reg);/* * Write to a given register of the device
@@ -218,8 +220,9 @@ int cbus_write_reg(struct cbus_host *host, int dev, int reg, u16 val) {return cbus_host ?cbus_transfer (host, dev, reg, (int )val) : -ENODEV ; } +EXPORT_SYMBOL (cbus_write_reg); -int __init cbus_bus_init (void ) +static int __init cbus_bus_init (void ) {struct cbus_host *chost;int ret;
@@ -286,10 +289,6 @@ exit1:subsys_initcall (cbus_bus_init); -EXPORT_SYMBOL (cbus_host); -EXPORT_SYMBOL (cbus_read_reg); -EXPORT_SYMBOL (cbus_write_reg); -MODULE_DESCRIPTION ("CBUS serial protocol" );MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Juha Yrjölä, David Weinehall, and Mikko Ylinen" );
Signature · 6 lines
1.6.6.rc0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 8/10 cbus: separate into several MODULE_AUTHOR entries
In reply to Felipe Balbiwill look cleaner on modinfo.
--- drivers/cbus/cbus.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/cbus/cbus.c +3 -1
@@ -291,4 +291,6 @@ subsys_initcall(cbus_bus_init);MODULE_DESCRIPTION ("CBUS serial protocol" );MODULE_LICENSE ("GPL" ); -MODULE_AUTHOR ("Juha Yrjölä, David Weinehall, and Mikko Ylinen" ); +MODULE_AUTHOR ("Juha Yrjölä" ); +MODULE_AUTHOR ("David Weinehall" ); +MODULE_AUTHOR ("Mikko Ylinen" );
Signature · 6 lines
1.6.6.rc0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 9/10 cbus: move to platform_driver
In reply to Felipe Balbialso add the platform_device to 770 and n8x0 board files.
--- arch/arm/mach-omap1/board-nokia770.c | 6 ++++++ arch/arm/mach-omap2/board-n8x0.c | 8 ++++++++ drivers/cbus/cbus.c | 34 +++++++++++++++++++++++++++++++++- 3 files changed, 47 insertions(+), 1 deletions(-)
arch/arm/mach-omap1/board-nokia770.c +6 -0
@@ -97,8 +97,14 @@ static struct platform_device nokia770_kp_device = { .resource = nokia770_kp_resources, }; +static struct platform_device nokia770_cbus_device = { + .name ="cbus" , + .id =-1 , +}; +static struct platform_device *nokia770_devices[]__initdata = { &nokia770_kp_device, + &nokia770_cbus_device, };static void mipid_shutdown (struct mipid_platform_data *pdata)
arch/arm/mach-omap2/board-n8x0.c +8 -0
@@ -17,6 +17,7 @@#include <linux/init.h> #include <linux/io.h> #include <linux/stddef.h> +#include <linux/platform_device.h> #include <linux/spi/spi.h> #include <linux/usb/musb.h>
@@ -77,6 +78,11 @@ static struct mtd_partition onenand_partitions[] = { }, }; +static struct platform_device n8x0_cbus_device = { + .name ="cbus" , + .id =-1 , +}; +static struct omap_onenand_platform_data board_onenand_data = { .cs =0 , .gpio_irq =26 ,
@@ -111,6 +117,8 @@ static void __init n8x0_init_irq(void)static void __init n8x0_init_machine (void ) { +platform_device_register (&n8x0_cbus_device); +/* FIXME: add n810 spi devices */ spi_register_board_info (n800_spi_board_info,ARRAY_SIZE (n800_spi_board_info));
drivers/cbus/cbus.c +33 -1
@@ -29,6 +29,7 @@#include <linux/delay.h> #include <linux/spinlock.h> #include <linux/gpio.h> +#include <linux/platform_device.h> #include <asm/io.h> #include <asm/mach-types.h>
@@ -222,7 +223,7 @@ int cbus_write_reg(struct cbus_host *host, int dev, int reg, u16 val) }EXPORT_SYMBOL (cbus_write_reg); -static int __init cbus_bus_init (void ) +static int __init cbus_bus_probe (struct platform_device *pdev) {struct cbus_host *chost;int ret;
@@ -275,6 +276,8 @@ static int __init cbus_bus_init(void)gpio_set_value (chost->clk_gpio,1 );gpio_set_value (chost->clk_gpio,0 ); +platform_set_drvdata (pdev, chost); + cbus_host = chost;return 0 ;
@@ -284,13 +287,42 @@ exit2:gpio_free (chost->clk_gpio); exit1:kfree (chost); +return ret; } +static void __exit cbus_bus_remove(struct platform_device *pdev) +{ +struct cbus_host *chost =platform_get_drvdata (pdev); + +gpio_free (chost->dat_gpio); +gpio_free (chost->clk_gpio); +kfree (chost); +} + +static struct platform_driver cbus_driver = { + .remove =__exit_p (cbus_bus_remove), + .driver = { + .name ="cbus" , + }, +}; + +static int __init cbus_bus_init (void ) +{ +return platform_driver_probe (&cbus_driver, cbus_bus_probe); +} +subsys_initcall (cbus_bus_init); +static void __exit cbus_bus_exit(void) +{ +platform_driver_unregister (&cbus_driver); +} +module_exit (cbus_bus_exit); +MODULE_DESCRIPTION ("CBUS serial protocol" );MODULE_LICENSE ("GPL" );MODULE_AUTHOR ("Juha Yrjölä" );MODULE_AUTHOR ("David Weinehall" );MODULE_AUTHOR ("Mikko Ylinen" ); +
Signature · 6 lines
1.6.6.rc0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 10/10 cbus: add platform_data to pass gpios
In reply to Felipe Balbialso add the platform_data to the related
board files.
--- arch/arm/mach-omap1/board-nokia770.c | 10 ++++++++++ arch/arm/mach-omap2/board-n8x0.c | 10 ++++++++++ arch/arm/plat-omap/include/plat/cbus.h | 31 +++++++++++++++++++++++++++++++ drivers/cbus/cbus.c | 30 +++++------------------------- 4 files changed, 56 insertions(+), 25 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/cbus.h
arch/arm/mach-omap1/board-nokia770.c +10 -0
@@ -38,6 +38,7 @@#include <plat/lcd_mipid.h> #include <plat/mmc.h> #include <plat/clock.h> +#include <plat/cbus.h> #define ADS7846_PENDOWN_GPIO 15
@@ -97,9 +98,18 @@ static struct platform_device nokia770_kp_device = { .resource = nokia770_kp_resources, }; +static struct cbus_host_platform_data nokia770_cbus_data = { + .clk_gpio =OMAP_MPUIO (11 ), + .dat_gpio =OMAP_MPUIO (10 ), + .sel_gpio =OMAP_MPUIO (9 ), +}; +static struct platform_device nokia770_cbus_device = { .name ="cbus" , .id =-1 , + .dev = { + .platform_data = &nokia770_cbus_data, + }, };static struct platform_device *nokia770_devices[]__initdata = {
arch/arm/mach-omap2/board-n8x0.c +10 -0
@@ -30,6 +30,7 @@#include <plat/mcspi.h> #include <plat/onenand.h> #include <plat/serial.h> +#include <plat/cbus.h> static struct omap2_mcspi_device_config p54spi_mcspi_config = { .turbo_mode =0 ,
@@ -78,9 +79,18 @@ static struct mtd_partition onenand_partitions[] = { }, }; +static struct cbus_host_platform_data n8x0_cbus_data = { + .clk_gpio =66 , + .dat_gpio =65 , + .sel_gpio =64 , +}; +static struct platform_device n8x0_cbus_device = { .name ="cbus" , .id =-1 , + .dev = { + .platform_data = &n8x0_cbus_data, + }, };static struct omap_onenand_platform_data board_onenand_data = {
arch/arm/plat-omap/include/plat/cbus.h new file +31 -0
@@ -0,0 +1,31 @@ +/* +* cbus.h - CBUS platform_data definition +* +* Copyright (C) 2004 - 2009 Nokia Corporation +* +* Written by Felipe Balbi <[email protected]> +* +* This file is subject to the terms and conditions of the GNU General +* Public License. See the file "COPYING" in the main directory of this +* archive for more details. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT 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, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef __PLAT_CBUS_H +#define __PLAT_CBUS_H + +struct cbus_host_platform_data { +int dat_gpio; +int clk_gpio; +int sel_gpio; +}; + +#endif /* __PLAT_CBUS_H */
drivers/cbus/cbus.c +5 -25
@@ -35,6 +35,7 @@#include <asm/mach-types.h> #include <plat/board.h> +#include <plat/cbus.h> #include "cbus.h"
@@ -226,6 +227,7 @@ EXPORT_SYMBOL(cbus_write_reg);static int __init cbus_bus_probe (struct platform_device *pdev) {struct cbus_host *chost; +struct cbus_host_platform_data *pdata = pdev->dev.platform_data;int ret; chost =kzalloc (sizeof (*chost),GFP_KERNEL );
@@ -234,31 +236,9 @@ static int __init cbus_bus_probe(struct platform_device *pdev)spin_lock_init (&chost->lock); -/* REVISIT: Pass these from board-*.c files in platform_data */ -if (machine_is_nokia770 ()) { - chost->clk_gpio =OMAP_MPUIO (11 ); - chost->dat_gpio =OMAP_MPUIO (10 ); - chost->sel_gpio =OMAP_MPUIO (9 ); - }else if (machine_is_nokia_n800 () ||machine_is_nokia_n810 () || -machine_is_nokia_n810_wimax ()) { - chost->clk_gpio =66 ; - chost->dat_gpio =65 ; - chost->sel_gpio =64 ; - }else { -printk (KERN_ERR "cbus: Unsupported board\n" ); - ret = -ENODEV ; - goto exit1; - } - -#ifdef CONFIG_ARCH_OMAP1 -if (!OMAP_GPIO_IS_MPUIO (chost->clk_gpio) || - !OMAP_GPIO_IS_MPUIO (chost->dat_gpio) || - !OMAP_GPIO_IS_MPUIO (chost->sel_gpio)) { -printk (KERN_ERR "cbus: Only MPUIO pins supported\n" ); - ret = -ENODEV ; - goto exit1; - } -#endif + chost->clk_gpio = pdata->clk_gpio; + chost->dat_gpio = pdata->dat_gpio; + chost->sel_gpio = pdata->sel_gpio;if ((ret =gpio_request (chost->clk_gpio,"CBUS clk" )) <0 ) goto exit1;
Signature · 1 line
1.6.6.rc0
Tony Lindgren
maintainerPATCH 10/10 cbus: add platform_data to pass gpios
This patch has been applied to the linux-omap
by youw fwiendly patch wobot.
Branch in linux-omap: cbus
Initial commit ID (Likely to change): 54fb6e87c520616922a960aeb6d27a5c61976cdb
PatchWorks
http://patchwork.kernel.org/patch/64370/
Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=54fb6e87c520616922a960aeb6d27a5c61976cdb