Trim down mach includes in MSM drivers
Subsystems (6)
cover Trim down mach includes in MSM drivers
This patch series trims the usage of mach includes in MSM drivers. In particular it targets the msm_iomap.h header file and completely removes the cpu.h header file. After this series we only have one driver using the iomap.h file outside of mach-msm. Once that driver is moved to be a platform device we can make msm_iomap.h private to mach-msm.
This series is based on linux-next-20120917, which has the msm DT timer patches (the other user of cpu.h in MSM).
Patches 2 and 3 can probably be routed the appropriate subsystem trees if desired. It would be good if patch 1, 4, and 5 go through the MSM tree, so it may be easier to just put all these patches through the MSM tree.
Stephen Boyd (5):
ARM: msm: Move dma.h #defines that are private to dma.c
mmc: msm_sdcc: Remove unnecessary include
video: msm: Remove useless mach/* includes
gpio: Make gpio-msm-v1 into a platform driver
ARM: msm: Remove unused cpu.h header file
arch/arm/mach-msm/board-halibut.c | 1 + arch/arm/mach-msm/board-msm7x30.c | 1 + arch/arm/mach-msm/board-qsd8x50.c | 1 + arch/arm/mach-msm/board-trout.c | 1 + arch/arm/mach-msm/devices-msm7x00.c | 31 +++++ arch/arm/mach-msm/devices-msm7x30.c | 31 +++++ arch/arm/mach-msm/devices-qsd8x50.c | 31 +++++ arch/arm/mach-msm/devices.h | 4 + arch/arm/mach-msm/dma.c | 26 +++++ arch/arm/mach-msm/include/mach/cpu.h | 54 --------- arch/arm/mach-msm/include/mach/dma.h | 26 ----- drivers/gpio/gpio-msm-v1.c | 220 ++++++++++++++++++++++++----------- drivers/mmc/host/msm_sdcc.c | 1 - drivers/video/msm/mddi.c | 3 - drivers/video/msm/mdp.c | 1 - drivers/video/msm/mdp_hw.h | 1 - 16 files changed, 276 insertions(+), 157 deletions(-) delete mode 100644 arch/arm/mach-msm/include/mach/cpu.h
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH 1/5 ARM: msm: Move dma.h #defines that are private to dma.c
These #defines are only used by the dma.c file within mach-msm. Don't put them into a global mach include that any driver can use to muck with registers within the dma controller. This also prevents random people from getting access to msm_iomap.h (a file that will soon be private to mach-msm).
--- arch/arm/mach-msm/dma.c | 26 ++++++++++++++++++++++++++ arch/arm/mach-msm/include/mach/dma.h | 26 -------------------------- 2 files changed, 26 insertions(+), 26 deletions(-)
arch/arm/mach-msm/dma.c +26 -0
@@ -19,9 +19,35 @@#include <linux/interrupt.h> #include <linux/completion.h> #include <mach/dma.h> +#include <mach/msm_iomap.h> #define MSM_DMOV_CHANNEL_COUNT 16 +#define DMOV_SD0 (off, ch) (MSM_DMOV_BASE + 0x0000 + (off) + ((ch) << 2)) +#define DMOV_SD1 (off, ch) (MSM_DMOV_BASE + 0x0400 + (off) + ((ch) << 2)) +#define DMOV_SD2 (off, ch) (MSM_DMOV_BASE + 0x0800 + (off) + ((ch) << 2)) +#define DMOV_SD3 (off, ch) (MSM_DMOV_BASE + 0x0C00 + (off) + ((ch) << 2)) + +#if defined(CONFIG_ARCH_MSM7X30 ) +#define DMOV_SD_AARM DMOV_SD2 +#else +#define DMOV_SD_AARM DMOV_SD3 +#endif + +#define DMOV_CMD_PTR (ch) DMOV_SD_AARM(0x000, ch) +#define DMOV_RSLT (ch) DMOV_SD_AARM(0x040, ch) +#define DMOV_FLUSH0 (ch) DMOV_SD_AARM(0x080, ch) +#define DMOV_FLUSH1 (ch) DMOV_SD_AARM(0x0C0, ch) +#define DMOV_FLUSH2 (ch) DMOV_SD_AARM(0x100, ch) +#define DMOV_FLUSH3 (ch) DMOV_SD_AARM(0x140, ch) +#define DMOV_FLUSH4 (ch) DMOV_SD_AARM(0x180, ch) +#define DMOV_FLUSH5 (ch) DMOV_SD_AARM(0x1C0, ch) + +#define DMOV_STATUS (ch) DMOV_SD_AARM(0x200, ch) +#define DMOV_ISR DMOV_SD_AARM(0x380, 0) + +#define DMOV_CONFIG (ch) DMOV_SD_AARM(0x300, ch) +enum {MSM_DMOV_PRINT_ERRORS =1 ,MSM_DMOV_PRINT_IO =2 ,
arch/arm/mach-msm/include/mach/dma.h +0 -26
@@ -16,7 +16,6 @@ #ifndef __ASM_ARCH_MSM_DMA_H #include <linux/list.h> -#include <mach/msm_iomap.h> struct msm_dmov_errdata { uint32_t flush[6];
@@ -45,48 +44,23 @@ static inlineint msm_dmov_exec_cmd (unsigned id,unsigned int cmdptr) {return -EIO ; }#endif - -#define DMOV_SD0 (off, ch) (MSM_DMOV_BASE + 0x0000 + (off) + ((ch) << 2)) -#define DMOV_SD1 (off, ch) (MSM_DMOV_BASE + 0x0400 + (off) + ((ch) << 2)) -#define DMOV_SD2 (off, ch) (MSM_DMOV_BASE + 0x0800 + (off) + ((ch) << 2)) -#define DMOV_SD3 (off, ch) (MSM_DMOV_BASE + 0x0C00 + (off) + ((ch) << 2)) - -#if defined(CONFIG_ARCH_MSM7X30 ) -#define DMOV_SD_AARM DMOV_SD2 -#else -#define DMOV_SD_AARM DMOV_SD3 -#endif - -#define DMOV_CMD_PTR (ch) DMOV_SD_AARM(0x000, ch)#define DMOV_CMD_LIST (0 << 29)/* does not work */ #define DMOV_CMD_PTR_LIST (1 << 29)/* works */ #define DMOV_CMD_INPUT_CFG (2 << 29)/* untested */ #define DMOV_CMD_OUTPUT_CFG (3 << 29)/* untested */ #define DMOV_CMD_ADDR (addr) ((addr) >> 3) -#define DMOV_RSLT (ch) DMOV_SD_AARM(0x040, ch)#define DMOV_RSLT_VALID (1 << 31)/* 0 == host has empties result fifo */ #define DMOV_RSLT_ERROR (1 << 3)#define DMOV_RSLT_FLUSH (1 << 2)#define DMOV_RSLT_DONE (1 << 1)/* top pointer done */ #define DMOV_RSLT_USER (1 << 0)/* command with FR force result */ -#define DMOV_FLUSH0 (ch) DMOV_SD_AARM(0x080, ch) -#define DMOV_FLUSH1 (ch) DMOV_SD_AARM(0x0C0, ch) -#define DMOV_FLUSH2 (ch) DMOV_SD_AARM(0x100, ch) -#define DMOV_FLUSH3 (ch) DMOV_SD_AARM(0x140, ch) -#define DMOV_FLUSH4 (ch) DMOV_SD_AARM(0x180, ch) -#define DMOV_FLUSH5 (ch) DMOV_SD_AARM(0x1C0, ch) - -#define DMOV_STATUS (ch) DMOV_SD_AARM(0x200, ch)#define DMOV_STATUS_RSLT_COUNT (n) (((n) >> 29))#define DMOV_STATUS_CMD_COUNT (n) (((n) >> 27) & 3)#define DMOV_STATUS_RSLT_VALID (1 << 1)#define DMOV_STATUS_CMD_PTR_RDY (1 << 0) -#define DMOV_ISR DMOV_SD_AARM(0x380, 0) - -#define DMOV_CONFIG (ch) DMOV_SD_AARM(0x300, ch)#define DMOV_CONFIG_FORCE_TOP_PTR_RSLT (1 << 2)#define DMOV_CONFIG_FORCE_FLUSH_RSLT (1 << 1)#define DMOV_CONFIG_IRQ_EN (1 << 0)
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH 2/5 mmc: msm_sdcc: Remove unnecessary include
In reply to Stephen BoydThis driver has no reason to include msm_iomap.h. Remove it so that we can remove msm_iomap.h from include/mach in the future.
--- drivers/mmc/host/msm_sdcc.c | 1 - 1 file changed, 1 deletion(-)
drivers/mmc/host/msm_sdcc.c +0 -1
@@ -43,7 +43,6 @@#include <asm/sizes.h> #include <mach/mmc.h> -#include <mach/msm_iomap.h> #include <mach/dma.h> #include <mach/clk.h>
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Re: [PATCH 2/5] mmc: msm_sdcc: Remove unnecessary include
Hi,
Quoted 14 lines · Stephen Boyd
This driver has no reason to include
msm_iomap.h. Remove it so that we can removemsm_iomap.hfrominclude/machin the future.Cc Chris Ball <[email protected]>Signed-off-by Stephen Boyd <[email protected]>--- drivers/mmc/host/msm_sdcc.c | 1 - 1 file changed, 1 deletion(-)drivers/mmc/host/msm_sdcc.c +0
-0
drivers/mmc/host/msm_sdcc.c line 47
Quoted 6 lines
drivers/mmc/host/msm_sdcc.c +0
-1@@ -43,7 +43,6 @@#include <asm/sizes.h> #include <mach/mmc.h> -#include <mach/msm_iomap.h> #include <mach/dma.h> #include <mach/clk.h>
Sending this via the MSM tree is fine. Thanks,
- Chris.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child
PATCH 3/5 video: msm: Remove useless mach/* includes
In reply to Stephen BoydThis driver doesn't need to use these mach includes so remove them. This is a necessary step to support a single zImage.
--- drivers/video/msm/mddi.c | 3 --- drivers/video/msm/mdp.c | 1 - drivers/video/msm/mdp_hw.h | 1 - 3 files changed, 5 deletions(-)
drivers/video/msm/mddi.c +0 -3
@@ -26,9 +26,6 @@#include <linux/clk.h> #include <linux/io.h> #include <linux/sched.h> -#include <mach/msm_iomap.h> -#include <mach/irqs.h> -#include <mach/board.h> #include <mach/msm_fb.h> #include "mddi_hw.h"
drivers/video/msm/mdp.c +0 -1
@@ -25,7 +25,6 @@#include <linux/major.h> #include <linux/slab.h> -#include <mach/msm_iomap.h> #include <mach/msm_fb.h> #include <linux/platform_device.h> #include <linux/export.h>
drivers/video/msm/mdp_hw.h +0 -1
@@ -15,7 +15,6 @@#ifndef _MDP_HW_H_#define _MDP_HW_H_ -#include <mach/msm_iomap.h> #include <mach/msm_fb.h> struct mdp_info {
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Florian Tobias Schandinat
AppliedRe: [PATCH 3/5] video: msm: Remove useless mach/* includes
Quoted 5 lines · Stephen Boyd
This driver doesn't need to use these mach includes so remove them. This is a necessary step to support a single zImage.
Cc Florian Tobias Schandinat <[email protected]>Signed-off-by Stephen Boyd <[email protected]>
Applied.
Thanks,
Florian Tobias Schandinat
Quoted 44 lines
--- drivers/video/msm/mddi.c | 3 --- drivers/video/msm/mdp.c | 1 - drivers/video/msm/mdp_hw.h | 1 - 3 files changed, 5 deletions(-)drivers/video/msm/mddi.c +0
-3@@ -26,9 +26,6 @@#include <linux/clk.h> #include <linux/io.h> #include <linux/sched.h> -#include <mach/msm_iomap.h> -#include <mach/irqs.h> -#include <mach/board.h> #include <mach/msm_fb.h> #include "mddi_hw.h" drivers/video/msm/mdp.c +0
-1@@ -25,7 +25,6 @@#include <linux/major.h> #include <linux/slab.h> -#include <mach/msm_iomap.h> #include <mach/msm_fb.h> #include <linux/platform_device.h> #include <linux/export.h> drivers/video/msm/mdp_hw.h +0
-1@@ -15,7 +15,6 @@#ifndef _MDP_HW_H_#define _MDP_HW_H_ -#include <mach/msm_iomap.h> #include <mach/msm_fb.h> struct mdp_info {
PATCH 4/5 gpio: Make gpio-msm-v1 into a platform driver
In reply to Stephen BoydDoing this removes the dependence of this driver on the msm_iomap.h and cpu.h mach include headers provied by MSM. This is necessary to support single zImage work in the future and allows us to remove cpu.h entirely and brings us closer to removing msm_iomap.h.
--- arch/arm/mach-msm/board-halibut.c | 1 + arch/arm/mach-msm/board-msm7x30.c | 1 + arch/arm/mach-msm/board-qsd8x50.c | 1 + arch/arm/mach-msm/board-trout.c | 1 + arch/arm/mach-msm/devices-msm7x00.c | 31 +++++ arch/arm/mach-msm/devices-msm7x30.c | 31 +++++ arch/arm/mach-msm/devices-qsd8x50.c | 31 +++++ arch/arm/mach-msm/devices.h | 4 + drivers/gpio/gpio-msm-v1.c | 220 ++++++++++++++++++++++++------------ 9 files changed, 250 insertions(+), 71 deletions(-)
arch/arm/mach-msm/board-halibut.c +1 -0
@@ -59,6 +59,7 @@ static struct platform_device smc91x_device = { };static struct platform_device *devices[]__initdata = { + &msm_device_gpio_7201, &msm_device_uart3, &msm_device_smd, &msm_device_nand,
arch/arm/mach-msm/board-msm7x30.c +1 -0
@@ -89,6 +89,7 @@ struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = { };static struct platform_device *devices[]__initdata = { + &msm_device_gpio_7x30, #if defined(CONFIG_SERIAL_MSM) || defined(CONFIG_MSM_SERIAL_DEBUGGER) &msm_device_uart2, #endif
arch/arm/mach-msm/board-qsd8x50.c +1 -0
@@ -89,6 +89,7 @@ static struct msm_otg_platform_data msm_otg_pdata = { };static struct platform_device *devices[]__initdata = { + &msm_device_gpio_8x50, &msm_device_uart3, &msm_device_smd, &msm_device_otg,
arch/arm/mach-msm/board-trout.c +1 -0
@@ -36,6 +36,7 @@extern int trout_init_mmc (unsigned int );static struct platform_device *devices[]__initdata = { + &msm_device_gpio_7201, &msm_device_uart3, &msm_device_smd, &msm_device_nand,
arch/arm/mach-msm/devices-msm7x00.c +31 -0
@@ -29,6 +29,37 @@#include "clock-pcom.h" #include <mach/mmc.h> +static struct resource msm_gpio_resources[] = { + { + .start =32 +0 , + .end =32 +0 , + .flags =IORESOURCE_IRQ , + }, + { + .start =32 +1 , + .end =32 +1 , + .flags =IORESOURCE_IRQ , + }, + { + .start =0xa9200800 , + .end =0xa9200800 +SZ_4K -1 , + .flags =IORESOURCE_MEM , + .name ="gpio1" + }, + { + .start =0xa9300C00 , + .end =0xa9300C00 +SZ_4K -1 , + .flags =IORESOURCE_MEM , + .name ="gpio2" + }, +}; + +struct platform_device msm_device_gpio_7201 = { + .name ="gpio-msm-7201" , + .num_resources =ARRAY_SIZE (msm_gpio_resources), + .resource = msm_gpio_resources, +}; +static struct resource resources_uart1[] = { { .start =INT_UART1 ,
arch/arm/mach-msm/devices-msm7x30.c +31 -0
@@ -33,6 +33,37 @@#include <mach/mmc.h> +static struct resource msm_gpio_resources[] = { + { + .start =32 +18 , + .end =32 +18 , + .flags =IORESOURCE_IRQ , + }, + { + .start =32 +19 , + .end =32 +19 , + .flags =IORESOURCE_IRQ , + }, + { + .start =0xac001000 , + .end =0xac001000 +SZ_4K -1 , + .flags =IORESOURCE_MEM , + .name ="gpio1" + }, + { + .start =0xac101400 , + .end =0xac101400 +SZ_4K -1 , + .flags =IORESOURCE_MEM , + .name ="gpio2" + }, +}; + +struct platform_device msm_device_gpio_7x30 = { + .name ="gpio-msm-7x30" , + .num_resources =ARRAY_SIZE (msm_gpio_resources), + .resource = msm_gpio_resources, +}; +static struct resource resources_uart2[] = { { .start =INT_UART2 ,
arch/arm/mach-msm/devices-qsd8x50.c +31 -0
@@ -30,6 +30,37 @@#include <mach/mmc.h> #include "clock-pcom.h" +static struct resource msm_gpio_resources[] = { + { + .start =64 +165 +9 , + .end =64 +165 +9 , + .flags =IORESOURCE_IRQ , + }, + { + .start =64 +165 +10 , + .end =64 +165 +10 , + .flags =IORESOURCE_IRQ , + }, + { + .start =0xa9000800 , + .end =0xa9000800 +SZ_4K -1 , + .flags =IORESOURCE_MEM , + .name ="gpio1" + }, + { + .start =0xa9100C00 , + .end =0xa9100C00 +SZ_4K -1 , + .flags =IORESOURCE_MEM , + .name ="gpio2" + }, +}; + +struct platform_device msm_device_gpio_8x50 = { + .name ="gpio-msm-8x50" , + .num_resources =ARRAY_SIZE (msm_gpio_resources), + .resource = msm_gpio_resources, +}; +static struct resource resources_uart3[] = { { .start =INT_UART3 ,
arch/arm/mach-msm/devices.h +4 -0
@@ -20,6 +20,10 @@#include "clock.h" +extern struct platform_device msm_device_gpio_7201; +extern struct platform_device msm_device_gpio_7x30; +extern struct platform_device msm_device_gpio_8x50; +extern struct platform_device msm_device_uart1;extern struct platform_device msm_device_uart2;extern struct platform_device msm_device_uart3;
drivers/gpio/gpio-msm-v1.c +149 -71
386 lines not on this page · raw message
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Re: [PATCH 4/5] gpio: Make gpio-msm-v1 into a platform driver
Quoted 10 lines · Stephen Boyd
Doing this removes the dependence of this driver on the
msm_iomap.handcpu.hmach include headers provied by MSM. This is necessary to support single zImage work in the future and allows us to removecpu.hentirely and brings us closer to removingmsm_iomap.h.Cc Grant Likely <[email protected]>Cc Linus Walleij <[email protected]>Cc Rohit Vaswani <[email protected]>Signed-off-by Stephen Boyd <[email protected]>
This must be encouraged:
Stephen, do you have a mainline-based kernel tree that can boot on my DragonBoard? It's just sitting idle here... I pushed David in the past, just naggin'...
Yours,
Linus Walleij
Re: [PATCH 4/5] gpio: Make gpio-msm-v1 into a platform driver
Quoted 13 lines · Linus Walleij
Quoted 10 lines · Stephen Boyd
Doing this removes the dependence of this driver on the
msm_iomap.handcpu.hmach include headers provied by MSM. This is necessary to support single zImage work in the future and allows us to removecpu.hentirely and brings us closer to removingmsm_iomap.h.Cc Grant Likely <[email protected]>Cc Linus Walleij <[email protected]>Cc Rohit Vaswani <[email protected]>Signed-off-by Stephen Boyd <[email protected]>
Quoted 6 lines
This must be encouraged:
Acked-by Linus Walleij <[email protected]>Stephen, do you have a mainline-based kernel tree that can boot on my DragonBoard? It's just sitting idle here... I pushed David in the past, just naggin'...
We're working on it :-)
The main thing coming that's needed are clocks. There are some more things (such as regulators) that will be needed to get things like SD/MMC working, and that'll be next.
David
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Re: [PATCH 4/5] gpio: Make gpio-msm-v1 into a platform driver
In reply to Stephen BoydQuoted 10 lines · Stephen Boyd
Doing this removes the dependence of this driver on the
msm_iomap.handcpu.hmach include headers provied by MSM. This is necessary to support single zImage work in the future and allows us to removecpu.hentirely and brings us closer to removingmsm_iomap.h.Cc Grant Likely <[email protected]>Cc Linus Walleij <[email protected]>Cc Rohit Vaswani <[email protected]>Signed-off-by Stephen Boyd <[email protected]>
Quoted 12 lines
--- arch/arm/mach-msm/board-halibut.c | 1 + arch/arm/mach-msm/board-msm7x30.c | 1 + arch/arm/mach-msm/board-qsd8x50.c | 1 + arch/arm/mach-msm/board-trout.c | 1 + arch/arm/mach-msm/devices-msm7x00.c | 31 +++++ arch/arm/mach-msm/devices-msm7x30.c | 31 +++++ arch/arm/mach-msm/devices-qsd8x50.c | 31 +++++ arch/arm/mach-msm/devices.h | 4 + drivers/gpio/gpio-msm-v1.c | 220 ++++++++++++++++++++++++------------ 9 files changed, 250 insertions(+), 71 deletions(-)
Thanks,
Rohit Vaswani
Signature · 1 line
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
PATCH 5/5 ARM: msm: Remove unused cpu.h header file
In reply to Stephen BoydThis header file is no longer used now that the msm timer.c and the gpio driver have been made more runtime aware. Remove the header file so no future users pop-up.
--- arch/arm/mach-msm/include/mach/cpu.h | 54 ------------------------------------ 1 file changed, 54 deletions(-) delete mode 100644 arch/arm/mach-msm/include/mach/cpu.h
arch/arm/mach-msm/include/mach/cpu.h deleted +0 -54
@@ -1,54 +0,0 @@ -/* Copyright (c) 2011, Code Aurora Forum. All rights reserved. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2 and -* only version 2 as published by the Free Software Foundation. -* -* 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., 51 Franklin Street, Fifth Floor, Boston, MA -* 02110-1301, USA. -*/ - -#ifndef __ARCH_ARM_MACH_MSM_CPU_H__ -#define __ARCH_ARM_MACH_MSM_CPU_H__ - -/* TODO: For now, only one CPU can be compiled at a time. */ - -#define cpu_is_msm7x01 () 0 -#define cpu_is_msm7x30 () 0 -#define cpu_is_qsd8x50 () 0 -#define cpu_is_msm8x60 () 0 -#define cpu_is_msm8960 () 0 - -#ifdef CONFIG_ARCH_MSM7X00A -# undef cpu_is_msm7x01 -# define cpu_is_msm7x01 () 1 -#endif - -#ifdef CONFIG_ARCH_MSM7X30 -# undef cpu_is_msm7x30 -# define cpu_is_msm7x30 () 1 -#endif - -#ifdef CONFIG_ARCH_QSD8X50 -# undef cpu_is_qsd8x50 -# define cpu_is_qsd8x50 () 1 -#endif - -#ifdef CONFIG_ARCH_MSM8X60 -# undef cpu_is_msm8x60 -# define cpu_is_msm8x60 () 1 -#endif - -#ifdef CONFIG_ARCH_MSM8960 -# undef cpu_is_msm8960 -# define cpu_is_msm8960 () 1 -#endif - -#endif
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation