cpcap 61 drivers/mfd/motorola-cpcap.c static int cpcap_check_revision(struct cpcap_ddata *cpcap) cpcap 66 drivers/mfd/motorola-cpcap.c ret = cpcap_get_vendor(&cpcap->spi->dev, cpcap->regmap, &vendor); cpcap 70 drivers/mfd/motorola-cpcap.c ret = cpcap_get_revision(&cpcap->spi->dev, cpcap->regmap, &rev); cpcap 74 drivers/mfd/motorola-cpcap.c dev_info(&cpcap->spi->dev, "CPCAP vendor: %s rev: %i.%i (%x)\n", cpcap 80 drivers/mfd/motorola-cpcap.c dev_info(&cpcap->spi->dev, cpcap 122 drivers/mfd/motorola-cpcap.c static void cpcap_init_one_regmap_irq(struct cpcap_ddata *cpcap, cpcap 130 drivers/mfd/motorola-cpcap.c reg_offset /= cpcap->regmap_conf->val_bits; cpcap 131 drivers/mfd/motorola-cpcap.c reg_offset *= cpcap->regmap_conf->reg_stride; cpcap 133 drivers/mfd/motorola-cpcap.c bit = irq % cpcap->regmap_conf->val_bits; cpcap 140 drivers/mfd/motorola-cpcap.c static int cpcap_init_irq_chip(struct cpcap_ddata *cpcap, int irq_chip, cpcap 147 drivers/mfd/motorola-cpcap.c struct regmap_irq *rirq = &cpcap->irqs[i]; cpcap 149 drivers/mfd/motorola-cpcap.c cpcap_init_one_regmap_irq(cpcap, rirq, irq_start, i); cpcap 151 drivers/mfd/motorola-cpcap.c chip->irqs = &cpcap->irqs[irq_start]; cpcap 153 drivers/mfd/motorola-cpcap.c chip->irq_drv_data = cpcap; cpcap 155 drivers/mfd/motorola-cpcap.c ret = devm_regmap_add_irq_chip(&cpcap->spi->dev, cpcap->regmap, cpcap 156 drivers/mfd/motorola-cpcap.c cpcap->spi->irq, cpcap 157 drivers/mfd/motorola-cpcap.c irq_get_trigger_type(cpcap->spi->irq) | cpcap 159 drivers/mfd/motorola-cpcap.c chip, &cpcap->irqdata[irq_chip]); cpcap 161 drivers/mfd/motorola-cpcap.c dev_err(&cpcap->spi->dev, "could not add irq chip %i: %i\n", cpcap 169 drivers/mfd/motorola-cpcap.c static int cpcap_init_irq(struct cpcap_ddata *cpcap) cpcap 173 drivers/mfd/motorola-cpcap.c cpcap->irqs = devm_kzalloc(&cpcap->spi->dev, cpcap 174 drivers/mfd/motorola-cpcap.c array3_size(sizeof(*cpcap->irqs), cpcap 176 drivers/mfd/motorola-cpcap.c cpcap->regmap_conf->val_bits), cpcap 178 drivers/mfd/motorola-cpcap.c if (!cpcap->irqs) cpcap 181 drivers/mfd/motorola-cpcap.c ret = cpcap_init_irq_chip(cpcap, 0, 0, 16); cpcap 185 drivers/mfd/motorola-cpcap.c ret = cpcap_init_irq_chip(cpcap, 1, 16, 16); cpcap 189 drivers/mfd/motorola-cpcap.c ret = cpcap_init_irq_chip(cpcap, 2, 32, 64); cpcap 193 drivers/mfd/motorola-cpcap.c enable_irq_wake(cpcap->spi->irq); cpcap 267 drivers/mfd/motorola-cpcap.c struct cpcap_ddata *cpcap; cpcap 274 drivers/mfd/motorola-cpcap.c cpcap = devm_kzalloc(&spi->dev, sizeof(*cpcap), GFP_KERNEL); cpcap 275 drivers/mfd/motorola-cpcap.c if (!cpcap) cpcap 278 drivers/mfd/motorola-cpcap.c cpcap->spi = spi; cpcap 279 drivers/mfd/motorola-cpcap.c spi_set_drvdata(spi, cpcap); cpcap 288 drivers/mfd/motorola-cpcap.c cpcap->regmap_conf = &cpcap_regmap_config; cpcap 289 drivers/mfd/motorola-cpcap.c cpcap->regmap = devm_regmap_init_spi(spi, &cpcap_regmap_config); cpcap 290 drivers/mfd/motorola-cpcap.c if (IS_ERR(cpcap->regmap)) { cpcap 291 drivers/mfd/motorola-cpcap.c ret = PTR_ERR(cpcap->regmap); cpcap 292 drivers/mfd/motorola-cpcap.c dev_err(&cpcap->spi->dev, "Failed to initialize regmap: %d\n", cpcap 298 drivers/mfd/motorola-cpcap.c ret = cpcap_check_revision(cpcap); cpcap 300 drivers/mfd/motorola-cpcap.c dev_err(&cpcap->spi->dev, "Failed to detect CPCAP: %i\n", ret); cpcap 304 drivers/mfd/motorola-cpcap.c ret = cpcap_init_irq(cpcap); cpcap 51 drivers/rtc/rtc-cpcap.c static void cpcap2rtc_time(struct rtc_time *rtc, struct cpcap_time *cpcap) cpcap 56 drivers/rtc/rtc-cpcap.c tod = (cpcap->tod1 & TOD1_MASK) | ((cpcap->tod2 & TOD2_MASK) << 8); cpcap 57 drivers/rtc/rtc-cpcap.c time = tod + ((cpcap->day & DAY_MASK) * SECS_PER_DAY); cpcap 62 drivers/rtc/rtc-cpcap.c static void rtc2cpcap_time(struct cpcap_time *cpcap, struct rtc_time *rtc) cpcap 68 drivers/rtc/rtc-cpcap.c cpcap->day = time / SECS_PER_DAY; cpcap 70 drivers/rtc/rtc-cpcap.c cpcap->tod2 = (time >> 8) & TOD2_MASK; cpcap 71 drivers/rtc/rtc-cpcap.c cpcap->tod1 = time & TOD1_MASK; cpcap 260 sound/soc/codecs/cpcap.c struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); cpcap 264 sound/soc/codecs/cpcap.c if (cpcap->vendor != CPCAP_VENDOR_ST) cpcap 269 sound/soc/codecs/cpcap.c err = regmap_write(cpcap->regmap, CPCAP_REG_TEST, cpcap 273 sound/soc/codecs/cpcap.c err = regmap_write(cpcap->regmap, CPCAP_REG_ST_TEST1, cpcap 279 sound/soc/codecs/cpcap.c err = regmap_write(cpcap->regmap, CPCAP_REG_ST_TEST1, cpcap 283 sound/soc/codecs/cpcap.c err = regmap_write(cpcap->regmap, CPCAP_REG_TEST, cpcap 361 sound/soc/codecs/cpcap.c struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); cpcap 367 sound/soc/codecs/cpcap.c err = regmap_read(cpcap->regmap, CPCAP_REG_RXCOA, ®_voice); cpcap 370 sound/soc/codecs/cpcap.c err = regmap_read(cpcap->regmap, CPCAP_REG_RXSDOA, ®_hifi); cpcap 373 sound/soc/codecs/cpcap.c err = regmap_read(cpcap->regmap, CPCAP_REG_RXEPOA, ®_ext); cpcap 404 sound/soc/codecs/cpcap.c struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); cpcap 427 sound/soc/codecs/cpcap.c err = regmap_update_bits(cpcap->regmap, CPCAP_REG_RXCOA, cpcap 431 sound/soc/codecs/cpcap.c err = regmap_update_bits(cpcap->regmap, CPCAP_REG_RXSDOA, cpcap 435 sound/soc/codecs/cpcap.c err = regmap_update_bits(cpcap->regmap, CPCAP_REG_RXEPOA, cpcap 449 sound/soc/codecs/cpcap.c struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); cpcap 453 sound/soc/codecs/cpcap.c err = regmap_read(cpcap->regmap, CPCAP_REG_TXI, ®val); cpcap 488 sound/soc/codecs/cpcap.c struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); cpcap 519 sound/soc/codecs/cpcap.c err = regmap_update_bits(cpcap->regmap, CPCAP_REG_TXI, cpcap 533 sound/soc/codecs/cpcap.c struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); cpcap 537 sound/soc/codecs/cpcap.c err = regmap_read(cpcap->regmap, CPCAP_REG_TXI, ®val); cpcap 564 sound/soc/codecs/cpcap.c struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); cpcap 587 sound/soc/codecs/cpcap.c err = regmap_update_bits(cpcap->regmap, CPCAP_REG_TXI, cpcap 949 sound/soc/codecs/cpcap.c static int cpcap_set_sysclk(struct cpcap_audio *cpcap, enum cpcap_dai dai, cpcap 972 sound/soc/codecs/cpcap.c dev_err(cpcap->component->dev, "invalid DAI: %d", dai); cpcap 978 sound/soc/codecs/cpcap.c dev_err(cpcap->component->dev, "invalid clk id %d", clk_id); cpcap 981 sound/soc/codecs/cpcap.c err = regmap_update_bits(cpcap->regmap, clkidreg, BIT(clkidshift), cpcap 990 sound/soc/codecs/cpcap.c err = regmap_update_bits(cpcap->regmap, CPCAP_REG_CDI, cpcap 1018 sound/soc/codecs/cpcap.c dev_err(cpcap->component->dev, "unsupported freq %u", freq); cpcap 1022 sound/soc/codecs/cpcap.c err = regmap_update_bits(cpcap->regmap, clkfreqreg, cpcap 1028 sound/soc/codecs/cpcap.c cpcap->codec_clk_id = clk_id; cpcap 1029 sound/soc/codecs/cpcap.c cpcap->codec_freq = freq; cpcap 1035 sound/soc/codecs/cpcap.c static int cpcap_set_samprate(struct cpcap_audio *cpcap, enum cpcap_dai dai, cpcap 1038 sound/soc/codecs/cpcap.c struct snd_soc_component *component = cpcap->component; cpcap 1093 sound/soc/codecs/cpcap.c err = regmap_update_bits(cpcap->regmap, sampreg, cpcap 1101 sound/soc/codecs/cpcap.c err = regmap_read(cpcap->regmap, sampreg, &sampreadval); cpcap 1119 sound/soc/codecs/cpcap.c struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); cpcap 1123 sound/soc/codecs/cpcap.c return cpcap_set_samprate(cpcap, CPCAP_DAI_HIFI, rate); cpcap 1130 sound/soc/codecs/cpcap.c struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); cpcap 1134 sound/soc/codecs/cpcap.c return cpcap_set_sysclk(cpcap, CPCAP_DAI_HIFI, clk_id, freq); cpcap 1141 sound/soc/codecs/cpcap.c struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); cpcap 1216 sound/soc/codecs/cpcap.c return regmap_update_bits(cpcap->regmap, reg, mask, val); cpcap 1222 sound/soc/codecs/cpcap.c struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); cpcap 1233 sound/soc/codecs/cpcap.c return regmap_update_bits(cpcap->regmap, reg, mask, val); cpcap 1249 sound/soc/codecs/cpcap.c struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); cpcap 1260 sound/soc/codecs/cpcap.c err = cpcap_set_samprate(cpcap, CPCAP_DAI_VOICE, rate); cpcap 1275 sound/soc/codecs/cpcap.c err = regmap_update_bits(cpcap->regmap, reg_cdi, mask, val); cpcap 1287 sound/soc/codecs/cpcap.c struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); cpcap 1291 sound/soc/codecs/cpcap.c return cpcap_set_sysclk(cpcap, CPCAP_DAI_VOICE, clk_id, freq); cpcap 1298 sound/soc/codecs/cpcap.c struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); cpcap 1365 sound/soc/codecs/cpcap.c err = regmap_update_bits(cpcap->regmap, CPCAP_REG_CDI, mask, val); cpcap 1369 sound/soc/codecs/cpcap.c cpcap->codec_format = val; cpcap 1376 sound/soc/codecs/cpcap.c struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); cpcap 1387 sound/soc/codecs/cpcap.c return regmap_update_bits(cpcap->regmap, reg, mask, val); cpcap 1431 sound/soc/codecs/cpcap.c static int cpcap_dai_mux(struct cpcap_audio *cpcap, bool swap_dai_configuration) cpcap 1450 sound/soc/codecs/cpcap.c err = regmap_update_bits(cpcap->regmap, CPCAP_REG_CDI, cpcap 1455 sound/soc/codecs/cpcap.c err = regmap_update_bits(cpcap->regmap, CPCAP_REG_SDACDI, cpcap 1466 sound/soc/codecs/cpcap.c struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); cpcap 1472 sound/soc/codecs/cpcap.c err = regmap_update_bits(cpcap->regmap, cpcap 1481 sound/soc/codecs/cpcap.c err = cpcap_dai_mux(cpcap, swap_dai_configuration); cpcap 1485 sound/soc/codecs/cpcap.c err = cpcap_set_sysclk(cpcap, CPCAP_DAI_HIFI, 0, 26000000); cpcap 1488 sound/soc/codecs/cpcap.c err = cpcap_set_sysclk(cpcap, CPCAP_DAI_VOICE, 0, 26000000); cpcap 1492 sound/soc/codecs/cpcap.c err = cpcap_set_samprate(cpcap, CPCAP_DAI_HIFI, 48000); cpcap 1496 sound/soc/codecs/cpcap.c err = cpcap_set_samprate(cpcap, CPCAP_DAI_VOICE, 48000); cpcap 1505 sound/soc/codecs/cpcap.c struct cpcap_audio *cpcap; cpcap 1508 sound/soc/codecs/cpcap.c cpcap = devm_kzalloc(component->dev, sizeof(*cpcap), GFP_KERNEL); cpcap 1509 sound/soc/codecs/cpcap.c if (!cpcap) cpcap 1511 sound/soc/codecs/cpcap.c snd_soc_component_set_drvdata(component, cpcap); cpcap 1512 sound/soc/codecs/cpcap.c cpcap->component = component; cpcap 1514 sound/soc/codecs/cpcap.c cpcap->regmap = dev_get_regmap(component->dev->parent, NULL); cpcap 1515 sound/soc/codecs/cpcap.c if (!cpcap->regmap) cpcap 1517 sound/soc/codecs/cpcap.c snd_soc_component_init_regmap(component, cpcap->regmap); cpcap 1519 sound/soc/codecs/cpcap.c err = cpcap_get_vendor(component->dev, cpcap->regmap, &cpcap->vendor);