Lines Matching full:arizona
3 * arizona-spi.c -- Arizona SPI bus interface
23 #include <linux/mfd/arizona/core.h>
25 #include "arizona.h"
39 * not provide mappings for the GPIO-s coming from the Arizona codec itself.
42 { "arizona", 2, "wlf,spkvdd-ena", 0, GPIO_ACTIVE_HIGH },
43 { "arizona", 4, "wlf,micd-pol", 0, GPIO_ACTIVE_LOW },
52 static int arizona_spi_acpi_windows_probe(struct arizona *arizona) in arizona_spi_acpi_windows_probe() argument
59 devm_acpi_dev_add_driver_gpios(arizona->dev, arizona_acpi_gpios); in arizona_spi_acpi_windows_probe()
62 lookup = devm_kzalloc(arizona->dev, in arizona_spi_acpi_windows_probe()
68 lookup->dev_id = dev_name(arizona->dev); in arizona_spi_acpi_windows_probe()
72 ret = devm_add_action_or_reset(arizona->dev, arizona_spi_acpi_remove_lookup, lookup); in arizona_spi_acpi_windows_probe()
77 status = acpi_evaluate_object(ACPI_HANDLE(arizona->dev), "CLKE", NULL, NULL); in arizona_spi_acpi_windows_probe()
79 dev_warn(arizona->dev, "Failed to enable 32KHz clk ACPI error %d\n", status); in arizona_spi_acpi_windows_probe()
85 static int arizona_spi_acpi_android_probe(struct arizona *arizona) in arizona_spi_acpi_android_probe() argument
94 arizona->pdata.reset = devm_gpiod_get(arizona->dev, "reset", GPIOD_OUT_LOW); in arizona_spi_acpi_android_probe()
95 if (IS_ERR(arizona->pdata.reset)) { in arizona_spi_acpi_android_probe()
96 ret = PTR_ERR(arizona->pdata.reset); in arizona_spi_acpi_android_probe()
98 dev_info_once(arizona->dev, in arizona_spi_acpi_android_probe()
102 return dev_err_probe(arizona->dev, ret, "getting reset GPIO\n"); in arizona_spi_acpi_android_probe()
118 * value from extcon-arizona.c:arizona_micd_levels halfway 2 button resistances.
127 static int arizona_spi_acpi_probe(struct arizona *arizona) in arizona_spi_acpi_probe() argument
129 struct acpi_device *adev = ACPI_COMPANION(arizona->dev); in arizona_spi_acpi_probe()
133 ret = arizona_spi_acpi_android_probe(arizona); in arizona_spi_acpi_probe()
135 ret = arizona_spi_acpi_windows_probe(arizona); in arizona_spi_acpi_probe()
153 arizona->pdata.irq_flags = IRQF_TRIGGER_LOW; in arizona_spi_acpi_probe()
156 arizona->pdata.micd_detect_debounce = 200; in arizona_spi_acpi_probe()
159 arizona->pdata.micd_ranges = arizona_micd_aosp_ranges; in arizona_spi_acpi_probe()
160 arizona->pdata.num_micd_ranges = ARRAY_SIZE(arizona_micd_aosp_ranges); in arizona_spi_acpi_probe()
163 arizona->pdata.hpdet_channel = ARIZONA_ACCDET_MODE_HPL; in arizona_spi_acpi_probe()
185 static int arizona_spi_acpi_probe(struct arizona *arizona) in arizona_spi_acpi_probe() argument
193 struct arizona *arizona; in arizona_spi_probe() local
225 arizona = devm_kzalloc(&spi->dev, sizeof(*arizona), GFP_KERNEL); in arizona_spi_probe()
226 if (arizona == NULL) in arizona_spi_probe()
229 arizona->regmap = devm_regmap_init_spi(spi, regmap_config); in arizona_spi_probe()
230 if (IS_ERR(arizona->regmap)) { in arizona_spi_probe()
231 ret = PTR_ERR(arizona->regmap); in arizona_spi_probe()
237 arizona->type = type; in arizona_spi_probe()
238 arizona->dev = &spi->dev; in arizona_spi_probe()
239 arizona->irq = spi->irq; in arizona_spi_probe()
242 ret = arizona_spi_acpi_probe(arizona); in arizona_spi_probe()
247 return arizona_dev_init(arizona); in arizona_spi_probe()
252 struct arizona *arizona = spi_get_drvdata(spi); in arizona_spi_remove() local
254 arizona_dev_exit(arizona); in arizona_spi_remove()
281 .name = "arizona",
294 MODULE_DESCRIPTION("Arizona SPI bus interface");