• Home
  • Raw
  • Download

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>
47 .name = "sun4i-a10-gpadc-iio",
56 .name = "sun5i-a13-gpadc-iio",
65 .name = "sun6i-a31-gpadc-iio",
81 .compatible = "allwinner,sun4i-a10-ts",
84 .compatible = "allwinner,sun5i-a13-ts",
87 .compatible = "allwinner,sun6i-a31-ts",
103 of_id = of_match_node(sun4i_gpadc_of_match, pdev->dev.of_node); in sun4i_gpadc_probe()
105 return -EINVAL; in sun4i_gpadc_probe()
107 switch ((long)of_id->data) { in sun4i_gpadc_probe()
121 return -EINVAL; in sun4i_gpadc_probe()
124 dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); in sun4i_gpadc_probe()
126 return -ENOMEM; in sun4i_gpadc_probe()
129 dev->base = devm_ioremap_resource(&pdev->dev, mem); in sun4i_gpadc_probe()
130 if (IS_ERR(dev->base)) in sun4i_gpadc_probe()
131 return PTR_ERR(dev->base); in sun4i_gpadc_probe()
133 dev->dev = &pdev->dev; in sun4i_gpadc_probe()
134 dev_set_drvdata(dev->dev, dev); in sun4i_gpadc_probe()
136 dev->regmap = devm_regmap_init_mmio(dev->dev, dev->base, in sun4i_gpadc_probe()
138 if (IS_ERR(dev->regmap)) { in sun4i_gpadc_probe()
139 ret = PTR_ERR(dev->regmap); in sun4i_gpadc_probe()
140 dev_err(&pdev->dev, "failed to init regmap: %d\n", ret); in sun4i_gpadc_probe()
145 regmap_write(dev->regmap, SUN4I_GPADC_INT_FIFOC, 0); in sun4i_gpadc_probe()
148 ret = devm_regmap_add_irq_chip(&pdev->dev, dev->regmap, irq, in sun4i_gpadc_probe()
151 &dev->regmap_irqc); in sun4i_gpadc_probe()
153 dev_err(&pdev->dev, "failed to add irq chip: %d\n", ret); in sun4i_gpadc_probe()
157 ret = devm_mfd_add_devices(dev->dev, 0, cells, size, NULL, 0, NULL); in sun4i_gpadc_probe()
159 dev_err(&pdev->dev, "failed to add MFD devices: %d\n", ret); in sun4i_gpadc_probe()
168 .name = "sun4i-gpadc",
177 MODULE_AUTHOR("Quentin Schulz <quentin.schulz@free-electrons.com>");