25 #include <linux/kernel.h>
26 #include <linux/module.h>
29 #include <linux/slab.h>
42 static const struct resource t7l66xb_mmc_resources[] = {
55 #define SCR_REVID 0x08
57 #define SCR_DEV_CTL 0xe0
59 #define SCR_GPO_OC 0xf0
60 #define SCR_GPO_OS 0xf1
61 #define SCR_GPI_S 0xf2
64 #define SCR_DEV_CTL_USB BIT(0)
65 #define SCR_DEV_CTL_MMC BIT(1)
98 spin_unlock_irqrestore(&t7l66xb->
lock, flags);
101 t7l66xb_mmc_resources[0].
start & 0xfffe);
119 spin_unlock_irqrestore(&t7l66xb->
lock, flags);
146 .set_pwr = t7l66xb_mmc_pwr,
147 .set_clk_div = t7l66xb_mmc_clk_div,
150 static const struct resource t7l66xb_nand_resources[] = {
168 static struct mfd_cell t7l66xb_cells[] = {
171 .enable = t7l66xb_mmc_enable,
172 .disable = t7l66xb_mmc_disable,
173 .platform_data = &t7166xb_mmc_data,
174 .pdata_size =
sizeof(t7166xb_mmc_data),
176 .resources = t7l66xb_mmc_resources,
180 .num_resources =
ARRAY_SIZE(t7l66xb_nand_resources),
181 .resources = t7l66xb_nand_resources,
188 static void t7l66xb_irq(
unsigned int irq,
struct irq_desc *
desc)
205 struct t7l66xb *t7l66xb = irq_data_get_irq_chip_data(data);
213 spin_unlock_irqrestore(&t7l66xb->
lock, flags);
218 struct t7l66xb *t7l66xb = irq_data_get_irq_chip_data(data);
226 spin_unlock_irqrestore(&t7l66xb->
lock, flags);
229 static struct irq_chip t7l66xb_chip = {
231 .irq_ack = t7l66xb_irq_mask,
232 .irq_mask = t7l66xb_irq_mask,
233 .irq_unmask = t7l66xb_irq_unmask,
241 struct t7l66xb *t7l66xb = platform_get_drvdata(dev);
256 irq_set_chained_handler(t7l66xb->
irq, t7l66xb_irq);
261 struct t7l66xb *t7l66xb = platform_get_drvdata(dev);
266 irq_set_chained_handler(t7l66xb->
irq,
NULL);
283 struct t7l66xb *t7l66xb = platform_get_drvdata(dev);
295 struct t7l66xb *t7l66xb = platform_get_drvdata(dev);
299 if (pdata && pdata->
resume)
303 t7l66xb_mmc_resources[0].
start & 0xfffe);
308 #define t7l66xb_suspend NULL
309 #define t7l66xb_resume NULL
317 struct t7l66xb *t7l66xb;
328 t7l66xb = kzalloc(
sizeof *t7l66xb,
GFP_KERNEL);
334 platform_set_drvdata(dev, t7l66xb);
345 if (IS_ERR(t7l66xb->
clk32k)) {
346 ret = PTR_ERR(t7l66xb->
clk32k);
351 if (IS_ERR(t7l66xb->
clk48m)) {
352 ret = PTR_ERR(t7l66xb->
clk48m);
356 rscr = &t7l66xb->
rscr;
357 rscr->
name =
"t7l66xb-core";
364 goto err_request_scr;
374 if (pdata && pdata->
enable)
382 (
unsigned long)iomem->
start, t7l66xb->
irq);
384 t7l66xb_attach_irq(dev);
396 t7l66xb_detach_irq(dev);
413 struct t7l66xb *t7l66xb = platform_get_drvdata(dev);
421 t7l66xb_detach_irq(dev);
425 platform_set_drvdata(dev,
NULL);
439 .probe = t7l66xb_probe,
440 .remove = t7l66xb_remove,