]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Export reserved APIs in GPMC header
authorSyed Mohammed Khasim x0khasim@ti.com <x0khasim@ti.com>
Thu, 30 Nov 2006 22:42:13 +0000 (14:42 -0800)
committerTony Lindgren <tony@atomide.com>
Thu, 30 Nov 2006 22:42:13 +0000 (14:42 -0800)
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 <x0khasim@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/gpmc.c
include/asm-arm/arch-omap/gpmc.h

index 2fa972e15694f37a929f9e3c05eb6f1370ce3e96..26ea9ba7d84fb43dfe0e215666c06d377a832ecc 100644 (file)
@@ -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);
 }
 
index efbf4784960167ab9ad0e3601055e862dc060ac1..c49b2622f68053514c8e837d1800b84632bb34f2 100644 (file)
@@ -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