Adds suspend/resume support to EDMA driver.
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAABAgAGBQJUbgdOAAoJEGFBu2jqvgRNCJUQAJJRKC5A6lMds5QTcLWXav5o /aLmg77yo/q+4rCjGOdZz1KGNpn8yJkENHn32h+nLn4Cs3QwGovqHCoJbDxvLb7V CsbhqpkTmIvGAWIFMXDA82nzSP0m5zDjiwh96qOoUeJ3ZXinARrE9e1vj5ZDoRud SfQAuN6A/lQ2ZLo1WynNFQpXBuqnsQFCykxrDxF3T9FZ5+pxhqY839Avlpxlq1BM 14KK+OzM0SyR7iTPjT3dlr6LVIIiZdde67fms1JYtvVt/Srws7oUyXTx9jnobzMh CMeVBWeoJi1I78jGPVAs+VlQBqlfNlk0Cj96E4xcXrZjj9k2lqLV9QSC6m9TeWUc ay/MFJdX5NvKoYBc15HMz0MtVYBH0Ez+NnHaEtPy7KkWt7XyU8nbqNUCHqCYDXGo HEwGf3IarDs2sg2zL4gbj0RIvnYJuzP6oiNb549O/X0OViel7d5ZANEfsAbeexOz vUwEt+cmzc40AkVtDRkLx09M4KNadn11wT9TbndvwzoNYOkznr2AzzUJx1vorofT 0mhtI3M67oMUhynLwrzypqOYuuIJrMcZeFb8/fE0pp78AYBwHR2gKWuW/g65a2oq g+mEg1a68UVkA29OWeuIyZrffpV6qQ1byYIHBJOadIlBEasVSPexDi+u22VWdVcE AkrOdqHOYueZbUx5oYHY =YDdV -----END PGP SIGNATURE----- Merge tag 'davinci-for-v3.19/edma' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/drivers Pull "Adds suspend/resume support to EDMA driver" from Sekhar Nori: * tag 'davinci-for-v3.19/edma' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci: ARM: common: edma: add suspend resume hook Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
Коммит
a6f5e6bdc2
|
@ -244,6 +244,8 @@ struct edma {
|
||||||
/* list of channels with no even trigger; terminated by "-1" */
|
/* list of channels with no even trigger; terminated by "-1" */
|
||||||
const s8 *noevent;
|
const s8 *noevent;
|
||||||
|
|
||||||
|
struct edma_soc_info *info;
|
||||||
|
|
||||||
/* The edma_inuse bit for each PaRAM slot is clear unless the
|
/* The edma_inuse bit for each PaRAM slot is clear unless the
|
||||||
* channel is in use ... by ARM or DSP, for QDMA, or whatever.
|
* channel is in use ... by ARM or DSP, for QDMA, or whatever.
|
||||||
*/
|
*/
|
||||||
|
@ -295,7 +297,7 @@ static void map_dmach_queue(unsigned ctlr, unsigned ch_no,
|
||||||
~(0x7 << bit), queue_no << bit);
|
~(0x7 << bit), queue_no << bit);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __init assign_priority_to_queue(unsigned ctlr, int queue_no,
|
static void assign_priority_to_queue(unsigned ctlr, int queue_no,
|
||||||
int priority)
|
int priority)
|
||||||
{
|
{
|
||||||
int bit = queue_no * 4;
|
int bit = queue_no * 4;
|
||||||
|
@ -314,7 +316,7 @@ static void __init assign_priority_to_queue(unsigned ctlr, int queue_no,
|
||||||
* included in that particular EDMA variant (Eg : dm646x)
|
* included in that particular EDMA variant (Eg : dm646x)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void __init map_dmach_param(unsigned ctlr)
|
static void map_dmach_param(unsigned ctlr)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < EDMA_MAX_DMACH; i++)
|
for (i = 0; i < EDMA_MAX_DMACH; i++)
|
||||||
|
@ -1792,15 +1794,61 @@ static int edma_probe(struct platform_device *pdev)
|
||||||
edma_write_array2(j, EDMA_DRAE, i, 1, 0x0);
|
edma_write_array2(j, EDMA_DRAE, i, 1, 0x0);
|
||||||
edma_write_array(j, EDMA_QRAE, i, 0x0);
|
edma_write_array(j, EDMA_QRAE, i, 0x0);
|
||||||
}
|
}
|
||||||
|
edma_cc[j]->info = info[j];
|
||||||
arch_num_cc++;
|
arch_num_cc++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int edma_pm_resume(struct device *dev)
|
||||||
|
{
|
||||||
|
int i, j;
|
||||||
|
|
||||||
|
for (j = 0; j < arch_num_cc; j++) {
|
||||||
|
struct edma *cc = edma_cc[j];
|
||||||
|
|
||||||
|
s8 (*queue_priority_mapping)[2];
|
||||||
|
|
||||||
|
queue_priority_mapping = cc->info->queue_priority_mapping;
|
||||||
|
|
||||||
|
/* Event queue priority mapping */
|
||||||
|
for (i = 0; queue_priority_mapping[i][0] != -1; i++)
|
||||||
|
assign_priority_to_queue(j,
|
||||||
|
queue_priority_mapping[i][0],
|
||||||
|
queue_priority_mapping[i][1]);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Map the channel to param entry if channel mapping logic
|
||||||
|
* exist
|
||||||
|
*/
|
||||||
|
if (edma_read(j, EDMA_CCCFG) & CHMAP_EXIST)
|
||||||
|
map_dmach_param(j);
|
||||||
|
|
||||||
|
for (i = 0; i < cc->num_channels; i++) {
|
||||||
|
if (test_bit(i, cc->edma_inuse)) {
|
||||||
|
/* ensure access through shadow region 0 */
|
||||||
|
edma_or_array2(j, EDMA_DRAE, 0, i >> 5,
|
||||||
|
BIT(i & 0x1f));
|
||||||
|
|
||||||
|
setup_dma_interrupt(i,
|
||||||
|
cc->intr_data[i].callback,
|
||||||
|
cc->intr_data[i].data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static const struct dev_pm_ops edma_pm_ops = {
|
||||||
|
SET_LATE_SYSTEM_SLEEP_PM_OPS(NULL, edma_pm_resume)
|
||||||
|
};
|
||||||
|
|
||||||
static struct platform_driver edma_driver = {
|
static struct platform_driver edma_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "edma",
|
.name = "edma",
|
||||||
|
.pm = &edma_pm_ops,
|
||||||
.of_match_table = edma_of_ids,
|
.of_match_table = edma_of_ids,
|
||||||
},
|
},
|
||||||
.probe = edma_probe,
|
.probe = edma_probe,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче