diff options
Diffstat (limited to 'sound/aoa/fabrics/layout.c')
| -rw-r--r-- | sound/aoa/fabrics/layout.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c index ec4ef18555bc..bb2a0ef3004b 100644 --- a/sound/aoa/fabrics/layout.c +++ b/sound/aoa/fabrics/layout.c @@ -7,9 +7,10 @@ * This fabric module looks for sound codecs based on the * layout-id or device-id property in the device tree. */ -#include <asm/prom.h> #include <linux/list.h> #include <linux/module.h> +#include <linux/of.h> +#include <linux/platform_device.h> #include <linux/slab.h> #include "../aoa.h" #include "../soundbus/soundbus.h" @@ -948,8 +949,7 @@ static void layout_attached_codec(struct aoa_codec *codec) ldev->gpio.methods->set_lineout(codec->gpio, 1); ctl = snd_ctl_new1(&lineout_ctl, codec->gpio); if (cc->connected & CC_LINEOUT_LABELLED_HEADPHONE) - strscpy(ctl->id.name, - "Headphone Switch", sizeof(ctl->id.name)); + strscpy(ctl->id.name, "Headphone Switch"); ldev->lineout_ctrl = ctl; aoa_snd_ctl_add(ctl); ldev->have_lineout_detect = @@ -963,15 +963,13 @@ static void layout_attached_codec(struct aoa_codec *codec) ldev); if (cc->connected & CC_LINEOUT_LABELLED_HEADPHONE) strscpy(ctl->id.name, - "Headphone Detect Autoswitch", - sizeof(ctl->id.name)); + "Headphone Detect Autoswitch"); aoa_snd_ctl_add(ctl); ctl = snd_ctl_new1(&lineout_detected, ldev); if (cc->connected & CC_LINEOUT_LABELLED_HEADPHONE) strscpy(ctl->id.name, - "Headphone Detected", - sizeof(ctl->id.name)); + "Headphone Detected"); ldev->lineout_detected_ctrl = ctl; aoa_snd_ctl_add(ctl); } @@ -1094,7 +1092,7 @@ static int aoa_fabric_layout_probe(struct soundbus_dev *sdev) return -ENODEV; } -static int aoa_fabric_layout_remove(struct soundbus_dev *sdev) +static void aoa_fabric_layout_remove(struct soundbus_dev *sdev) { struct layout_dev *ldev = dev_get_drvdata(&sdev->ofdev.dev); int i; @@ -1123,10 +1121,8 @@ static int aoa_fabric_layout_remove(struct soundbus_dev *sdev) kfree(ldev); sdev->pcmid = -1; sdev->pcmname = NULL; - return 0; } -#ifdef CONFIG_PM_SLEEP static int aoa_fabric_layout_suspend(struct device *dev) { struct layout_dev *ldev = dev_get_drvdata(dev); @@ -1147,11 +1143,9 @@ static int aoa_fabric_layout_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(aoa_fabric_layout_pm_ops, +static DEFINE_SIMPLE_DEV_PM_OPS(aoa_fabric_layout_pm_ops, aoa_fabric_layout_suspend, aoa_fabric_layout_resume); -#endif - static struct soundbus_driver aoa_soundbus_driver = { .name = "snd_aoa_soundbus_drv", .owner = THIS_MODULE, @@ -1159,9 +1153,7 @@ static struct soundbus_driver aoa_soundbus_driver = { .remove = aoa_fabric_layout_remove, .driver = { .owner = THIS_MODULE, -#ifdef CONFIG_PM_SLEEP .pm = &aoa_fabric_layout_pm_ops, -#endif } }; |
