From c5be2c2ba43058a6f265097c115c72f5fa0f46e9 Mon Sep 17 00:00:00 2001 From: "Syed Mohammed Khasim x0khasim@ti.com" Date: Thu, 30 Nov 2006 14:42:13 -0800 Subject: [PATCH] ARM: OMAP: Export reserved APIs in GPMC header The attached patch is to export two APIs (gpmc_cs_set_reserved and gpmc_cs_reserved) in gpmc.h. This allows other libraries and drivers to access these APIs with out doing a gpmc_request. Reason: If I have already configured a GPMC CS in boot loader I might not be interested in doing the same again in Kernel. However I might want to reserve this particular CS so that it doesn't show as free when others do a gpmc_request. Signed-off-by: Syed Mohammed Khasim Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/gpmc.c | 10 ++++++++-- include/asm-arm/arch-omap/gpmc.h | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index 2fa972e1569..26ea9ba7d84 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -264,14 +264,20 @@ static int gpmc_cs_mem_enabled(int cs) return l & (1 << 6); } -static void gpmc_cs_set_reserved(int cs, int reserved) +void gpmc_cs_set_reserved(int cs, int reserved) { + if (cs > GPMC_CS_NUM) + return -ENODEV; + gpmc_cs_map &= ~(1 << cs); gpmc_cs_map |= (reserved ? 1 : 0) << cs; } -static int gpmc_cs_reserved(int cs) +int gpmc_cs_reserved(int cs) { + if (cs > GPMC_CS_NUM) + return -ENODEV; + return gpmc_cs_map & (1 << cs); } diff --git a/include/asm-arm/arch-omap/gpmc.h b/include/asm-arm/arch-omap/gpmc.h index efbf4784960..c49b2622f68 100644 --- a/include/asm-arm/arch-omap/gpmc.h +++ b/include/asm-arm/arch-omap/gpmc.h @@ -88,5 +88,7 @@ extern int gpmc_cs_calc_divider(int cs, unsigned int sync_clk); extern int gpmc_cs_set_timings(int cs, const struct gpmc_timings *t); extern int gpmc_cs_request(int cs, unsigned long size, unsigned long *base); extern void gpmc_cs_free(int cs); +extern void gpmc_cs_set_reserved(int cs, int reserved); +extern int gpmc_cs_reserved(int cs); #endif -- 2.41.1