aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2010-07-12 23:13:04 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-07-13 07:35:37 -0400
commit73b92c1fc0196e04a31ec190333ed4056a5812cf (patch)
tree169c64f1370c1cb99c14f8e55c00f07b2230fd93
parenta7ffb52bb31ef5cff1b8bb312d5a3425a983563f (diff)
ASoC: fsi: Change struct fsi_regs to fsi_core
Many registers which were grouped by category were added in FSI2. To make easy to switch FSI/FSI2, fsi_core was added instead of fsi_regs. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/sh/fsi.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 28aae0d01545..1693be477f7a 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -111,7 +111,9 @@ struct fsi_priv {
111 int periods; 111 int periods;
112}; 112};
113 113
114struct fsi_regs { 114struct fsi_core {
115 int ver;
116
115 u32 int_st; 117 u32 int_st;
116 u32 iemsk; 118 u32 iemsk;
117 u32 imsk; 119 u32 imsk;
@@ -122,7 +124,7 @@ struct fsi_master {
122 int irq; 124 int irq;
123 struct fsi_priv fsia; 125 struct fsi_priv fsia;
124 struct fsi_priv fsib; 126 struct fsi_priv fsib;
125 struct fsi_regs *regs; 127 struct fsi_core *core;
126 struct sh_fsi_platform_info *info; 128 struct sh_fsi_platform_info *info;
127 spinlock_t lock; 129 spinlock_t lock;
128}; 130};
@@ -339,8 +341,8 @@ static void fsi_irq_enable(struct fsi_priv *fsi, int is_play)
339 u32 data = fsi_port_ab_io_bit(fsi, is_play); 341 u32 data = fsi_port_ab_io_bit(fsi, is_play);
340 struct fsi_master *master = fsi_get_master(fsi); 342 struct fsi_master *master = fsi_get_master(fsi);
341 343
342 fsi_master_mask_set(master, master->regs->imsk, data, data); 344 fsi_master_mask_set(master, master->core->imsk, data, data);
343 fsi_master_mask_set(master, master->regs->iemsk, data, data); 345 fsi_master_mask_set(master, master->core->iemsk, data, data);
344} 346}
345 347
346static void fsi_irq_disable(struct fsi_priv *fsi, int is_play) 348static void fsi_irq_disable(struct fsi_priv *fsi, int is_play)
@@ -348,18 +350,18 @@ static void fsi_irq_disable(struct fsi_priv *fsi, int is_play)
348 u32 data = fsi_port_ab_io_bit(fsi, is_play); 350 u32 data = fsi_port_ab_io_bit(fsi, is_play);
349 struct fsi_master *master = fsi_get_master(fsi); 351 struct fsi_master *master = fsi_get_master(fsi);
350 352
351 fsi_master_mask_set(master, master->regs->imsk, data, 0); 353 fsi_master_mask_set(master, master->core->imsk, data, 0);
352 fsi_master_mask_set(master, master->regs->iemsk, data, 0); 354 fsi_master_mask_set(master, master->core->iemsk, data, 0);
353} 355}
354 356
355static u32 fsi_irq_get_status(struct fsi_master *master) 357static u32 fsi_irq_get_status(struct fsi_master *master)
356{ 358{
357 return fsi_master_read(master, master->regs->int_st); 359 return fsi_master_read(master, master->core->int_st);
358} 360}
359 361
360static void fsi_irq_clear_all_status(struct fsi_master *master) 362static void fsi_irq_clear_all_status(struct fsi_master *master)
361{ 363{
362 fsi_master_write(master, master->regs->int_st, 0x0000000); 364 fsi_master_write(master, master->core->int_st, 0);
363} 365}
364 366
365static void fsi_irq_clear_status(struct fsi_priv *fsi) 367static void fsi_irq_clear_status(struct fsi_priv *fsi)
@@ -371,7 +373,7 @@ static void fsi_irq_clear_status(struct fsi_priv *fsi)
371 data |= fsi_port_ab_io_bit(fsi, 1); 373 data |= fsi_port_ab_io_bit(fsi, 1);
372 374
373 /* clear interrupt factor */ 375 /* clear interrupt factor */
374 fsi_master_mask_set(master, master->regs->int_st, data, 0); 376 fsi_master_mask_set(master, master->core->int_st, data, 0);
375} 377}
376 378
377/************************************************************************ 379/************************************************************************
@@ -987,7 +989,7 @@ static int fsi_probe(struct platform_device *pdev)
987 master->fsia.master = master; 989 master->fsia.master = master;
988 master->fsib.base = master->base + 0x40; 990 master->fsib.base = master->base + 0x40;
989 master->fsib.master = master; 991 master->fsib.master = master;
990 master->regs = (struct fsi_regs *)id_entry->driver_data; 992 master->core = (struct fsi_core *)id_entry->driver_data;
991 spin_lock_init(&master->lock); 993 spin_lock_init(&master->lock);
992 994
993 pm_runtime_enable(&pdev->dev); 995 pm_runtime_enable(&pdev->dev);
@@ -1068,21 +1070,27 @@ static struct dev_pm_ops fsi_pm_ops = {
1068 .runtime_resume = fsi_runtime_nop, 1070 .runtime_resume = fsi_runtime_nop,
1069}; 1071};
1070 1072
1071static struct fsi_regs fsi_regs = { 1073static struct fsi_core fsi1_core = {
1074 .ver = 1,
1075
1076 /* Interrupt */
1072 .int_st = INT_ST, 1077 .int_st = INT_ST,
1073 .iemsk = IEMSK, 1078 .iemsk = IEMSK,
1074 .imsk = IMSK, 1079 .imsk = IMSK,
1075}; 1080};
1076 1081
1077static struct fsi_regs fsi2_regs = { 1082static struct fsi_core fsi2_core = {
1083 .ver = 2,
1084
1085 /* Interrupt */
1078 .int_st = CPU_INT_ST, 1086 .int_st = CPU_INT_ST,
1079 .iemsk = CPU_IEMSK, 1087 .iemsk = CPU_IEMSK,
1080 .imsk = CPU_IMSK, 1088 .imsk = CPU_IMSK,
1081}; 1089};
1082 1090
1083static struct platform_device_id fsi_id_table[] = { 1091static struct platform_device_id fsi_id_table[] = {
1084 { "sh_fsi", (kernel_ulong_t)&fsi_regs }, 1092 { "sh_fsi", (kernel_ulong_t)&fsi1_core },
1085 { "sh_fsi2", (kernel_ulong_t)&fsi2_regs }, 1093 { "sh_fsi2", (kernel_ulong_t)&fsi2_core },
1086}; 1094};
1087 1095
1088static struct platform_driver fsi_driver = { 1096static struct platform_driver fsi_driver = {