Add codec IRQ resources that are used in 88pm860x codec driver.
Signed-off-by: Haojian Zhuang haojian.zhuang@marvell.com
---
drivers/mfd/88pm860x-core.c | 44 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index 07933f3..4db10a1 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -158,6 +158,43 @@ static struct mfd_cell onkey_devs[] = {
},
};
+static struct resource codec_resources[] = {
+ {
+ /* Headset microphone insertion or removal */
+ .name = "micin",
+ .start = PM8607_IRQ_MICIN,
+ .end = PM8607_IRQ_MICIN,
+ .flags = IORESOURCE_IRQ,
+ }, {
+ /* Hook-switch press or release */
+ .name = "hook",
+ .start = PM8607_IRQ_HOOK,
+ .end = PM8607_IRQ_HOOK,
+ .flags = IORESOURCE_IRQ,
+ }, {
+ /* Headset insertion or removal */
+ .name = "headset",
+ .start = PM8607_IRQ_HEADSET,
+ .end = PM8607_IRQ_HEADSET,
+ .flags = IORESOURCE_IRQ,
+ }, {
+ /* Audio short */
+ .name = "audio-short",
+ .start = PM8607_IRQ_AUDIO_SHORT,
+ .end = PM8607_IRQ_AUDIO_SHORT,
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct mfd_cell codec_devs[] = {
+ {
+ .name = "88pm860x-codec",
+ .num_resources = ARRAY_SIZE(codec_resources),
+ .resources = &codec_resources[0],
+ .id = -1,
+ },
+};
+
static struct resource regulator_resources[] = {
PM8607_REG_RESOURCE(BUCK1, BUCK1),
PM8607_REG_RESOURCE(BUCK2, BUCK2),
@@ -687,6 +724,13 @@ static void __devinit device_8607_init(struct
pm860x_chip *chip,
goto out_dev;
}
+ ret = mfd_add_devices(chip->dev, 0, &codec_devs[0],
+ ARRAY_SIZE(codec_devs),
+ &codec_resources[0], 0);
+ if (ret < 0) {
+ dev_err(chip->dev, "Failed to add codec subdev\n");
+ goto out_dev;
+ }
return;
out_dev:
mfd_remove_devices(chip->dev);
--
1.5.6.5
--0016e6daaffbfa18ad048e7b0ed9
Content-Type: text/x-patch; charset=US-ASCII;
name="0001-mfd-add-codec-resource-into-88pm860x-driver.patch"
Content-Disposition: attachment;
filename="0001-mfd-add-codec-resource-into-88pm860x-driver.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gd76bllc0
RnJvbSAyOGVkNGFmMzkyOTEyMGI5YjM4NTNmZmNiODA1NWViNmE4MWQzMWQ4IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBIYW9qaWFuIFpodWFuZyA8aGFvamlhbi56aHVhbmdAbWFydmVs
bC5jb20+CkRhdGU6IFRodSwgMTIgQXVnIDIwMTAgMTE6NTk6MzMgKzA4MDAKU3ViamVjdDogW1BB
VENIIDEvMV0gbWZkOiBhZGQgY29kZWMgcmVzb3VyY2UgaW50byA4OHBtODYweCBkcml2ZXIKCkFk
ZCBjb2RlYyBJUlEgcmVzb3VyY2VzIHRoYXQgYXJlIHVzZWQgaW4gODhwbTg2MHggY29kZWMgZHJp
dmVyLgoKU2lnbmVkLW9mZi1ieTogSGFvamlhbiBaaHVhbmcgPGhhb2ppYW4uemh1YW5nQG1hcnZl
bGwuY29tPgotLS0KIGRyaXZlcnMvbWZkLzg4cG04NjB4LWNvcmUuYyB8ICAgNDQgKysrKysrKysr
KysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKwogMSBmaWxlcyBjaGFuZ2VkLCA0NCBp
bnNlcnRpb25zKCspLCAwIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2RyaXZlcnMvbWZkLzg4
cG04NjB4LWNvcmUuYyBiL2RyaXZlcnMvbWZkLzg4cG04NjB4LWNvcmUuYwppbmRleCAwNzkzM2Yz
Li40ZGIxMGExIDEwMDY0NAotLS0gYS9kcml2ZXJzL21mZC84OHBtODYweC1jb3JlLmMKKysrIGIv
ZHJpdmVycy9tZmQvODhwbTg2M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