Lines Matching full:ssp
3 * linux/arch/arm/mach-pxa/ssp.c
5 * based on linux/arch/arm/mach-sa1100/ssp.c by Russell King
10 * PXA2xx SSP driver. This provides the generic core for simple
11 * IO-based SSP applications and allows easy port setup for DMA access.
40 struct ssp_device *ssp = NULL; in pxa_ssp_request() local
44 list_for_each_entry(ssp, &ssp_list, node) { in pxa_ssp_request()
45 if (ssp->port_id == port && ssp->use_count == 0) { in pxa_ssp_request()
46 ssp->use_count++; in pxa_ssp_request()
47 ssp->label = label; in pxa_ssp_request()
54 if (&ssp->node == &ssp_list) in pxa_ssp_request()
57 return ssp; in pxa_ssp_request()
64 struct ssp_device *ssp = NULL; in pxa_ssp_request_of() local
68 list_for_each_entry(ssp, &ssp_list, node) { in pxa_ssp_request_of()
69 if (ssp->of_node == of_node && ssp->use_count == 0) { in pxa_ssp_request_of()
70 ssp->use_count++; in pxa_ssp_request_of()
71 ssp->label = label; in pxa_ssp_request_of()
78 if (&ssp->node == &ssp_list) in pxa_ssp_request_of()
81 return ssp; in pxa_ssp_request_of()
85 void pxa_ssp_free(struct ssp_device *ssp) in pxa_ssp_free() argument
88 if (ssp->use_count) { in pxa_ssp_free()
89 ssp->use_count--; in pxa_ssp_free()
90 ssp->label = NULL; in pxa_ssp_free()
92 dev_err(ssp->dev, "device already free\n"); in pxa_ssp_free()
99 { .compatible = "mrvl,pxa25x-ssp", .data = (void *) PXA25x_SSP },
101 { .compatible = "mrvl,pxa27x-ssp", .data = (void *) PXA27x_SSP },
102 { .compatible = "mrvl,pxa3xx-ssp", .data = (void *) PXA3xx_SSP },
103 { .compatible = "mvrl,pxa168-ssp", .data = (void *) PXA168_SSP },
104 { .compatible = "mrvl,pxa910-ssp", .data = (void *) PXA910_SSP },
105 { .compatible = "mrvl,ce4100-ssp", .data = (void *) CE4100_SSP },
114 struct ssp_device *ssp; in pxa_ssp_probe() local
117 ssp = devm_kzalloc(dev, sizeof(struct ssp_device), GFP_KERNEL); in pxa_ssp_probe()
118 if (ssp == NULL) in pxa_ssp_probe()
121 ssp->dev = dev; in pxa_ssp_probe()
123 ssp->clk = devm_clk_get(dev, NULL); in pxa_ssp_probe()
124 if (IS_ERR(ssp->clk)) in pxa_ssp_probe()
125 return PTR_ERR(ssp->clk); in pxa_ssp_probe()
140 ssp->phys_base = res->start; in pxa_ssp_probe()
142 ssp->mmio_base = devm_ioremap(dev, res->start, resource_size(res)); in pxa_ssp_probe()
143 if (ssp->mmio_base == NULL) { in pxa_ssp_probe()
148 ssp->irq = platform_get_irq(pdev, 0); in pxa_ssp_probe()
149 if (ssp->irq < 0) in pxa_ssp_probe()
155 ssp->type = (uintptr_t) id->data; in pxa_ssp_probe()
159 ssp->type = id->driver_data; in pxa_ssp_probe()
161 /* PXA2xx/3xx SSP ports starts from 1 and the internal pdev->id in pxa_ssp_probe()
164 ssp->port_id = pdev->id + 1; in pxa_ssp_probe()
167 ssp->use_count = 0; in pxa_ssp_probe()
168 ssp->of_node = dev->of_node; in pxa_ssp_probe()
171 list_add(&ssp->node, &ssp_list); in pxa_ssp_probe()
174 platform_set_drvdata(pdev, ssp); in pxa_ssp_probe()
181 struct ssp_device *ssp = platform_get_drvdata(pdev); in pxa_ssp_remove() local
184 list_del(&ssp->node); in pxa_ssp_remove()
189 { "pxa25x-ssp", PXA25x_SSP },
191 { "pxa27x-ssp", PXA27x_SSP },
192 { "pxa3xx-ssp", PXA3xx_SSP },
193 { "pxa168-ssp", PXA168_SSP },
194 { "pxa910-ssp", PXA910_SSP },
202 .name = "pxa2xx-ssp",
221 MODULE_DESCRIPTION("PXA SSP driver");