Lines Matching +full:sun4i +full:- +full:a10 +full:- +full:ts
1 // SPDX-License-Identifier: GPL-2.0-only
4 * Copyright (c) 2016 Quentin Schulz <quentin.schulz@free-electrons.com>
15 #include <linux/mfd/sun4i-gpadc.h>
46 .name = "sun4i-a10-gpadc-iio",
55 .name = "sun5i-a13-gpadc-iio",
64 .name = "sun6i-a31-gpadc-iio",
80 .compatible = "allwinner,sun4i-a10-ts",
83 .compatible = "allwinner,sun5i-a13-ts",
86 .compatible = "allwinner,sun6i-a31-ts",
101 of_id = of_match_node(sun4i_gpadc_of_match, pdev->dev.of_node); in sun4i_gpadc_probe()
103 return -EINVAL; in sun4i_gpadc_probe()
105 switch ((long)of_id->data) { in sun4i_gpadc_probe()
119 return -EINVAL; in sun4i_gpadc_probe()
122 dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); in sun4i_gpadc_probe()
124 return -ENOMEM; in sun4i_gpadc_probe()
126 dev->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); in sun4i_gpadc_probe()
127 if (IS_ERR(dev->base)) in sun4i_gpadc_probe()
128 return PTR_ERR(dev->base); in sun4i_gpadc_probe()
130 dev->dev = &pdev->dev; in sun4i_gpadc_probe()
131 dev_set_drvdata(dev->dev, dev); in sun4i_gpadc_probe()
133 dev->regmap = devm_regmap_init_mmio(dev->dev, dev->base, in sun4i_gpadc_probe()
135 if (IS_ERR(dev->regmap)) { in sun4i_gpadc_probe()
136 ret = PTR_ERR(dev->regmap); in sun4i_gpadc_probe()
137 dev_err(&pdev->dev, "failed to init regmap: %d\n", ret); in sun4i_gpadc_probe()
142 regmap_write(dev->regmap, SUN4I_GPADC_INT_FIFOC, 0); in sun4i_gpadc_probe()
145 ret = devm_regmap_add_irq_chip(&pdev->dev, dev->regmap, irq, in sun4i_gpadc_probe()
148 &dev->regmap_irqc); in sun4i_gpadc_probe()
150 dev_err(&pdev->dev, "failed to add irq chip: %d\n", ret); in sun4i_gpadc_probe()
154 ret = devm_mfd_add_devices(dev->dev, 0, cells, size, NULL, 0, NULL); in sun4i_gpadc_probe()
156 dev_err(&pdev->dev, "failed to add MFD devices: %d\n", ret); in sun4i_gpadc_probe()
165 .name = "sun4i-gpadc",
174 MODULE_AUTHOR("Quentin Schulz <quentin.schulz@free-electrons.com>");