Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7361ec4 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: Replace pdev with card in machine driver probe and remove



In order to support cards instantiated without using soc-audio remove
the use of the platform device in the card probe() and remove() ops.

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 70b2ac12
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -649,8 +649,8 @@ struct snd_soc_card {

	bool instantiated;

	int (*probe)(struct platform_device *pdev);
	int (*remove)(struct platform_device *pdev);
	int (*probe)(struct snd_soc_card *card);
	int (*remove)(struct snd_soc_card *card);

	/* the pre and post PM functions are used to do any PM work before and
	 * after the codec and DAI's do any PM work. */
+2 −4
Original line number Diff line number Diff line
@@ -53,9 +53,8 @@ struct mpc8610_hpcd_data {
 *
 * Here we program the DMACR and PMUXCR registers.
 */
static int mpc8610_hpcd_machine_probe(struct platform_device *sound_device)
static int mpc8610_hpcd_machine_probe(struct snd_soc_card *card)
{
	struct snd_soc_card *card = platform_get_drvdata(sound_device);
	struct mpc8610_hpcd_data *machine_data =
		container_of(card, struct mpc8610_hpcd_data, card);
	struct ccsr_guts_86xx __iomem *guts;
@@ -138,9 +137,8 @@ static int mpc8610_hpcd_startup(struct snd_pcm_substream *substream)
 * This function is called to remove the sound device for one SSI.  We
 * de-program the DMACR and PMUXCR register.
 */
static int mpc8610_hpcd_machine_remove(struct platform_device *sound_device)
static int mpc8610_hpcd_machine_remove(struct snd_soc_card *card)
{
	struct snd_soc_card *card = platform_get_drvdata(sound_device);
	struct mpc8610_hpcd_data *machine_data =
		container_of(card, struct mpc8610_hpcd_data, card);
	struct ccsr_guts_86xx __iomem *guts;
+2 −4
Original line number Diff line number Diff line
@@ -85,9 +85,8 @@ struct machine_data {
 *
 * Here we program the DMACR and PMUXCR registers.
 */
static int p1022_ds_machine_probe(struct platform_device *sound_device)
static int p1022_ds_machine_probe(struct snd_soc_card *card)
{
	struct snd_soc_card *card = platform_get_drvdata(sound_device);
	struct machine_data *mdata =
		container_of(card, struct machine_data, card);
	struct ccsr_guts_85xx __iomem *guts;
@@ -160,9 +159,8 @@ static int p1022_ds_startup(struct snd_pcm_substream *substream)
 * This function is called to remove the sound device for one SSI.  We
 * de-program the DMACR and PMUXCR register.
 */
static int p1022_ds_machine_remove(struct platform_device *sound_device)
static int p1022_ds_machine_remove(struct snd_soc_card *card)
{
	struct snd_soc_card *card = platform_get_drvdata(sound_device);
	struct machine_data *mdata =
		container_of(card, struct machine_data, card);
	struct ccsr_guts_85xx __iomem *guts;
+2 −2
Original line number Diff line number Diff line
@@ -237,7 +237,7 @@ static struct snd_soc_dai_link tosa_dai[] = {
},
};

static int tosa_probe(struct platform_device *dev)
static int tosa_probe(struct snd_soc_card *card)
{
	int ret;

@@ -251,7 +251,7 @@ static int tosa_probe(struct platform_device *dev)
	return ret;
}

static int tosa_remove(struct platform_device *dev)
static int tosa_remove(struct snd_soc_card *card)
{
	gpio_free(TOSA_GPIO_L_MUTE);
	return 0;
+2 −2
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ static struct snd_soc_dai_link zylonite_dai[] = {
},
};

static int zylonite_probe(struct platform_device *pdev)
static int zylonite_probe(struct snd_soc_card *card)
{
	int ret;

@@ -216,7 +216,7 @@ static int zylonite_probe(struct platform_device *pdev)
	return 0;
}

static int zylonite_remove(struct platform_device *pdev)
static int zylonite_remove(struct snd_soc_card *card)
{
	if (clk_pout) {
		clk_disable(pout);
Loading