Lines Matching +full:sun4i +full:- +full:a10 +full:- +full:ts
3 * Copyright (c) 2016 Quentin Schulz <quentin.schulz@free-electrons.com>
18 #include <linux/mfd/sun4i-gpadc.h>
50 .name = "sun4i-a10-gpadc-iio",
59 .name = "sun5i-a13-gpadc-iio",
68 .name = "sun6i-a31-gpadc-iio",
84 .compatible = "allwinner,sun4i-a10-ts",
87 .compatible = "allwinner,sun5i-a13-ts",
90 .compatible = "allwinner,sun6i-a31-ts",
106 of_id = of_match_node(sun4i_gpadc_of_match, pdev->dev.of_node); in sun4i_gpadc_probe()
108 return -EINVAL; in sun4i_gpadc_probe()
110 switch ((long)of_id->data) { in sun4i_gpadc_probe()
124 return -EINVAL; in sun4i_gpadc_probe()
127 dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); in sun4i_gpadc_probe()
129 return -ENOMEM; in sun4i_gpadc_probe()
132 dev->base = devm_ioremap_resource(&pdev->dev, mem); in sun4i_gpadc_probe()
133 if (IS_ERR(dev->base)) in sun4i_gpadc_probe()
134 return PTR_ERR(dev->base); in sun4i_gpadc_probe()
136 dev->dev = &pdev->dev; in sun4i_gpadc_probe()
137 dev_set_drvdata(dev->dev, dev); in sun4i_gpadc_probe()
139 dev->regmap = devm_regmap_init_mmio(dev->dev, dev->base, in sun4i_gpadc_probe()
141 if (IS_ERR(dev->regmap)) { in sun4i_gpadc_probe()
142 ret = PTR_ERR(dev->regmap); in sun4i_gpadc_probe()
143 dev_err(&pdev->dev, "failed to init regmap: %d\n", ret); in sun4i_gpadc_probe()
148 regmap_write(dev->regmap, SUN4I_GPADC_INT_FIFOC, 0); in sun4i_gpadc_probe()
151 ret = devm_regmap_add_irq_chip(&pdev->dev, dev->regmap, irq, in sun4i_gpadc_probe()
154 &dev->regmap_irqc); in sun4i_gpadc_probe()
156 dev_err(&pdev->dev, "failed to add irq chip: %d\n", ret); in sun4i_gpadc_probe()
160 ret = devm_mfd_add_devices(dev->dev, 0, cells, size, NULL, 0, NULL); in sun4i_gpadc_probe()
162 dev_err(&pdev->dev, "failed to add MFD devices: %d\n", ret); in sun4i_gpadc_probe()
171 .name = "sun4i-gpadc",
180 MODULE_AUTHOR("Quentin Schulz <quentin.schulz@free-electrons.com>");