Commit c5be2c2b authored by Syed Mohammed Khasim x0khasim@ti.com's avatar Syed Mohammed Khasim x0khasim@ti.com Committed by Tony Lindgren

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: default avatarSyed Mohammed Khasim <x0khasim@ti.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 66e46386
......@@ -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);
}
......
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment