Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac6747ca authored by Jarkko Nikula's avatar Jarkko Nikula Committed by Tony Lindgren
Browse files

ARM: OMAP: mcbsp: Use per instance register cache size



Rationale here is to remove one global variable and to make possible to have
variable size McBSP register maps inside SoC.

Signed-off-by: default avatarJarkko Nikula <jarkko.nikula@bitmer.com>
Acked-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: default avatarJanusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 7bba67ab
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -359,6 +359,7 @@ struct omap_mcbsp {
	u16 max_tx_thres;
	u16 max_tx_thres;
	u16 max_rx_thres;
	u16 max_rx_thres;
	void *reg_cache;
	void *reg_cache;
	int reg_cache_size;
};
};


/**
/**
@@ -370,7 +371,7 @@ struct omap_mcbsp_dev_attr {
};
};


extern struct omap_mcbsp **mcbsp_ptr;
extern struct omap_mcbsp **mcbsp_ptr;
extern int omap_mcbsp_count, omap_mcbsp_cache_size;
extern int omap_mcbsp_count;


#define omap_mcbsp_check_valid_id(id)	(id < omap_mcbsp_count)
#define omap_mcbsp_check_valid_id(id)	(id < omap_mcbsp_count)
#define id_to_mcbsp_ptr(id)		mcbsp_ptr[id];
#define id_to_mcbsp_ptr(id)		mcbsp_ptr[id];
+3 −3
Original line number Original line Diff line number Diff line
@@ -31,7 +31,7 @@
#include "../mach-omap2/cm-regbits-34xx.h"
#include "../mach-omap2/cm-regbits-34xx.h"


struct omap_mcbsp **mcbsp_ptr;
struct omap_mcbsp **mcbsp_ptr;
int omap_mcbsp_count, omap_mcbsp_cache_size;
int omap_mcbsp_count;


static void omap_mcbsp_write(struct omap_mcbsp *mcbsp, u16 reg, u32 val)
static void omap_mcbsp_write(struct omap_mcbsp *mcbsp, u16 reg, u32 val)
{
{
@@ -678,7 +678,7 @@ int omap_mcbsp_request(unsigned int id)
	}
	}
	mcbsp = id_to_mcbsp_ptr(id);
	mcbsp = id_to_mcbsp_ptr(id);


	reg_cache = kzalloc(omap_mcbsp_cache_size, GFP_KERNEL);
	reg_cache = kzalloc(mcbsp->reg_cache_size, GFP_KERNEL);
	if (!reg_cache) {
	if (!reg_cache) {
		return -ENOMEM;
		return -ENOMEM;
	}
	}
@@ -1225,7 +1225,7 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev)
		}
		}
	}
	}
	mcbsp->phys_base = res->start;
	mcbsp->phys_base = res->start;
	omap_mcbsp_cache_size = resource_size(res);
	mcbsp->reg_cache_size = resource_size(res);
	mcbsp->io_base = ioremap(res->start, resource_size(res));
	mcbsp->io_base = ioremap(res->start, resource_size(res));
	if (!mcbsp->io_base) {
	if (!mcbsp->io_base) {
		ret = -ENOMEM;
		ret = -ENOMEM;