diff for duplicates of <20160808115620.GM5243@dell> diff --git a/a/1.txt b/N1/1.txt index 8b62069..afe22bd 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -3,31 +3,30 @@ On Fri, 08 Jul 2016, Chen-Yu Tsai wrote: > The AC100 is a multifunction device with an audio codec subsystem and > an RTC subsystem. These two subsystems share a common register space > and host interface. ->=20 +> > Signed-off-by: Chen-Yu Tsai <wens@csie.org> > Acked-by: Lee Jones <lee.jones@linaro.org> > --- > Changes since v4: ->=20 +> > - None. ->=20 +> > Changes since v3: ->=20 +> > - Changed register name prefix to CLKOUT_ for clock output controls ->=20 +> > Changes since v2: ->=20 +> > - Dropped file name > - Added copyright line. > - Changed MODULE_LICENSE to GPL v2, matching the header > - Added Lee's ack ->=20 +> > --- > drivers/mfd/Kconfig | 10 +++ > drivers/mfd/Makefile | 2 + > drivers/mfd/ac100.c | 137 +++++++++++++++++++++++++++++++++++ -> include/linux/mfd/ac100.h | 178 ++++++++++++++++++++++++++++++++++++++++= -++++++ +> include/linux/mfd/ac100.h | 178 ++++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 327 insertions(+) > create mode 100644 drivers/mfd/ac100.c > create mode 100644 include/linux/mfd/ac100.h @@ -41,7 +40,7 @@ Applied, thanks. > @@ -112,6 +112,16 @@ config MFD_BCM590XX > help > Support for the BCM590xx PMUs from Broadcom -> =20 +> > +config MFD_AC100 > + tristate "X-Powers AC100" > + select MFD_CORE @@ -59,15 +58,15 @@ Applied, thanks. > index 2ba3ba35f745..bca83dbb5ed8 100644 > --- a/drivers/mfd/Makefile > +++ b/drivers/mfd/Makefile -> @@ -113,6 +113,8 @@ obj-$(CONFIG_PMIC_DA9052) +=3D da9052-irq.o -> obj-$(CONFIG_PMIC_DA9052) +=3D da9052-core.o -> obj-$(CONFIG_MFD_DA9052_SPI) +=3D da9052-spi.o -> obj-$(CONFIG_MFD_DA9052_I2C) +=3D da9052-i2c.o -> + -> +obj-$(CONFIG_MFD_AC100) +=3D ac100.o -> obj-$(CONFIG_MFD_AXP20X) +=3D axp20x.o -> obj-$(CONFIG_MFD_AXP20X_I2C) +=3D axp20x-i2c.o -> obj-$(CONFIG_MFD_AXP20X_RSB) +=3D axp20x-rsb.o +> @@ -113,6 +113,8 @@ obj-$(CONFIG_PMIC_DA9052) += da9052-irq.o +> obj-$(CONFIG_PMIC_DA9052) += da9052-core.o +> obj-$(CONFIG_MFD_DA9052_SPI) += da9052-spi.o +> obj-$(CONFIG_MFD_DA9052_I2C) += da9052-i2c.o +> + +> +obj-$(CONFIG_MFD_AC100) += ac100.o +> obj-$(CONFIG_MFD_AXP20X) += axp20x.o +> obj-$(CONFIG_MFD_AXP20X_I2C) += axp20x-i2c.o +> obj-$(CONFIG_MFD_AXP20X_RSB) += axp20x-rsb.o > diff --git a/drivers/mfd/ac100.c b/drivers/mfd/ac100.c > new file mode 100644 > index 000000000000..9bc69cd7807d @@ -77,16 +76,12 @@ Applied, thanks. > +/* > + * MFD core driver for X-Powers' AC100 Audio Codec IC > + * -> + * The AC100 is a highly integrated audio codec and RTC subsystem design= -ed -> + * for mobile applications. It has 3 I2S/PCM interfaces, a 2 channel DAC= -, -> + * a 2 channel ADC with 5 inputs and a builtin mixer. The RTC subsystem = -has +> + * The AC100 is a highly integrated audio codec and RTC subsystem designed +> + * for mobile applications. It has 3 I2S/PCM interfaces, a 2 channel DAC, +> + * a 2 channel ADC with 5 inputs and a builtin mixer. The RTC subsystem has > + * 3 clock outputs. > + * -> + * The audio codec and RTC parts are completely separate, sharing only t= -he +> + * The audio codec and RTC parts are completely separate, sharing only the > + * host interface for access to its registers. > + * > + * Copyright (2016) Chen-Yu Tsai @@ -107,7 +102,7 @@ he > +#include <linux/regmap.h> > +#include <linux/sunxi-rsb.h> > + -> +static const struct regmap_range ac100_writeable_ranges[] =3D { +> +static const struct regmap_range ac100_writeable_ranges[] = { > + regmap_reg_range(AC100_CHIP_AUDIO_RST, AC100_I2S_SR_CTRL), > + regmap_reg_range(AC100_I2S1_CLK_CTRL, AC100_I2S1_MXR_GAIN), > + regmap_reg_range(AC100_I2S2_CLK_CTRL, AC100_I2S2_MXR_GAIN), @@ -127,7 +122,7 @@ he > + regmap_reg_range(AC100_ALM_SEC, AC100_RTC_GP(15)), > +}; > + -> +static const struct regmap_range ac100_volatile_ranges[] =3D { +> +static const struct regmap_range ac100_volatile_ranges[] = { > + regmap_reg_range(AC100_CHIP_AUDIO_RST, AC100_PLL_CTRL2), > + regmap_reg_range(AC100_HMIC_STATUS, AC100_HMIC_STATUS), > + regmap_reg_range(AC100_ADC_DAP_L_STA, AC100_ADC_DAP_L_STA), @@ -139,32 +134,32 @@ he > + regmap_reg_range(AC100_ALM_SEC, AC100_ALM_UPD), > +}; > + -> +static const struct regmap_access_table ac100_writeable_table =3D { -> + .yes_ranges =3D ac100_writeable_ranges, -> + .n_yes_ranges =3D ARRAY_SIZE(ac100_writeable_ranges), +> +static const struct regmap_access_table ac100_writeable_table = { +> + .yes_ranges = ac100_writeable_ranges, +> + .n_yes_ranges = ARRAY_SIZE(ac100_writeable_ranges), > +}; > + -> +static const struct regmap_access_table ac100_volatile_table =3D { -> + .yes_ranges =3D ac100_volatile_ranges, -> + .n_yes_ranges =3D ARRAY_SIZE(ac100_volatile_ranges), +> +static const struct regmap_access_table ac100_volatile_table = { +> + .yes_ranges = ac100_volatile_ranges, +> + .n_yes_ranges = ARRAY_SIZE(ac100_volatile_ranges), > +}; > + -> +static const struct regmap_config ac100_regmap_config =3D { -> + .reg_bits =3D 8, -> + .val_bits =3D 16, -> + .wr_table =3D &ac100_writeable_table, -> + .volatile_table =3D &ac100_volatile_table, -> + .max_register =3D AC100_RTC_GP(15), -> + .cache_type =3D REGCACHE_RBTREE, +> +static const struct regmap_config ac100_regmap_config = { +> + .reg_bits = 8, +> + .val_bits = 16, +> + .wr_table = &ac100_writeable_table, +> + .volatile_table = &ac100_volatile_table, +> + .max_register = AC100_RTC_GP(15), +> + .cache_type = REGCACHE_RBTREE, > +}; > + -> +static struct mfd_cell ac100_cells[] =3D { +> +static struct mfd_cell ac100_cells[] = { > + { -> + .name =3D "ac100-codec", -> + .of_compatible =3D "x-powers,ac100-codec", +> + .name = "ac100-codec", +> + .of_compatible = "x-powers,ac100-codec", > + }, { -> + .name =3D "ac100-rtc", -> + .of_compatible =3D "x-powers,ac100-rtc", +> + .name = "ac100-rtc", +> + .of_compatible = "x-powers,ac100-rtc", > + }, > +}; > + @@ -173,23 +168,21 @@ he > + struct ac100_dev *ac100; > + int ret; > + -> + ac100 =3D devm_kzalloc(&rdev->dev, sizeof(*ac100), GFP_KERNEL); +> + ac100 = devm_kzalloc(&rdev->dev, sizeof(*ac100), GFP_KERNEL); > + if (!ac100) > + return -ENOMEM; > + -> + ac100->dev =3D &rdev->dev; +> + ac100->dev = &rdev->dev; > + sunxi_rsb_device_set_drvdata(rdev, ac100); > + -> + ac100->regmap =3D devm_regmap_init_sunxi_rsb(rdev, &ac100_regmap_config= -); +> + ac100->regmap = devm_regmap_init_sunxi_rsb(rdev, &ac100_regmap_config); > + if (IS_ERR(ac100->regmap)) { -> + ret =3D PTR_ERR(ac100->regmap); +> + ret = PTR_ERR(ac100->regmap); > + dev_err(ac100->dev, "regmap init failed: %d\n", ret); > + return ret; > + } > + -> + ret =3D devm_mfd_add_devices(ac100->dev, PLATFORM_DEVID_NONE, ac100_cel= -ls, +> + ret = devm_mfd_add_devices(ac100->dev, PLATFORM_DEVID_NONE, ac100_cells, > + ARRAY_SIZE(ac100_cells), NULL, 0, NULL); > + if (ret) { > + dev_err(ac100->dev, "failed to add MFD devices: %d\n", ret); @@ -199,18 +192,18 @@ ls, > + return 0; > +} > + -> +static const struct of_device_id ac100_of_match[] =3D { -> + { .compatible =3D "x-powers,ac100" }, +> +static const struct of_device_id ac100_of_match[] = { +> + { .compatible = "x-powers,ac100" }, > + { }, > +}; > +MODULE_DEVICE_TABLE(of, ac100_of_match); > + -> +static struct sunxi_rsb_driver ac100_rsb_driver =3D { -> + .driver =3D { -> + .name =3D "ac100", -> + .of_match_table =3D of_match_ptr(ac100_of_match), +> +static struct sunxi_rsb_driver ac100_rsb_driver = { +> + .driver = { +> + .name = "ac100", +> + .of_match_table = of_match_ptr(ac100_of_match), > + }, -> + .probe =3D ac100_rsb_probe, +> + .probe = ac100_rsb_probe, > +}; > +module_sunxi_rsb_driver(ac100_rsb_driver); > + @@ -333,8 +326,7 @@ ls, > +#define AC100_ADC_DAP_L_HPF_C 0x94 /* Low High-Pass-Filter Coef */ > +#define AC100_ADC_DAP_OPT 0x95 /* AGC Optimum */ > + -> +/* DAC digital audio processing (high pass filter & dynamic range contro= -l) */ +> +/* DAC digital audio processing (high pass filter & dynamic range control) */ > +#define AC100_DAC_DAP_CTRL 0xa0 > +#define AC100_DAC_DAP_H_HPF_C 0xa1 /* High High-Pass-Filter Coef */ > +#define AC100_DAC_DAP_L_HPF_C 0xa2 /* Low High-Pass-Filter Coef */ @@ -403,20 +395,8 @@ l) */ > + > +#endif /* __LINUX_MFD_AC100_H */ ---=20 +-- Lee Jones Linaro STMicroelectronics Landing Team Lead -Linaro.org =E2=94=82 Open source software for ARM SoCs +Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog - ---=20 -You received this message because you are subscribed to "rtc-linux". -Membership options at http://groups.google.com/group/rtc-linux . -Please read http://groups.google.com/group/rtc-linux/web/checklist -before submitting a driver. ----=20 -You received this message because you are subscribed to the Google Groups "= -rtc-linux" group. -To unsubscribe from this group and stop receiving emails from it, send an e= -mail to rtc-linux+unsubscribe@googlegroups.com. -For more options, visit https://groups.google.com/d/optout. diff --git a/a/content_digest b/N1/content_digest index 3a7cf56..f7f2849 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,16 +1,9 @@ "ref\01467988422-17934-1-git-send-email-wens@csie.org\0" "ref\01467988422-17934-3-git-send-email-wens@csie.org\0" - "From\0Lee Jones <lee.jones@linaro.org>\0" - "Subject\0[rtc-linux] Re: [PATCH v5 2/7] mfd: ac100: Add driver for X-Powers AC100 audio codec / RTC combo IC\0" + "From\0lee.jones@linaro.org (Lee Jones)\0" + "Subject\0[PATCH v5 2/7] mfd: ac100: Add driver for X-Powers AC100 audio codec / RTC combo IC\0" "Date\0Mon, 8 Aug 2016 12:56:21 +0100\0" - "To\0Chen-Yu Tsai <wens@csie.org>\0" - "Cc\0Alessandro Zummo <a.zummo@towertech.it>" - Alexandre Belloni <alexandre.belloni@free-electrons.com> - Maxime Ripard <maxime.ripard@free-electrons.com> - linux-kernel@vger.kernel.org - rtc-linux@googlegroups.com - devicetree@vger.kernel.org - " linux-arm-kernel@lists.infradead.org\0" + "To\0linux-arm-kernel@lists.infradead.org\0" "\00:1\0" "b\0" "On Fri, 08 Jul 2016, Chen-Yu Tsai wrote:\n" @@ -18,31 +11,30 @@ "> The AC100 is a multifunction device with an audio codec subsystem and\n" "> an RTC subsystem. These two subsystems share a common register space\n" "> and host interface.\n" - ">=20\n" + "> \n" "> Signed-off-by: Chen-Yu Tsai <wens@csie.org>\n" "> Acked-by: Lee Jones <lee.jones@linaro.org>\n" "> ---\n" "> Changes since v4:\n" - ">=20\n" + "> \n" "> - None.\n" - ">=20\n" + "> \n" "> Changes since v3:\n" - ">=20\n" + "> \n" "> - Changed register name prefix to CLKOUT_ for clock output controls\n" - ">=20\n" + "> \n" "> Changes since v2:\n" - ">=20\n" + "> \n" "> - Dropped file name\n" "> - Added copyright line.\n" "> - Changed MODULE_LICENSE to GPL v2, matching the header\n" "> - Added Lee's ack\n" - ">=20\n" + "> \n" "> ---\n" "> drivers/mfd/Kconfig | 10 +++\n" "> drivers/mfd/Makefile | 2 +\n" "> drivers/mfd/ac100.c | 137 +++++++++++++++++++++++++++++++++++\n" - "> include/linux/mfd/ac100.h | 178 ++++++++++++++++++++++++++++++++++++++++=\n" - "++++++\n" + "> include/linux/mfd/ac100.h | 178 ++++++++++++++++++++++++++++++++++++++++++++++\n" "> 4 files changed, 327 insertions(+)\n" "> create mode 100644 drivers/mfd/ac100.c\n" "> create mode 100644 include/linux/mfd/ac100.h\n" @@ -56,7 +48,7 @@ "> @@ -112,6 +112,16 @@ config MFD_BCM590XX\n" "> \thelp\n" "> \t Support for the BCM590xx PMUs from Broadcom\n" - "> =20\n" + "> \n" "> +config MFD_AC100\n" "> +\ttristate \"X-Powers AC100\"\n" "> +\tselect MFD_CORE\n" @@ -74,15 +66,15 @@ "> index 2ba3ba35f745..bca83dbb5ed8 100644\n" "> --- a/drivers/mfd/Makefile\n" "> +++ b/drivers/mfd/Makefile\n" - "> @@ -113,6 +113,8 @@ obj-$(CONFIG_PMIC_DA9052)\t+=3D da9052-irq.o\n" - "> obj-$(CONFIG_PMIC_DA9052)\t+=3D da9052-core.o\n" - "> obj-$(CONFIG_MFD_DA9052_SPI)\t+=3D da9052-spi.o\n" - "> obj-$(CONFIG_MFD_DA9052_I2C)\t+=3D da9052-i2c.o\n" - "> +\n" - "> +obj-$(CONFIG_MFD_AC100)\t\t+=3D ac100.o\n" - "> obj-$(CONFIG_MFD_AXP20X)\t+=3D axp20x.o\n" - "> obj-$(CONFIG_MFD_AXP20X_I2C)\t+=3D axp20x-i2c.o\n" - "> obj-$(CONFIG_MFD_AXP20X_RSB)\t+=3D axp20x-rsb.o\n" + "> @@ -113,6 +113,8 @@ obj-$(CONFIG_PMIC_DA9052)\t+= da9052-irq.o\n" + "> obj-$(CONFIG_PMIC_DA9052)\t+= da9052-core.o\n" + "> obj-$(CONFIG_MFD_DA9052_SPI)\t+= da9052-spi.o\n" + "> obj-$(CONFIG_MFD_DA9052_I2C)\t+= da9052-i2c.o\n" + "> +\n" + "> +obj-$(CONFIG_MFD_AC100)\t\t+= ac100.o\n" + "> obj-$(CONFIG_MFD_AXP20X)\t+= axp20x.o\n" + "> obj-$(CONFIG_MFD_AXP20X_I2C)\t+= axp20x-i2c.o\n" + "> obj-$(CONFIG_MFD_AXP20X_RSB)\t+= axp20x-rsb.o\n" "> diff --git a/drivers/mfd/ac100.c b/drivers/mfd/ac100.c\n" "> new file mode 100644\n" "> index 000000000000..9bc69cd7807d\n" @@ -92,16 +84,12 @@ "> +/*\n" "> + * MFD core driver for X-Powers' AC100 Audio Codec IC\n" "> + *\n" - "> + * The AC100 is a highly integrated audio codec and RTC subsystem design=\n" - "ed\n" - "> + * for mobile applications. It has 3 I2S/PCM interfaces, a 2 channel DAC=\n" - ",\n" - "> + * a 2 channel ADC with 5 inputs and a builtin mixer. The RTC subsystem =\n" - "has\n" + "> + * The AC100 is a highly integrated audio codec and RTC subsystem designed\n" + "> + * for mobile applications. It has 3 I2S/PCM interfaces, a 2 channel DAC,\n" + "> + * a 2 channel ADC with 5 inputs and a builtin mixer. The RTC subsystem has\n" "> + * 3 clock outputs.\n" "> + *\n" - "> + * The audio codec and RTC parts are completely separate, sharing only t=\n" - "he\n" + "> + * The audio codec and RTC parts are completely separate, sharing only the\n" "> + * host interface for access to its registers.\n" "> + *\n" "> + * Copyright (2016) Chen-Yu Tsai\n" @@ -122,7 +110,7 @@ "> +#include <linux/regmap.h>\n" "> +#include <linux/sunxi-rsb.h>\n" "> +\n" - "> +static const struct regmap_range ac100_writeable_ranges[] =3D {\n" + "> +static const struct regmap_range ac100_writeable_ranges[] = {\n" "> +\tregmap_reg_range(AC100_CHIP_AUDIO_RST, AC100_I2S_SR_CTRL),\n" "> +\tregmap_reg_range(AC100_I2S1_CLK_CTRL, AC100_I2S1_MXR_GAIN),\n" "> +\tregmap_reg_range(AC100_I2S2_CLK_CTRL, AC100_I2S2_MXR_GAIN),\n" @@ -142,7 +130,7 @@ "> +\tregmap_reg_range(AC100_ALM_SEC, AC100_RTC_GP(15)),\n" "> +};\n" "> +\n" - "> +static const struct regmap_range ac100_volatile_ranges[] =3D {\n" + "> +static const struct regmap_range ac100_volatile_ranges[] = {\n" "> +\tregmap_reg_range(AC100_CHIP_AUDIO_RST, AC100_PLL_CTRL2),\n" "> +\tregmap_reg_range(AC100_HMIC_STATUS, AC100_HMIC_STATUS),\n" "> +\tregmap_reg_range(AC100_ADC_DAP_L_STA, AC100_ADC_DAP_L_STA),\n" @@ -154,32 +142,32 @@ "> +\tregmap_reg_range(AC100_ALM_SEC, AC100_ALM_UPD),\n" "> +};\n" "> +\n" - "> +static const struct regmap_access_table ac100_writeable_table =3D {\n" - "> +\t.yes_ranges\t=3D ac100_writeable_ranges,\n" - "> +\t.n_yes_ranges\t=3D ARRAY_SIZE(ac100_writeable_ranges),\n" + "> +static const struct regmap_access_table ac100_writeable_table = {\n" + "> +\t.yes_ranges\t= ac100_writeable_ranges,\n" + "> +\t.n_yes_ranges\t= ARRAY_SIZE(ac100_writeable_ranges),\n" "> +};\n" "> +\n" - "> +static const struct regmap_access_table ac100_volatile_table =3D {\n" - "> +\t.yes_ranges\t=3D ac100_volatile_ranges,\n" - "> +\t.n_yes_ranges\t=3D ARRAY_SIZE(ac100_volatile_ranges),\n" + "> +static const struct regmap_access_table ac100_volatile_table = {\n" + "> +\t.yes_ranges\t= ac100_volatile_ranges,\n" + "> +\t.n_yes_ranges\t= ARRAY_SIZE(ac100_volatile_ranges),\n" "> +};\n" "> +\n" - "> +static const struct regmap_config ac100_regmap_config =3D {\n" - "> +\t.reg_bits\t=3D 8,\n" - "> +\t.val_bits\t=3D 16,\n" - "> +\t.wr_table\t=3D &ac100_writeable_table,\n" - "> +\t.volatile_table\t=3D &ac100_volatile_table,\n" - "> +\t.max_register\t=3D AC100_RTC_GP(15),\n" - "> +\t.cache_type\t=3D REGCACHE_RBTREE,\n" + "> +static const struct regmap_config ac100_regmap_config = {\n" + "> +\t.reg_bits\t= 8,\n" + "> +\t.val_bits\t= 16,\n" + "> +\t.wr_table\t= &ac100_writeable_table,\n" + "> +\t.volatile_table\t= &ac100_volatile_table,\n" + "> +\t.max_register\t= AC100_RTC_GP(15),\n" + "> +\t.cache_type\t= REGCACHE_RBTREE,\n" "> +};\n" "> +\n" - "> +static struct mfd_cell ac100_cells[] =3D {\n" + "> +static struct mfd_cell ac100_cells[] = {\n" "> +\t{\n" - "> +\t\t.name\t\t=3D \"ac100-codec\",\n" - "> +\t\t.of_compatible\t=3D \"x-powers,ac100-codec\",\n" + "> +\t\t.name\t\t= \"ac100-codec\",\n" + "> +\t\t.of_compatible\t= \"x-powers,ac100-codec\",\n" "> +\t}, {\n" - "> +\t\t.name\t\t=3D \"ac100-rtc\",\n" - "> +\t\t.of_compatible\t=3D \"x-powers,ac100-rtc\",\n" + "> +\t\t.name\t\t= \"ac100-rtc\",\n" + "> +\t\t.of_compatible\t= \"x-powers,ac100-rtc\",\n" "> +\t},\n" "> +};\n" "> +\n" @@ -188,23 +176,21 @@ "> +\tstruct ac100_dev *ac100;\n" "> +\tint ret;\n" "> +\n" - "> +\tac100 =3D devm_kzalloc(&rdev->dev, sizeof(*ac100), GFP_KERNEL);\n" + "> +\tac100 = devm_kzalloc(&rdev->dev, sizeof(*ac100), GFP_KERNEL);\n" "> +\tif (!ac100)\n" "> +\t\treturn -ENOMEM;\n" "> +\n" - "> +\tac100->dev =3D &rdev->dev;\n" + "> +\tac100->dev = &rdev->dev;\n" "> +\tsunxi_rsb_device_set_drvdata(rdev, ac100);\n" "> +\n" - "> +\tac100->regmap =3D devm_regmap_init_sunxi_rsb(rdev, &ac100_regmap_config=\n" - ");\n" + "> +\tac100->regmap = devm_regmap_init_sunxi_rsb(rdev, &ac100_regmap_config);\n" "> +\tif (IS_ERR(ac100->regmap)) {\n" - "> +\t\tret =3D PTR_ERR(ac100->regmap);\n" + "> +\t\tret = PTR_ERR(ac100->regmap);\n" "> +\t\tdev_err(ac100->dev, \"regmap init failed: %d\\n\", ret);\n" "> +\t\treturn ret;\n" "> +\t}\n" "> +\n" - "> +\tret =3D devm_mfd_add_devices(ac100->dev, PLATFORM_DEVID_NONE, ac100_cel=\n" - "ls,\n" + "> +\tret = devm_mfd_add_devices(ac100->dev, PLATFORM_DEVID_NONE, ac100_cells,\n" "> +\t\t\t\t ARRAY_SIZE(ac100_cells), NULL, 0, NULL);\n" "> +\tif (ret) {\n" "> +\t\tdev_err(ac100->dev, \"failed to add MFD devices: %d\\n\", ret);\n" @@ -214,18 +200,18 @@ "> +\treturn 0;\n" "> +}\n" "> +\n" - "> +static const struct of_device_id ac100_of_match[] =3D {\n" - "> +\t{ .compatible =3D \"x-powers,ac100\" },\n" + "> +static const struct of_device_id ac100_of_match[] = {\n" + "> +\t{ .compatible = \"x-powers,ac100\" },\n" "> +\t{ },\n" "> +};\n" "> +MODULE_DEVICE_TABLE(of, ac100_of_match);\n" "> +\n" - "> +static struct sunxi_rsb_driver ac100_rsb_driver =3D {\n" - "> +\t.driver =3D {\n" - "> +\t\t.name\t=3D \"ac100\",\n" - "> +\t\t.of_match_table\t=3D of_match_ptr(ac100_of_match),\n" + "> +static struct sunxi_rsb_driver ac100_rsb_driver = {\n" + "> +\t.driver = {\n" + "> +\t\t.name\t= \"ac100\",\n" + "> +\t\t.of_match_table\t= of_match_ptr(ac100_of_match),\n" "> +\t},\n" - "> +\t.probe\t=3D ac100_rsb_probe,\n" + "> +\t.probe\t= ac100_rsb_probe,\n" "> +};\n" "> +module_sunxi_rsb_driver(ac100_rsb_driver);\n" "> +\n" @@ -348,8 +334,7 @@ "> +#define AC100_ADC_DAP_L_HPF_C\t\t0x94 /* Low High-Pass-Filter Coef */\n" "> +#define AC100_ADC_DAP_OPT\t\t0x95 /* AGC Optimum */\n" "> +\n" - "> +/* DAC digital audio processing (high pass filter & dynamic range contro=\n" - "l) */\n" + "> +/* DAC digital audio processing (high pass filter & dynamic range control) */\n" "> +#define AC100_DAC_DAP_CTRL\t\t0xa0\n" "> +#define AC100_DAC_DAP_H_HPF_C\t\t0xa1 /* High High-Pass-Filter Coef */\n" "> +#define AC100_DAC_DAP_L_HPF_C\t\t0xa2 /* Low High-Pass-Filter Coef */\n" @@ -418,22 +403,10 @@ "> +\n" "> +#endif /* __LINUX_MFD_AC100_H */\n" "\n" - "--=20\n" + "-- \n" "Lee Jones\n" "Linaro STMicroelectronics Landing Team Lead\n" - "Linaro.org =E2=94=82 Open source software for ARM SoCs\n" - "Follow Linaro: Facebook | Twitter | Blog\n" - "\n" - "--=20\n" - "You received this message because you are subscribed to \"rtc-linux\".\n" - "Membership options at http://groups.google.com/group/rtc-linux .\n" - "Please read http://groups.google.com/group/rtc-linux/web/checklist\n" - "before submitting a driver.\n" - "---=20\n" - "You received this message because you are subscribed to the Google Groups \"=\n" - "rtc-linux\" group.\n" - "To unsubscribe from this group and stop receiving emails from it, send an e=\n" - "mail to rtc-linux+unsubscribe@googlegroups.com.\n" - For more options, visit https://groups.google.com/d/optout. + "Linaro.org ? Open source software for ARM SoCs\n" + Follow Linaro: Facebook | Twitter | Blog -0f48a263961c44587883025f3ce895d6e8afcaafcd17e3fae20c698f8b4cd71b +308123e144648202b4be574f32864fb42fcf19897c1a5142595458975e250d3f
diff --git a/a/1.txt b/N2/1.txt index 8b62069..2cf1252 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -3,31 +3,30 @@ On Fri, 08 Jul 2016, Chen-Yu Tsai wrote: > The AC100 is a multifunction device with an audio codec subsystem and > an RTC subsystem. These two subsystems share a common register space > and host interface. ->=20 -> Signed-off-by: Chen-Yu Tsai <wens@csie.org> -> Acked-by: Lee Jones <lee.jones@linaro.org> +> +> Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org> +> Acked-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > --- > Changes since v4: ->=20 +> > - None. ->=20 +> > Changes since v3: ->=20 +> > - Changed register name prefix to CLKOUT_ for clock output controls ->=20 +> > Changes since v2: ->=20 +> > - Dropped file name > - Added copyright line. > - Changed MODULE_LICENSE to GPL v2, matching the header > - Added Lee's ack ->=20 +> > --- > drivers/mfd/Kconfig | 10 +++ > drivers/mfd/Makefile | 2 + > drivers/mfd/ac100.c | 137 +++++++++++++++++++++++++++++++++++ -> include/linux/mfd/ac100.h | 178 ++++++++++++++++++++++++++++++++++++++++= -++++++ +> include/linux/mfd/ac100.h | 178 ++++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 327 insertions(+) > create mode 100644 drivers/mfd/ac100.c > create mode 100644 include/linux/mfd/ac100.h @@ -41,7 +40,7 @@ Applied, thanks. > @@ -112,6 +112,16 @@ config MFD_BCM590XX > help > Support for the BCM590xx PMUs from Broadcom -> =20 +> > +config MFD_AC100 > + tristate "X-Powers AC100" > + select MFD_CORE @@ -59,15 +58,15 @@ Applied, thanks. > index 2ba3ba35f745..bca83dbb5ed8 100644 > --- a/drivers/mfd/Makefile > +++ b/drivers/mfd/Makefile -> @@ -113,6 +113,8 @@ obj-$(CONFIG_PMIC_DA9052) +=3D da9052-irq.o -> obj-$(CONFIG_PMIC_DA9052) +=3D da9052-core.o -> obj-$(CONFIG_MFD_DA9052_SPI) +=3D da9052-spi.o -> obj-$(CONFIG_MFD_DA9052_I2C) +=3D da9052-i2c.o -> + -> +obj-$(CONFIG_MFD_AC100) +=3D ac100.o -> obj-$(CONFIG_MFD_AXP20X) +=3D axp20x.o -> obj-$(CONFIG_MFD_AXP20X_I2C) +=3D axp20x-i2c.o -> obj-$(CONFIG_MFD_AXP20X_RSB) +=3D axp20x-rsb.o +> @@ -113,6 +113,8 @@ obj-$(CONFIG_PMIC_DA9052) += da9052-irq.o +> obj-$(CONFIG_PMIC_DA9052) += da9052-core.o +> obj-$(CONFIG_MFD_DA9052_SPI) += da9052-spi.o +> obj-$(CONFIG_MFD_DA9052_I2C) += da9052-i2c.o +> + +> +obj-$(CONFIG_MFD_AC100) += ac100.o +> obj-$(CONFIG_MFD_AXP20X) += axp20x.o +> obj-$(CONFIG_MFD_AXP20X_I2C) += axp20x-i2c.o +> obj-$(CONFIG_MFD_AXP20X_RSB) += axp20x-rsb.o > diff --git a/drivers/mfd/ac100.c b/drivers/mfd/ac100.c > new file mode 100644 > index 000000000000..9bc69cd7807d @@ -77,21 +76,17 @@ Applied, thanks. > +/* > + * MFD core driver for X-Powers' AC100 Audio Codec IC > + * -> + * The AC100 is a highly integrated audio codec and RTC subsystem design= -ed -> + * for mobile applications. It has 3 I2S/PCM interfaces, a 2 channel DAC= -, -> + * a 2 channel ADC with 5 inputs and a builtin mixer. The RTC subsystem = -has +> + * The AC100 is a highly integrated audio codec and RTC subsystem designed +> + * for mobile applications. It has 3 I2S/PCM interfaces, a 2 channel DAC, +> + * a 2 channel ADC with 5 inputs and a builtin mixer. The RTC subsystem has > + * 3 clock outputs. > + * -> + * The audio codec and RTC parts are completely separate, sharing only t= -he +> + * The audio codec and RTC parts are completely separate, sharing only the > + * host interface for access to its registers. > + * > + * Copyright (2016) Chen-Yu Tsai > + * -> + * Author: Chen-Yu Tsai <wens@csie.org> +> + * Author: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org> > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as @@ -107,7 +102,7 @@ he > +#include <linux/regmap.h> > +#include <linux/sunxi-rsb.h> > + -> +static const struct regmap_range ac100_writeable_ranges[] =3D { +> +static const struct regmap_range ac100_writeable_ranges[] = { > + regmap_reg_range(AC100_CHIP_AUDIO_RST, AC100_I2S_SR_CTRL), > + regmap_reg_range(AC100_I2S1_CLK_CTRL, AC100_I2S1_MXR_GAIN), > + regmap_reg_range(AC100_I2S2_CLK_CTRL, AC100_I2S2_MXR_GAIN), @@ -127,7 +122,7 @@ he > + regmap_reg_range(AC100_ALM_SEC, AC100_RTC_GP(15)), > +}; > + -> +static const struct regmap_range ac100_volatile_ranges[] =3D { +> +static const struct regmap_range ac100_volatile_ranges[] = { > + regmap_reg_range(AC100_CHIP_AUDIO_RST, AC100_PLL_CTRL2), > + regmap_reg_range(AC100_HMIC_STATUS, AC100_HMIC_STATUS), > + regmap_reg_range(AC100_ADC_DAP_L_STA, AC100_ADC_DAP_L_STA), @@ -139,32 +134,32 @@ he > + regmap_reg_range(AC100_ALM_SEC, AC100_ALM_UPD), > +}; > + -> +static const struct regmap_access_table ac100_writeable_table =3D { -> + .yes_ranges =3D ac100_writeable_ranges, -> + .n_yes_ranges =3D ARRAY_SIZE(ac100_writeable_ranges), +> +static const struct regmap_access_table ac100_writeable_table = { +> + .yes_ranges = ac100_writeable_ranges, +> + .n_yes_ranges = ARRAY_SIZE(ac100_writeable_ranges), > +}; > + -> +static const struct regmap_access_table ac100_volatile_table =3D { -> + .yes_ranges =3D ac100_volatile_ranges, -> + .n_yes_ranges =3D ARRAY_SIZE(ac100_volatile_ranges), +> +static const struct regmap_access_table ac100_volatile_table = { +> + .yes_ranges = ac100_volatile_ranges, +> + .n_yes_ranges = ARRAY_SIZE(ac100_volatile_ranges), > +}; > + -> +static const struct regmap_config ac100_regmap_config =3D { -> + .reg_bits =3D 8, -> + .val_bits =3D 16, -> + .wr_table =3D &ac100_writeable_table, -> + .volatile_table =3D &ac100_volatile_table, -> + .max_register =3D AC100_RTC_GP(15), -> + .cache_type =3D REGCACHE_RBTREE, +> +static const struct regmap_config ac100_regmap_config = { +> + .reg_bits = 8, +> + .val_bits = 16, +> + .wr_table = &ac100_writeable_table, +> + .volatile_table = &ac100_volatile_table, +> + .max_register = AC100_RTC_GP(15), +> + .cache_type = REGCACHE_RBTREE, > +}; > + -> +static struct mfd_cell ac100_cells[] =3D { +> +static struct mfd_cell ac100_cells[] = { > + { -> + .name =3D "ac100-codec", -> + .of_compatible =3D "x-powers,ac100-codec", +> + .name = "ac100-codec", +> + .of_compatible = "x-powers,ac100-codec", > + }, { -> + .name =3D "ac100-rtc", -> + .of_compatible =3D "x-powers,ac100-rtc", +> + .name = "ac100-rtc", +> + .of_compatible = "x-powers,ac100-rtc", > + }, > +}; > + @@ -173,23 +168,21 @@ he > + struct ac100_dev *ac100; > + int ret; > + -> + ac100 =3D devm_kzalloc(&rdev->dev, sizeof(*ac100), GFP_KERNEL); +> + ac100 = devm_kzalloc(&rdev->dev, sizeof(*ac100), GFP_KERNEL); > + if (!ac100) > + return -ENOMEM; > + -> + ac100->dev =3D &rdev->dev; +> + ac100->dev = &rdev->dev; > + sunxi_rsb_device_set_drvdata(rdev, ac100); > + -> + ac100->regmap =3D devm_regmap_init_sunxi_rsb(rdev, &ac100_regmap_config= -); +> + ac100->regmap = devm_regmap_init_sunxi_rsb(rdev, &ac100_regmap_config); > + if (IS_ERR(ac100->regmap)) { -> + ret =3D PTR_ERR(ac100->regmap); +> + ret = PTR_ERR(ac100->regmap); > + dev_err(ac100->dev, "regmap init failed: %d\n", ret); > + return ret; > + } > + -> + ret =3D devm_mfd_add_devices(ac100->dev, PLATFORM_DEVID_NONE, ac100_cel= -ls, +> + ret = devm_mfd_add_devices(ac100->dev, PLATFORM_DEVID_NONE, ac100_cells, > + ARRAY_SIZE(ac100_cells), NULL, 0, NULL); > + if (ret) { > + dev_err(ac100->dev, "failed to add MFD devices: %d\n", ret); @@ -199,23 +192,23 @@ ls, > + return 0; > +} > + -> +static const struct of_device_id ac100_of_match[] =3D { -> + { .compatible =3D "x-powers,ac100" }, +> +static const struct of_device_id ac100_of_match[] = { +> + { .compatible = "x-powers,ac100" }, > + { }, > +}; > +MODULE_DEVICE_TABLE(of, ac100_of_match); > + -> +static struct sunxi_rsb_driver ac100_rsb_driver =3D { -> + .driver =3D { -> + .name =3D "ac100", -> + .of_match_table =3D of_match_ptr(ac100_of_match), +> +static struct sunxi_rsb_driver ac100_rsb_driver = { +> + .driver = { +> + .name = "ac100", +> + .of_match_table = of_match_ptr(ac100_of_match), > + }, -> + .probe =3D ac100_rsb_probe, +> + .probe = ac100_rsb_probe, > +}; > +module_sunxi_rsb_driver(ac100_rsb_driver); > + > +MODULE_DESCRIPTION("Audio codec MFD core driver for AC100"); -> +MODULE_AUTHOR("Chen-Yu Tsai <wens@csie.org>"); +> +MODULE_AUTHOR("Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>"); > +MODULE_LICENSE("GPL v2"); > diff --git a/include/linux/mfd/ac100.h b/include/linux/mfd/ac100.h > new file mode 100644 @@ -228,7 +221,7 @@ ls, > + * > + * Copyright (C) 2016 Chen-Yu Tsai > + * -> + * Chen-Yu Tsai <wens@csie.org> +> + * Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org> > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as @@ -333,8 +326,7 @@ ls, > +#define AC100_ADC_DAP_L_HPF_C 0x94 /* Low High-Pass-Filter Coef */ > +#define AC100_ADC_DAP_OPT 0x95 /* AGC Optimum */ > + -> +/* DAC digital audio processing (high pass filter & dynamic range contro= -l) */ +> +/* DAC digital audio processing (high pass filter & dynamic range control) */ > +#define AC100_DAC_DAP_CTRL 0xa0 > +#define AC100_DAC_DAP_H_HPF_C 0xa1 /* High High-Pass-Filter Coef */ > +#define AC100_DAC_DAP_L_HPF_C 0xa2 /* Low High-Pass-Filter Coef */ @@ -403,20 +395,18 @@ l) */ > + > +#endif /* __LINUX_MFD_AC100_H */ ---=20 +-- Lee Jones Linaro STMicroelectronics Landing Team Lead -Linaro.org =E2=94=82 Open source software for ARM SoCs +Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog ---=20 +-- You received this message because you are subscribed to "rtc-linux". Membership options at http://groups.google.com/group/rtc-linux . Please read http://groups.google.com/group/rtc-linux/web/checklist before submitting a driver. ----=20 -You received this message because you are subscribed to the Google Groups "= -rtc-linux" group. -To unsubscribe from this group and stop receiving emails from it, send an e= -mail to rtc-linux+unsubscribe@googlegroups.com. +--- +You received this message because you are subscribed to the Google Groups "rtc-linux" group. +To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/d/optout. diff --git a/a/content_digest b/N2/content_digest index 3a7cf56..e914062 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -1,16 +1,17 @@ "ref\01467988422-17934-1-git-send-email-wens@csie.org\0" "ref\01467988422-17934-3-git-send-email-wens@csie.org\0" - "From\0Lee Jones <lee.jones@linaro.org>\0" - "Subject\0[rtc-linux] Re: [PATCH v5 2/7] mfd: ac100: Add driver for X-Powers AC100 audio codec / RTC combo IC\0" + "ref\01467988422-17934-3-git-send-email-wens-jdAy2FN1RRM@public.gmane.org\0" + "From\0Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>\0" + "Subject\0Re: [PATCH v5 2/7] mfd: ac100: Add driver for X-Powers AC100 audio codec / RTC combo IC\0" "Date\0Mon, 8 Aug 2016 12:56:21 +0100\0" - "To\0Chen-Yu Tsai <wens@csie.org>\0" - "Cc\0Alessandro Zummo <a.zummo@towertech.it>" - Alexandre Belloni <alexandre.belloni@free-electrons.com> - Maxime Ripard <maxime.ripard@free-electrons.com> - linux-kernel@vger.kernel.org - rtc-linux@googlegroups.com - devicetree@vger.kernel.org - " linux-arm-kernel@lists.infradead.org\0" + "To\0Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>\0" + "Cc\0Alessandro Zummo <a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org>" + Alexandre Belloni <alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> + Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org> + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org + rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org + devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org + " linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org\0" "\00:1\0" "b\0" "On Fri, 08 Jul 2016, Chen-Yu Tsai wrote:\n" @@ -18,31 +19,30 @@ "> The AC100 is a multifunction device with an audio codec subsystem and\n" "> an RTC subsystem. These two subsystems share a common register space\n" "> and host interface.\n" - ">=20\n" - "> Signed-off-by: Chen-Yu Tsai <wens@csie.org>\n" - "> Acked-by: Lee Jones <lee.jones@linaro.org>\n" + "> \n" + "> Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>\n" + "> Acked-by: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>\n" "> ---\n" "> Changes since v4:\n" - ">=20\n" + "> \n" "> - None.\n" - ">=20\n" + "> \n" "> Changes since v3:\n" - ">=20\n" + "> \n" "> - Changed register name prefix to CLKOUT_ for clock output controls\n" - ">=20\n" + "> \n" "> Changes since v2:\n" - ">=20\n" + "> \n" "> - Dropped file name\n" "> - Added copyright line.\n" "> - Changed MODULE_LICENSE to GPL v2, matching the header\n" "> - Added Lee's ack\n" - ">=20\n" + "> \n" "> ---\n" "> drivers/mfd/Kconfig | 10 +++\n" "> drivers/mfd/Makefile | 2 +\n" "> drivers/mfd/ac100.c | 137 +++++++++++++++++++++++++++++++++++\n" - "> include/linux/mfd/ac100.h | 178 ++++++++++++++++++++++++++++++++++++++++=\n" - "++++++\n" + "> include/linux/mfd/ac100.h | 178 ++++++++++++++++++++++++++++++++++++++++++++++\n" "> 4 files changed, 327 insertions(+)\n" "> create mode 100644 drivers/mfd/ac100.c\n" "> create mode 100644 include/linux/mfd/ac100.h\n" @@ -56,7 +56,7 @@ "> @@ -112,6 +112,16 @@ config MFD_BCM590XX\n" "> \thelp\n" "> \t Support for the BCM590xx PMUs from Broadcom\n" - "> =20\n" + "> \n" "> +config MFD_AC100\n" "> +\ttristate \"X-Powers AC100\"\n" "> +\tselect MFD_CORE\n" @@ -74,15 +74,15 @@ "> index 2ba3ba35f745..bca83dbb5ed8 100644\n" "> --- a/drivers/mfd/Makefile\n" "> +++ b/drivers/mfd/Makefile\n" - "> @@ -113,6 +113,8 @@ obj-$(CONFIG_PMIC_DA9052)\t+=3D da9052-irq.o\n" - "> obj-$(CONFIG_PMIC_DA9052)\t+=3D da9052-core.o\n" - "> obj-$(CONFIG_MFD_DA9052_SPI)\t+=3D da9052-spi.o\n" - "> obj-$(CONFIG_MFD_DA9052_I2C)\t+=3D da9052-i2c.o\n" - "> +\n" - "> +obj-$(CONFIG_MFD_AC100)\t\t+=3D ac100.o\n" - "> obj-$(CONFIG_MFD_AXP20X)\t+=3D axp20x.o\n" - "> obj-$(CONFIG_MFD_AXP20X_I2C)\t+=3D axp20x-i2c.o\n" - "> obj-$(CONFIG_MFD_AXP20X_RSB)\t+=3D axp20x-rsb.o\n" + "> @@ -113,6 +113,8 @@ obj-$(CONFIG_PMIC_DA9052)\t+= da9052-irq.o\n" + "> obj-$(CONFIG_PMIC_DA9052)\t+= da9052-core.o\n" + "> obj-$(CONFIG_MFD_DA9052_SPI)\t+= da9052-spi.o\n" + "> obj-$(CONFIG_MFD_DA9052_I2C)\t+= da9052-i2c.o\n" + "> +\n" + "> +obj-$(CONFIG_MFD_AC100)\t\t+= ac100.o\n" + "> obj-$(CONFIG_MFD_AXP20X)\t+= axp20x.o\n" + "> obj-$(CONFIG_MFD_AXP20X_I2C)\t+= axp20x-i2c.o\n" + "> obj-$(CONFIG_MFD_AXP20X_RSB)\t+= axp20x-rsb.o\n" "> diff --git a/drivers/mfd/ac100.c b/drivers/mfd/ac100.c\n" "> new file mode 100644\n" "> index 000000000000..9bc69cd7807d\n" @@ -92,21 +92,17 @@ "> +/*\n" "> + * MFD core driver for X-Powers' AC100 Audio Codec IC\n" "> + *\n" - "> + * The AC100 is a highly integrated audio codec and RTC subsystem design=\n" - "ed\n" - "> + * for mobile applications. It has 3 I2S/PCM interfaces, a 2 channel DAC=\n" - ",\n" - "> + * a 2 channel ADC with 5 inputs and a builtin mixer. The RTC subsystem =\n" - "has\n" + "> + * The AC100 is a highly integrated audio codec and RTC subsystem designed\n" + "> + * for mobile applications. It has 3 I2S/PCM interfaces, a 2 channel DAC,\n" + "> + * a 2 channel ADC with 5 inputs and a builtin mixer. The RTC subsystem has\n" "> + * 3 clock outputs.\n" "> + *\n" - "> + * The audio codec and RTC parts are completely separate, sharing only t=\n" - "he\n" + "> + * The audio codec and RTC parts are completely separate, sharing only the\n" "> + * host interface for access to its registers.\n" "> + *\n" "> + * Copyright (2016) Chen-Yu Tsai\n" "> + *\n" - "> + * Author: Chen-Yu Tsai <wens@csie.org>\n" + "> + * Author: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>\n" "> + *\n" "> + * This program is free software; you can redistribute it and/or modify\n" "> + * it under the terms of the GNU General Public License version 2 as\n" @@ -122,7 +118,7 @@ "> +#include <linux/regmap.h>\n" "> +#include <linux/sunxi-rsb.h>\n" "> +\n" - "> +static const struct regmap_range ac100_writeable_ranges[] =3D {\n" + "> +static const struct regmap_range ac100_writeable_ranges[] = {\n" "> +\tregmap_reg_range(AC100_CHIP_AUDIO_RST, AC100_I2S_SR_CTRL),\n" "> +\tregmap_reg_range(AC100_I2S1_CLK_CTRL, AC100_I2S1_MXR_GAIN),\n" "> +\tregmap_reg_range(AC100_I2S2_CLK_CTRL, AC100_I2S2_MXR_GAIN),\n" @@ -142,7 +138,7 @@ "> +\tregmap_reg_range(AC100_ALM_SEC, AC100_RTC_GP(15)),\n" "> +};\n" "> +\n" - "> +static const struct regmap_range ac100_volatile_ranges[] =3D {\n" + "> +static const struct regmap_range ac100_volatile_ranges[] = {\n" "> +\tregmap_reg_range(AC100_CHIP_AUDIO_RST, AC100_PLL_CTRL2),\n" "> +\tregmap_reg_range(AC100_HMIC_STATUS, AC100_HMIC_STATUS),\n" "> +\tregmap_reg_range(AC100_ADC_DAP_L_STA, AC100_ADC_DAP_L_STA),\n" @@ -154,32 +150,32 @@ "> +\tregmap_reg_range(AC100_ALM_SEC, AC100_ALM_UPD),\n" "> +};\n" "> +\n" - "> +static const struct regmap_access_table ac100_writeable_table =3D {\n" - "> +\t.yes_ranges\t=3D ac100_writeable_ranges,\n" - "> +\t.n_yes_ranges\t=3D ARRAY_SIZE(ac100_writeable_ranges),\n" + "> +static const struct regmap_access_table ac100_writeable_table = {\n" + "> +\t.yes_ranges\t= ac100_writeable_ranges,\n" + "> +\t.n_yes_ranges\t= ARRAY_SIZE(ac100_writeable_ranges),\n" "> +};\n" "> +\n" - "> +static const struct regmap_access_table ac100_volatile_table =3D {\n" - "> +\t.yes_ranges\t=3D ac100_volatile_ranges,\n" - "> +\t.n_yes_ranges\t=3D ARRAY_SIZE(ac100_volatile_ranges),\n" + "> +static const struct regmap_access_table ac100_volatile_table = {\n" + "> +\t.yes_ranges\t= ac100_volatile_ranges,\n" + "> +\t.n_yes_ranges\t= ARRAY_SIZE(ac100_volatile_ranges),\n" "> +};\n" "> +\n" - "> +static const struct regmap_config ac100_regmap_config =3D {\n" - "> +\t.reg_bits\t=3D 8,\n" - "> +\t.val_bits\t=3D 16,\n" - "> +\t.wr_table\t=3D &ac100_writeable_table,\n" - "> +\t.volatile_table\t=3D &ac100_volatile_table,\n" - "> +\t.max_register\t=3D AC100_RTC_GP(15),\n" - "> +\t.cache_type\t=3D REGCACHE_RBTREE,\n" + "> +static const struct regmap_config ac100_regmap_config = {\n" + "> +\t.reg_bits\t= 8,\n" + "> +\t.val_bits\t= 16,\n" + "> +\t.wr_table\t= &ac100_writeable_table,\n" + "> +\t.volatile_table\t= &ac100_volatile_table,\n" + "> +\t.max_register\t= AC100_RTC_GP(15),\n" + "> +\t.cache_type\t= REGCACHE_RBTREE,\n" "> +};\n" "> +\n" - "> +static struct mfd_cell ac100_cells[] =3D {\n" + "> +static struct mfd_cell ac100_cells[] = {\n" "> +\t{\n" - "> +\t\t.name\t\t=3D \"ac100-codec\",\n" - "> +\t\t.of_compatible\t=3D \"x-powers,ac100-codec\",\n" + "> +\t\t.name\t\t= \"ac100-codec\",\n" + "> +\t\t.of_compatible\t= \"x-powers,ac100-codec\",\n" "> +\t}, {\n" - "> +\t\t.name\t\t=3D \"ac100-rtc\",\n" - "> +\t\t.of_compatible\t=3D \"x-powers,ac100-rtc\",\n" + "> +\t\t.name\t\t= \"ac100-rtc\",\n" + "> +\t\t.of_compatible\t= \"x-powers,ac100-rtc\",\n" "> +\t},\n" "> +};\n" "> +\n" @@ -188,23 +184,21 @@ "> +\tstruct ac100_dev *ac100;\n" "> +\tint ret;\n" "> +\n" - "> +\tac100 =3D devm_kzalloc(&rdev->dev, sizeof(*ac100), GFP_KERNEL);\n" + "> +\tac100 = devm_kzalloc(&rdev->dev, sizeof(*ac100), GFP_KERNEL);\n" "> +\tif (!ac100)\n" "> +\t\treturn -ENOMEM;\n" "> +\n" - "> +\tac100->dev =3D &rdev->dev;\n" + "> +\tac100->dev = &rdev->dev;\n" "> +\tsunxi_rsb_device_set_drvdata(rdev, ac100);\n" "> +\n" - "> +\tac100->regmap =3D devm_regmap_init_sunxi_rsb(rdev, &ac100_regmap_config=\n" - ");\n" + "> +\tac100->regmap = devm_regmap_init_sunxi_rsb(rdev, &ac100_regmap_config);\n" "> +\tif (IS_ERR(ac100->regmap)) {\n" - "> +\t\tret =3D PTR_ERR(ac100->regmap);\n" + "> +\t\tret = PTR_ERR(ac100->regmap);\n" "> +\t\tdev_err(ac100->dev, \"regmap init failed: %d\\n\", ret);\n" "> +\t\treturn ret;\n" "> +\t}\n" "> +\n" - "> +\tret =3D devm_mfd_add_devices(ac100->dev, PLATFORM_DEVID_NONE, ac100_cel=\n" - "ls,\n" + "> +\tret = devm_mfd_add_devices(ac100->dev, PLATFORM_DEVID_NONE, ac100_cells,\n" "> +\t\t\t\t ARRAY_SIZE(ac100_cells), NULL, 0, NULL);\n" "> +\tif (ret) {\n" "> +\t\tdev_err(ac100->dev, \"failed to add MFD devices: %d\\n\", ret);\n" @@ -214,23 +208,23 @@ "> +\treturn 0;\n" "> +}\n" "> +\n" - "> +static const struct of_device_id ac100_of_match[] =3D {\n" - "> +\t{ .compatible =3D \"x-powers,ac100\" },\n" + "> +static const struct of_device_id ac100_of_match[] = {\n" + "> +\t{ .compatible = \"x-powers,ac100\" },\n" "> +\t{ },\n" "> +};\n" "> +MODULE_DEVICE_TABLE(of, ac100_of_match);\n" "> +\n" - "> +static struct sunxi_rsb_driver ac100_rsb_driver =3D {\n" - "> +\t.driver =3D {\n" - "> +\t\t.name\t=3D \"ac100\",\n" - "> +\t\t.of_match_table\t=3D of_match_ptr(ac100_of_match),\n" + "> +static struct sunxi_rsb_driver ac100_rsb_driver = {\n" + "> +\t.driver = {\n" + "> +\t\t.name\t= \"ac100\",\n" + "> +\t\t.of_match_table\t= of_match_ptr(ac100_of_match),\n" "> +\t},\n" - "> +\t.probe\t=3D ac100_rsb_probe,\n" + "> +\t.probe\t= ac100_rsb_probe,\n" "> +};\n" "> +module_sunxi_rsb_driver(ac100_rsb_driver);\n" "> +\n" "> +MODULE_DESCRIPTION(\"Audio codec MFD core driver for AC100\");\n" - "> +MODULE_AUTHOR(\"Chen-Yu Tsai <wens@csie.org>\");\n" + "> +MODULE_AUTHOR(\"Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>\");\n" "> +MODULE_LICENSE(\"GPL v2\");\n" "> diff --git a/include/linux/mfd/ac100.h b/include/linux/mfd/ac100.h\n" "> new file mode 100644\n" @@ -243,7 +237,7 @@ "> + *\n" "> + * Copyright (C) 2016 Chen-Yu Tsai\n" "> + *\n" - "> + * Chen-Yu Tsai <wens@csie.org>\n" + "> + * Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>\n" "> + *\n" "> + * This program is free software; you can redistribute it and/or modify\n" "> + * it under the terms of the GNU General Public License version 2 as\n" @@ -348,8 +342,7 @@ "> +#define AC100_ADC_DAP_L_HPF_C\t\t0x94 /* Low High-Pass-Filter Coef */\n" "> +#define AC100_ADC_DAP_OPT\t\t0x95 /* AGC Optimum */\n" "> +\n" - "> +/* DAC digital audio processing (high pass filter & dynamic range contro=\n" - "l) */\n" + "> +/* DAC digital audio processing (high pass filter & dynamic range control) */\n" "> +#define AC100_DAC_DAP_CTRL\t\t0xa0\n" "> +#define AC100_DAC_DAP_H_HPF_C\t\t0xa1 /* High High-Pass-Filter Coef */\n" "> +#define AC100_DAC_DAP_L_HPF_C\t\t0xa2 /* Low High-Pass-Filter Coef */\n" @@ -418,22 +411,20 @@ "> +\n" "> +#endif /* __LINUX_MFD_AC100_H */\n" "\n" - "--=20\n" + "-- \n" "Lee Jones\n" "Linaro STMicroelectronics Landing Team Lead\n" - "Linaro.org =E2=94=82 Open source software for ARM SoCs\n" + "Linaro.org \342\224\202 Open source software for ARM SoCs\n" "Follow Linaro: Facebook | Twitter | Blog\n" "\n" - "--=20\n" + "-- \n" "You received this message because you are subscribed to \"rtc-linux\".\n" "Membership options at http://groups.google.com/group/rtc-linux .\n" "Please read http://groups.google.com/group/rtc-linux/web/checklist\n" "before submitting a driver.\n" - "---=20\n" - "You received this message because you are subscribed to the Google Groups \"=\n" - "rtc-linux\" group.\n" - "To unsubscribe from this group and stop receiving emails from it, send an e=\n" - "mail to rtc-linux+unsubscribe@googlegroups.com.\n" + "--- \n" + "You received this message because you are subscribed to the Google Groups \"rtc-linux\" group.\n" + "To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org\n" For more options, visit https://groups.google.com/d/optout. -0f48a263961c44587883025f3ce895d6e8afcaafcd17e3fae20c698f8b4cd71b +63b887b9f0db5e5962bdf39f478cc2f479f783ca86c6156d634fa818a99ee0a6
diff --git a/a/1.txt b/N3/1.txt index 8b62069..d304024 100644 --- a/a/1.txt +++ b/N3/1.txt @@ -3,31 +3,30 @@ On Fri, 08 Jul 2016, Chen-Yu Tsai wrote: > The AC100 is a multifunction device with an audio codec subsystem and > an RTC subsystem. These two subsystems share a common register space > and host interface. ->=20 +> > Signed-off-by: Chen-Yu Tsai <wens@csie.org> > Acked-by: Lee Jones <lee.jones@linaro.org> > --- > Changes since v4: ->=20 +> > - None. ->=20 +> > Changes since v3: ->=20 +> > - Changed register name prefix to CLKOUT_ for clock output controls ->=20 +> > Changes since v2: ->=20 +> > - Dropped file name > - Added copyright line. > - Changed MODULE_LICENSE to GPL v2, matching the header > - Added Lee's ack ->=20 +> > --- > drivers/mfd/Kconfig | 10 +++ > drivers/mfd/Makefile | 2 + > drivers/mfd/ac100.c | 137 +++++++++++++++++++++++++++++++++++ -> include/linux/mfd/ac100.h | 178 ++++++++++++++++++++++++++++++++++++++++= -++++++ +> include/linux/mfd/ac100.h | 178 ++++++++++++++++++++++++++++++++++++++++++++++ > 4 files changed, 327 insertions(+) > create mode 100644 drivers/mfd/ac100.c > create mode 100644 include/linux/mfd/ac100.h @@ -41,7 +40,7 @@ Applied, thanks. > @@ -112,6 +112,16 @@ config MFD_BCM590XX > help > Support for the BCM590xx PMUs from Broadcom -> =20 +> > +config MFD_AC100 > + tristate "X-Powers AC100" > + select MFD_CORE @@ -59,15 +58,15 @@ Applied, thanks. > index 2ba3ba35f745..bca83dbb5ed8 100644 > --- a/drivers/mfd/Makefile > +++ b/drivers/mfd/Makefile -> @@ -113,6 +113,8 @@ obj-$(CONFIG_PMIC_DA9052) +=3D da9052-irq.o -> obj-$(CONFIG_PMIC_DA9052) +=3D da9052-core.o -> obj-$(CONFIG_MFD_DA9052_SPI) +=3D da9052-spi.o -> obj-$(CONFIG_MFD_DA9052_I2C) +=3D da9052-i2c.o -> + -> +obj-$(CONFIG_MFD_AC100) +=3D ac100.o -> obj-$(CONFIG_MFD_AXP20X) +=3D axp20x.o -> obj-$(CONFIG_MFD_AXP20X_I2C) +=3D axp20x-i2c.o -> obj-$(CONFIG_MFD_AXP20X_RSB) +=3D axp20x-rsb.o +> @@ -113,6 +113,8 @@ obj-$(CONFIG_PMIC_DA9052) += da9052-irq.o +> obj-$(CONFIG_PMIC_DA9052) += da9052-core.o +> obj-$(CONFIG_MFD_DA9052_SPI) += da9052-spi.o +> obj-$(CONFIG_MFD_DA9052_I2C) += da9052-i2c.o +> + +> +obj-$(CONFIG_MFD_AC100) += ac100.o +> obj-$(CONFIG_MFD_AXP20X) += axp20x.o +> obj-$(CONFIG_MFD_AXP20X_I2C) += axp20x-i2c.o +> obj-$(CONFIG_MFD_AXP20X_RSB) += axp20x-rsb.o > diff --git a/drivers/mfd/ac100.c b/drivers/mfd/ac100.c > new file mode 100644 > index 000000000000..9bc69cd7807d @@ -77,16 +76,12 @@ Applied, thanks. > +/* > + * MFD core driver for X-Powers' AC100 Audio Codec IC > + * -> + * The AC100 is a highly integrated audio codec and RTC subsystem design= -ed -> + * for mobile applications. It has 3 I2S/PCM interfaces, a 2 channel DAC= -, -> + * a 2 channel ADC with 5 inputs and a builtin mixer. The RTC subsystem = -has +> + * The AC100 is a highly integrated audio codec and RTC subsystem designed +> + * for mobile applications. It has 3 I2S/PCM interfaces, a 2 channel DAC, +> + * a 2 channel ADC with 5 inputs and a builtin mixer. The RTC subsystem has > + * 3 clock outputs. > + * -> + * The audio codec and RTC parts are completely separate, sharing only t= -he +> + * The audio codec and RTC parts are completely separate, sharing only the > + * host interface for access to its registers. > + * > + * Copyright (2016) Chen-Yu Tsai @@ -107,7 +102,7 @@ he > +#include <linux/regmap.h> > +#include <linux/sunxi-rsb.h> > + -> +static const struct regmap_range ac100_writeable_ranges[] =3D { +> +static const struct regmap_range ac100_writeable_ranges[] = { > + regmap_reg_range(AC100_CHIP_AUDIO_RST, AC100_I2S_SR_CTRL), > + regmap_reg_range(AC100_I2S1_CLK_CTRL, AC100_I2S1_MXR_GAIN), > + regmap_reg_range(AC100_I2S2_CLK_CTRL, AC100_I2S2_MXR_GAIN), @@ -127,7 +122,7 @@ he > + regmap_reg_range(AC100_ALM_SEC, AC100_RTC_GP(15)), > +}; > + -> +static const struct regmap_range ac100_volatile_ranges[] =3D { +> +static const struct regmap_range ac100_volatile_ranges[] = { > + regmap_reg_range(AC100_CHIP_AUDIO_RST, AC100_PLL_CTRL2), > + regmap_reg_range(AC100_HMIC_STATUS, AC100_HMIC_STATUS), > + regmap_reg_range(AC100_ADC_DAP_L_STA, AC100_ADC_DAP_L_STA), @@ -139,32 +134,32 @@ he > + regmap_reg_range(AC100_ALM_SEC, AC100_ALM_UPD), > +}; > + -> +static const struct regmap_access_table ac100_writeable_table =3D { -> + .yes_ranges =3D ac100_writeable_ranges, -> + .n_yes_ranges =3D ARRAY_SIZE(ac100_writeable_ranges), +> +static const struct regmap_access_table ac100_writeable_table = { +> + .yes_ranges = ac100_writeable_ranges, +> + .n_yes_ranges = ARRAY_SIZE(ac100_writeable_ranges), > +}; > + -> +static const struct regmap_access_table ac100_volatile_table =3D { -> + .yes_ranges =3D ac100_volatile_ranges, -> + .n_yes_ranges =3D ARRAY_SIZE(ac100_volatile_ranges), +> +static const struct regmap_access_table ac100_volatile_table = { +> + .yes_ranges = ac100_volatile_ranges, +> + .n_yes_ranges = ARRAY_SIZE(ac100_volatile_ranges), > +}; > + -> +static const struct regmap_config ac100_regmap_config =3D { -> + .reg_bits =3D 8, -> + .val_bits =3D 16, -> + .wr_table =3D &ac100_writeable_table, -> + .volatile_table =3D &ac100_volatile_table, -> + .max_register =3D AC100_RTC_GP(15), -> + .cache_type =3D REGCACHE_RBTREE, +> +static const struct regmap_config ac100_regmap_config = { +> + .reg_bits = 8, +> + .val_bits = 16, +> + .wr_table = &ac100_writeable_table, +> + .volatile_table = &ac100_volatile_table, +> + .max_register = AC100_RTC_GP(15), +> + .cache_type = REGCACHE_RBTREE, > +}; > + -> +static struct mfd_cell ac100_cells[] =3D { +> +static struct mfd_cell ac100_cells[] = { > + { -> + .name =3D "ac100-codec", -> + .of_compatible =3D "x-powers,ac100-codec", +> + .name = "ac100-codec", +> + .of_compatible = "x-powers,ac100-codec", > + }, { -> + .name =3D "ac100-rtc", -> + .of_compatible =3D "x-powers,ac100-rtc", +> + .name = "ac100-rtc", +> + .of_compatible = "x-powers,ac100-rtc", > + }, > +}; > + @@ -173,23 +168,21 @@ he > + struct ac100_dev *ac100; > + int ret; > + -> + ac100 =3D devm_kzalloc(&rdev->dev, sizeof(*ac100), GFP_KERNEL); +> + ac100 = devm_kzalloc(&rdev->dev, sizeof(*ac100), GFP_KERNEL); > + if (!ac100) > + return -ENOMEM; > + -> + ac100->dev =3D &rdev->dev; +> + ac100->dev = &rdev->dev; > + sunxi_rsb_device_set_drvdata(rdev, ac100); > + -> + ac100->regmap =3D devm_regmap_init_sunxi_rsb(rdev, &ac100_regmap_config= -); +> + ac100->regmap = devm_regmap_init_sunxi_rsb(rdev, &ac100_regmap_config); > + if (IS_ERR(ac100->regmap)) { -> + ret =3D PTR_ERR(ac100->regmap); +> + ret = PTR_ERR(ac100->regmap); > + dev_err(ac100->dev, "regmap init failed: %d\n", ret); > + return ret; > + } > + -> + ret =3D devm_mfd_add_devices(ac100->dev, PLATFORM_DEVID_NONE, ac100_cel= -ls, +> + ret = devm_mfd_add_devices(ac100->dev, PLATFORM_DEVID_NONE, ac100_cells, > + ARRAY_SIZE(ac100_cells), NULL, 0, NULL); > + if (ret) { > + dev_err(ac100->dev, "failed to add MFD devices: %d\n", ret); @@ -199,18 +192,18 @@ ls, > + return 0; > +} > + -> +static const struct of_device_id ac100_of_match[] =3D { -> + { .compatible =3D "x-powers,ac100" }, +> +static const struct of_device_id ac100_of_match[] = { +> + { .compatible = "x-powers,ac100" }, > + { }, > +}; > +MODULE_DEVICE_TABLE(of, ac100_of_match); > + -> +static struct sunxi_rsb_driver ac100_rsb_driver =3D { -> + .driver =3D { -> + .name =3D "ac100", -> + .of_match_table =3D of_match_ptr(ac100_of_match), +> +static struct sunxi_rsb_driver ac100_rsb_driver = { +> + .driver = { +> + .name = "ac100", +> + .of_match_table = of_match_ptr(ac100_of_match), > + }, -> + .probe =3D ac100_rsb_probe, +> + .probe = ac100_rsb_probe, > +}; > +module_sunxi_rsb_driver(ac100_rsb_driver); > + @@ -333,8 +326,7 @@ ls, > +#define AC100_ADC_DAP_L_HPF_C 0x94 /* Low High-Pass-Filter Coef */ > +#define AC100_ADC_DAP_OPT 0x95 /* AGC Optimum */ > + -> +/* DAC digital audio processing (high pass filter & dynamic range contro= -l) */ +> +/* DAC digital audio processing (high pass filter & dynamic range control) */ > +#define AC100_DAC_DAP_CTRL 0xa0 > +#define AC100_DAC_DAP_H_HPF_C 0xa1 /* High High-Pass-Filter Coef */ > +#define AC100_DAC_DAP_L_HPF_C 0xa2 /* Low High-Pass-Filter Coef */ @@ -403,20 +395,8 @@ l) */ > + > +#endif /* __LINUX_MFD_AC100_H */ ---=20 +-- Lee Jones Linaro STMicroelectronics Landing Team Lead -Linaro.org =E2=94=82 Open source software for ARM SoCs +Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog - ---=20 -You received this message because you are subscribed to "rtc-linux". -Membership options at http://groups.google.com/group/rtc-linux . -Please read http://groups.google.com/group/rtc-linux/web/checklist -before submitting a driver. ----=20 -You received this message because you are subscribed to the Google Groups "= -rtc-linux" group. -To unsubscribe from this group and stop receiving emails from it, send an e= -mail to rtc-linux+unsubscribe@googlegroups.com. -For more options, visit https://groups.google.com/d/optout. diff --git a/a/content_digest b/N3/content_digest index 3a7cf56..c7fee3c 100644 --- a/a/content_digest +++ b/N3/content_digest @@ -1,7 +1,7 @@ "ref\01467988422-17934-1-git-send-email-wens@csie.org\0" "ref\01467988422-17934-3-git-send-email-wens@csie.org\0" "From\0Lee Jones <lee.jones@linaro.org>\0" - "Subject\0[rtc-linux] Re: [PATCH v5 2/7] mfd: ac100: Add driver for X-Powers AC100 audio codec / RTC combo IC\0" + "Subject\0Re: [PATCH v5 2/7] mfd: ac100: Add driver for X-Powers AC100 audio codec / RTC combo IC\0" "Date\0Mon, 8 Aug 2016 12:56:21 +0100\0" "To\0Chen-Yu Tsai <wens@csie.org>\0" "Cc\0Alessandro Zummo <a.zummo@towertech.it>" @@ -18,31 +18,30 @@ "> The AC100 is a multifunction device with an audio codec subsystem and\n" "> an RTC subsystem. These two subsystems share a common register space\n" "> and host interface.\n" - ">=20\n" + "> \n" "> Signed-off-by: Chen-Yu Tsai <wens@csie.org>\n" "> Acked-by: Lee Jones <lee.jones@linaro.org>\n" "> ---\n" "> Changes since v4:\n" - ">=20\n" + "> \n" "> - None.\n" - ">=20\n" + "> \n" "> Changes since v3:\n" - ">=20\n" + "> \n" "> - Changed register name prefix to CLKOUT_ for clock output controls\n" - ">=20\n" + "> \n" "> Changes since v2:\n" - ">=20\n" + "> \n" "> - Dropped file name\n" "> - Added copyright line.\n" "> - Changed MODULE_LICENSE to GPL v2, matching the header\n" "> - Added Lee's ack\n" - ">=20\n" + "> \n" "> ---\n" "> drivers/mfd/Kconfig | 10 +++\n" "> drivers/mfd/Makefile | 2 +\n" "> drivers/mfd/ac100.c | 137 +++++++++++++++++++++++++++++++++++\n" - "> include/linux/mfd/ac100.h | 178 ++++++++++++++++++++++++++++++++++++++++=\n" - "++++++\n" + "> include/linux/mfd/ac100.h | 178 ++++++++++++++++++++++++++++++++++++++++++++++\n" "> 4 files changed, 327 insertions(+)\n" "> create mode 100644 drivers/mfd/ac100.c\n" "> create mode 100644 include/linux/mfd/ac100.h\n" @@ -56,7 +55,7 @@ "> @@ -112,6 +112,16 @@ config MFD_BCM590XX\n" "> \thelp\n" "> \t Support for the BCM590xx PMUs from Broadcom\n" - "> =20\n" + "> \n" "> +config MFD_AC100\n" "> +\ttristate \"X-Powers AC100\"\n" "> +\tselect MFD_CORE\n" @@ -74,15 +73,15 @@ "> index 2ba3ba35f745..bca83dbb5ed8 100644\n" "> --- a/drivers/mfd/Makefile\n" "> +++ b/drivers/mfd/Makefile\n" - "> @@ -113,6 +113,8 @@ obj-$(CONFIG_PMIC_DA9052)\t+=3D da9052-irq.o\n" - "> obj-$(CONFIG_PMIC_DA9052)\t+=3D da9052-core.o\n" - "> obj-$(CONFIG_MFD_DA9052_SPI)\t+=3D da9052-spi.o\n" - "> obj-$(CONFIG_MFD_DA9052_I2C)\t+=3D da9052-i2c.o\n" - "> +\n" - "> +obj-$(CONFIG_MFD_AC100)\t\t+=3D ac100.o\n" - "> obj-$(CONFIG_MFD_AXP20X)\t+=3D axp20x.o\n" - "> obj-$(CONFIG_MFD_AXP20X_I2C)\t+=3D axp20x-i2c.o\n" - "> obj-$(CONFIG_MFD_AXP20X_RSB)\t+=3D axp20x-rsb.o\n" + "> @@ -113,6 +113,8 @@ obj-$(CONFIG_PMIC_DA9052)\t+= da9052-irq.o\n" + "> obj-$(CONFIG_PMIC_DA9052)\t+= da9052-core.o\n" + "> obj-$(CONFIG_MFD_DA9052_SPI)\t+= da9052-spi.o\n" + "> obj-$(CONFIG_MFD_DA9052_I2C)\t+= da9052-i2c.o\n" + "> +\n" + "> +obj-$(CONFIG_MFD_AC100)\t\t+= ac100.o\n" + "> obj-$(CONFIG_MFD_AXP20X)\t+= axp20x.o\n" + "> obj-$(CONFIG_MFD_AXP20X_I2C)\t+= axp20x-i2c.o\n" + "> obj-$(CONFIG_MFD_AXP20X_RSB)\t+= axp20x-rsb.o\n" "> diff --git a/drivers/mfd/ac100.c b/drivers/mfd/ac100.c\n" "> new file mode 100644\n" "> index 000000000000..9bc69cd7807d\n" @@ -92,16 +91,12 @@ "> +/*\n" "> + * MFD core driver for X-Powers' AC100 Audio Codec IC\n" "> + *\n" - "> + * The AC100 is a highly integrated audio codec and RTC subsystem design=\n" - "ed\n" - "> + * for mobile applications. It has 3 I2S/PCM interfaces, a 2 channel DAC=\n" - ",\n" - "> + * a 2 channel ADC with 5 inputs and a builtin mixer. The RTC subsystem =\n" - "has\n" + "> + * The AC100 is a highly integrated audio codec and RTC subsystem designed\n" + "> + * for mobile applications. It has 3 I2S/PCM interfaces, a 2 channel DAC,\n" + "> + * a 2 channel ADC with 5 inputs and a builtin mixer. The RTC subsystem has\n" "> + * 3 clock outputs.\n" "> + *\n" - "> + * The audio codec and RTC parts are completely separate, sharing only t=\n" - "he\n" + "> + * The audio codec and RTC parts are completely separate, sharing only the\n" "> + * host interface for access to its registers.\n" "> + *\n" "> + * Copyright (2016) Chen-Yu Tsai\n" @@ -122,7 +117,7 @@ "> +#include <linux/regmap.h>\n" "> +#include <linux/sunxi-rsb.h>\n" "> +\n" - "> +static const struct regmap_range ac100_writeable_ranges[] =3D {\n" + "> +static const struct regmap_range ac100_writeable_ranges[] = {\n" "> +\tregmap_reg_range(AC100_CHIP_AUDIO_RST, AC100_I2S_SR_CTRL),\n" "> +\tregmap_reg_range(AC100_I2S1_CLK_CTRL, AC100_I2S1_MXR_GAIN),\n" "> +\tregmap_reg_range(AC100_I2S2_CLK_CTRL, AC100_I2S2_MXR_GAIN),\n" @@ -142,7 +137,7 @@ "> +\tregmap_reg_range(AC100_ALM_SEC, AC100_RTC_GP(15)),\n" "> +};\n" "> +\n" - "> +static const struct regmap_range ac100_volatile_ranges[] =3D {\n" + "> +static const struct regmap_range ac100_volatile_ranges[] = {\n" "> +\tregmap_reg_range(AC100_CHIP_AUDIO_RST, AC100_PLL_CTRL2),\n" "> +\tregmap_reg_range(AC100_HMIC_STATUS, AC100_HMIC_STATUS),\n" "> +\tregmap_reg_range(AC100_ADC_DAP_L_STA, AC100_ADC_DAP_L_STA),\n" @@ -154,32 +149,32 @@ "> +\tregmap_reg_range(AC100_ALM_SEC, AC100_ALM_UPD),\n" "> +};\n" "> +\n" - "> +static const struct regmap_access_table ac100_writeable_table =3D {\n" - "> +\t.yes_ranges\t=3D ac100_writeable_ranges,\n" - "> +\t.n_yes_ranges\t=3D ARRAY_SIZE(ac100_writeable_ranges),\n" + "> +static const struct regmap_access_table ac100_writeable_table = {\n" + "> +\t.yes_ranges\t= ac100_writeable_ranges,\n" + "> +\t.n_yes_ranges\t= ARRAY_SIZE(ac100_writeable_ranges),\n" "> +};\n" "> +\n" - "> +static const struct regmap_access_table ac100_volatile_table =3D {\n" - "> +\t.yes_ranges\t=3D ac100_volatile_ranges,\n" - "> +\t.n_yes_ranges\t=3D ARRAY_SIZE(ac100_volatile_ranges),\n" + "> +static const struct regmap_access_table ac100_volatile_table = {\n" + "> +\t.yes_ranges\t= ac100_volatile_ranges,\n" + "> +\t.n_yes_ranges\t= ARRAY_SIZE(ac100_volatile_ranges),\n" "> +};\n" "> +\n" - "> +static const struct regmap_config ac100_regmap_config =3D {\n" - "> +\t.reg_bits\t=3D 8,\n" - "> +\t.val_bits\t=3D 16,\n" - "> +\t.wr_table\t=3D &ac100_writeable_table,\n" - "> +\t.volatile_table\t=3D &ac100_volatile_table,\n" - "> +\t.max_register\t=3D AC100_RTC_GP(15),\n" - "> +\t.cache_type\t=3D REGCACHE_RBTREE,\n" + "> +static const struct regmap_config ac100_regmap_config = {\n" + "> +\t.reg_bits\t= 8,\n" + "> +\t.val_bits\t= 16,\n" + "> +\t.wr_table\t= &ac100_writeable_table,\n" + "> +\t.volatile_table\t= &ac100_volatile_table,\n" + "> +\t.max_register\t= AC100_RTC_GP(15),\n" + "> +\t.cache_type\t= REGCACHE_RBTREE,\n" "> +};\n" "> +\n" - "> +static struct mfd_cell ac100_cells[] =3D {\n" + "> +static struct mfd_cell ac100_cells[] = {\n" "> +\t{\n" - "> +\t\t.name\t\t=3D \"ac100-codec\",\n" - "> +\t\t.of_compatible\t=3D \"x-powers,ac100-codec\",\n" + "> +\t\t.name\t\t= \"ac100-codec\",\n" + "> +\t\t.of_compatible\t= \"x-powers,ac100-codec\",\n" "> +\t}, {\n" - "> +\t\t.name\t\t=3D \"ac100-rtc\",\n" - "> +\t\t.of_compatible\t=3D \"x-powers,ac100-rtc\",\n" + "> +\t\t.name\t\t= \"ac100-rtc\",\n" + "> +\t\t.of_compatible\t= \"x-powers,ac100-rtc\",\n" "> +\t},\n" "> +};\n" "> +\n" @@ -188,23 +183,21 @@ "> +\tstruct ac100_dev *ac100;\n" "> +\tint ret;\n" "> +\n" - "> +\tac100 =3D devm_kzalloc(&rdev->dev, sizeof(*ac100), GFP_KERNEL);\n" + "> +\tac100 = devm_kzalloc(&rdev->dev, sizeof(*ac100), GFP_KERNEL);\n" "> +\tif (!ac100)\n" "> +\t\treturn -ENOMEM;\n" "> +\n" - "> +\tac100->dev =3D &rdev->dev;\n" + "> +\tac100->dev = &rdev->dev;\n" "> +\tsunxi_rsb_device_set_drvdata(rdev, ac100);\n" "> +\n" - "> +\tac100->regmap =3D devm_regmap_init_sunxi_rsb(rdev, &ac100_regmap_config=\n" - ");\n" + "> +\tac100->regmap = devm_regmap_init_sunxi_rsb(rdev, &ac100_regmap_config);\n" "> +\tif (IS_ERR(ac100->regmap)) {\n" - "> +\t\tret =3D PTR_ERR(ac100->regmap);\n" + "> +\t\tret = PTR_ERR(ac100->regmap);\n" "> +\t\tdev_err(ac100->dev, \"regmap init failed: %d\\n\", ret);\n" "> +\t\treturn ret;\n" "> +\t}\n" "> +\n" - "> +\tret =3D devm_mfd_add_devices(ac100->dev, PLATFORM_DEVID_NONE, ac100_cel=\n" - "ls,\n" + "> +\tret = devm_mfd_add_devices(ac100->dev, PLATFORM_DEVID_NONE, ac100_cells,\n" "> +\t\t\t\t ARRAY_SIZE(ac100_cells), NULL, 0, NULL);\n" "> +\tif (ret) {\n" "> +\t\tdev_err(ac100->dev, \"failed to add MFD devices: %d\\n\", ret);\n" @@ -214,18 +207,18 @@ "> +\treturn 0;\n" "> +}\n" "> +\n" - "> +static const struct of_device_id ac100_of_match[] =3D {\n" - "> +\t{ .compatible =3D \"x-powers,ac100\" },\n" + "> +static const struct of_device_id ac100_of_match[] = {\n" + "> +\t{ .compatible = \"x-powers,ac100\" },\n" "> +\t{ },\n" "> +};\n" "> +MODULE_DEVICE_TABLE(of, ac100_of_match);\n" "> +\n" - "> +static struct sunxi_rsb_driver ac100_rsb_driver =3D {\n" - "> +\t.driver =3D {\n" - "> +\t\t.name\t=3D \"ac100\",\n" - "> +\t\t.of_match_table\t=3D of_match_ptr(ac100_of_match),\n" + "> +static struct sunxi_rsb_driver ac100_rsb_driver = {\n" + "> +\t.driver = {\n" + "> +\t\t.name\t= \"ac100\",\n" + "> +\t\t.of_match_table\t= of_match_ptr(ac100_of_match),\n" "> +\t},\n" - "> +\t.probe\t=3D ac100_rsb_probe,\n" + "> +\t.probe\t= ac100_rsb_probe,\n" "> +};\n" "> +module_sunxi_rsb_driver(ac100_rsb_driver);\n" "> +\n" @@ -348,8 +341,7 @@ "> +#define AC100_ADC_DAP_L_HPF_C\t\t0x94 /* Low High-Pass-Filter Coef */\n" "> +#define AC100_ADC_DAP_OPT\t\t0x95 /* AGC Optimum */\n" "> +\n" - "> +/* DAC digital audio processing (high pass filter & dynamic range contro=\n" - "l) */\n" + "> +/* DAC digital audio processing (high pass filter & dynamic range control) */\n" "> +#define AC100_DAC_DAP_CTRL\t\t0xa0\n" "> +#define AC100_DAC_DAP_H_HPF_C\t\t0xa1 /* High High-Pass-Filter Coef */\n" "> +#define AC100_DAC_DAP_L_HPF_C\t\t0xa2 /* Low High-Pass-Filter Coef */\n" @@ -418,22 +410,10 @@ "> +\n" "> +#endif /* __LINUX_MFD_AC100_H */\n" "\n" - "--=20\n" + "-- \n" "Lee Jones\n" "Linaro STMicroelectronics Landing Team Lead\n" - "Linaro.org =E2=94=82 Open source software for ARM SoCs\n" - "Follow Linaro: Facebook | Twitter | Blog\n" - "\n" - "--=20\n" - "You received this message because you are subscribed to \"rtc-linux\".\n" - "Membership options at http://groups.google.com/group/rtc-linux .\n" - "Please read http://groups.google.com/group/rtc-linux/web/checklist\n" - "before submitting a driver.\n" - "---=20\n" - "You received this message because you are subscribed to the Google Groups \"=\n" - "rtc-linux\" group.\n" - "To unsubscribe from this group and stop receiving emails from it, send an e=\n" - "mail to rtc-linux+unsubscribe@googlegroups.com.\n" - For more options, visit https://groups.google.com/d/optout. + "Linaro.org \342\224\202 Open source software for ARM SoCs\n" + Follow Linaro: Facebook | Twitter | Blog -0f48a263961c44587883025f3ce895d6e8afcaafcd17e3fae20c698f8b4cd71b +72cdc69f4a0a66ac009cf1e453d1e5159ac7b8a54e66aefe6cb52a8c9d53b5ea
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.