Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: Add codec resource into 88pm860x driver

Add codec IRQ resources that are used in 88pm860x codec driver.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

authored by

Haojian Zhuang and committed by
Samuel Ortiz
2c36af7b 4b751cf5

+44
+44
drivers/mfd/88pm860x-core.c
··· 158 158 }, 159 159 }; 160 160 161 + static struct resource codec_resources[] = { 162 + { 163 + /* Headset microphone insertion or removal */ 164 + .name = "micin", 165 + .start = PM8607_IRQ_MICIN, 166 + .end = PM8607_IRQ_MICIN, 167 + .flags = IORESOURCE_IRQ, 168 + }, { 169 + /* Hook-switch press or release */ 170 + .name = "hook", 171 + .start = PM8607_IRQ_HOOK, 172 + .end = PM8607_IRQ_HOOK, 173 + .flags = IORESOURCE_IRQ, 174 + }, { 175 + /* Headset insertion or removal */ 176 + .name = "headset", 177 + .start = PM8607_IRQ_HEADSET, 178 + .end = PM8607_IRQ_HEADSET, 179 + .flags = IORESOURCE_IRQ, 180 + }, { 181 + /* Audio short */ 182 + .name = "audio-short", 183 + .start = PM8607_IRQ_AUDIO_SHORT, 184 + .end = PM8607_IRQ_AUDIO_SHORT, 185 + .flags = IORESOURCE_IRQ, 186 + }, 187 + }; 188 + 189 + static struct mfd_cell codec_devs[] = { 190 + { 191 + .name = "88pm860x-codec", 192 + .num_resources = ARRAY_SIZE(codec_resources), 193 + .resources = &codec_resources[0], 194 + .id = -1, 195 + }, 196 + }; 197 + 161 198 static struct resource regulator_resources[] = { 162 199 PM8607_REG_RESOURCE(BUCK1, BUCK1), 163 200 PM8607_REG_RESOURCE(BUCK2, BUCK2), ··· 724 687 goto out_dev; 725 688 } 726 689 690 + ret = mfd_add_devices(chip->dev, 0, &codec_devs[0], 691 + ARRAY_SIZE(codec_devs), 692 + &codec_resources[0], 0); 693 + if (ret < 0) { 694 + dev_err(chip->dev, "Failed to add codec subdev\n"); 695 + goto out_dev; 696 + } 727 697 return; 728 698 out_dev: 729 699 mfd_remove_devices(chip->dev);