13 #include <linux/module.h>
16 #include <linux/slab.h>
26 #define CCSR_GUTS_PMUXCR_UART0_I2C1_MASK 0x0001c000
27 #define CCSR_GUTS_PMUXCR_UART0_I2C1_UART0_SSI 0x00010000
28 #define CCSR_GUTS_PMUXCR_UART0_I2C1_SSI 0x00018000
30 #define CCSR_GUTS_PMUXCR_SSI_DMA_TDM_MASK 0x00000c00
31 #define CCSR_GUTS_PMUXCR_SSI_DMA_TDM_SSI 0x00000000
33 #define CCSR_GUTS_DMUXCR_PAD 1
34 #define CCSR_GUTS_DMUXCR_SSI 2
49 static inline void guts_set_dmuxcr(
struct ccsr_guts
__iomem *guts,
50 unsigned int co,
unsigned int ch,
unsigned int device)
52 unsigned int shift = 16 + (8 * (1 - co) + 2 * (3 - ch));
54 clrsetbits_be32(&guts->dmuxcr, 3 << shift, device << shift);
90 struct ccsr_guts __iomem *guts;
92 guts =
ioremap(guts_phys,
sizeof(
struct ccsr_guts));
94 dev_err(card->
dev,
"could not map global utilities\n");
136 dev_err(dev,
"could not set codec driver audio format\n");
147 dev_err(dev,
"could not set codec driver clock params\n");
164 struct ccsr_guts
__iomem *guts;
166 guts =
ioremap(guts_phys,
sizeof(
struct ccsr_guts));
168 dev_err(card->
dev,
"could not map global utilities\n");
187 .startup = p1022_ds_startup,
213 dev_err(dev,
"could not find codec node\n");
223 mdata->
dai[0].cpu_dai_name = dev_name(&ssi_pdev->
dev);
224 mdata->
dai[0].ops = &p1022_ds_ops;
227 mdata->
dai[0].codec_of_node = codec_np;
236 mdata->
dai[0].codec_dai_name =
"wm8776-hifi-playback";
237 mdata->
dai[1].codec_dai_name =
"wm8776-hifi-capture";
242 dev_err(&pdev->
dev,
"cell-index property not found\n");
251 dev_err(&pdev->
dev,
"fsl,mode property not found\n");
267 if (!iprop || !*iprop) {
269 "property is missing or invalid\n");
274 }
else if (
strcasecmp(sprop,
"i2s-master") == 0) {
279 }
else if (
strcasecmp(sprop,
"lj-slave") == 0) {
284 }
else if (
strcasecmp(sprop,
"lj-master") == 0) {
289 }
else if (
strcasecmp(sprop,
"rj-slave") == 0) {
294 }
else if (
strcasecmp(sprop,
"rj-master") == 0) {
299 }
else if (
strcasecmp(sprop,
"ac97-slave") == 0) {
304 }
else if (
strcasecmp(sprop,
"ac97-master") == 0) {
311 "unrecognized fsl,mode property '%s'\n", sprop);
317 dev_err(&pdev->
dev,
"unknown clock frequency\n");
328 dev_err(&pdev->
dev,
"missing/invalid playback DMA phandle\n");
338 dev_err(&pdev->
dev,
"missing/invalid capture DMA phandle\n");
343 mdata->
dai[0].stream_name =
"playback";
344 mdata->
dai[1].stream_name =
"capture";
345 mdata->
dai[0].name = mdata->
dai[0].stream_name;
346 mdata->
dai[1].name = mdata->
dai[1].stream_name;
348 mdata->
card.probe = p1022_ds_machine_probe;
349 mdata->
card.remove = p1022_ds_machine_remove;
353 mdata->
card.num_links = 2;
354 mdata->
card.dai_link = mdata->
dai;
359 dev_err(&pdev->
dev,
"could not register card\n");
363 of_node_put(codec_np);
370 of_node_put(codec_np);
392 .probe = p1022_ds_probe,
399 .name =
"snd-soc-p1022ds",
409 static int __init p1022_ds_init(
void)
417 pr_err(
"snd-soc-p1022ds: missing/invalid global utils node\n");
418 of_node_put(guts_np);
421 guts_phys =
res.start;
422 of_node_put(guts_np);
432 static void __exit p1022_ds_exit(
void)