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>
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);
}
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