alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Bard Liao <bardliao@realtek.com>,
	Oder Chiou <oder_chiou@realtek.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	alsa-devel@alsa-project.org, Takashi Iwai <tiwai@suse.com>
Subject: [PATCH 03/19] ASoC: rt5640: Remove unused rt5640_platform_data
Date: Tue,  8 May 2018 17:35:48 +0200	[thread overview]
Message-ID: <20180508153604.23711-4-hdegoede@redhat.com> (raw)
In-Reply-To: <20180508153604.23711-1-hdegoede@redhat.com>

There are no in tree users of platform-data for the rt5640 codec driver,
so lets remove support for it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 include/sound/rt5640.h    | 27 --------------------
 sound/soc/codecs/rt5640.c | 53 ++++++++++++---------------------------
 sound/soc/codecs/rt5640.h |  3 +--
 3 files changed, 17 insertions(+), 66 deletions(-)
 delete mode 100644 include/sound/rt5640.h

diff --git a/include/sound/rt5640.h b/include/sound/rt5640.h
deleted file mode 100644
index e3c84b92ff70..000000000000
--- a/include/sound/rt5640.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * linux/sound/rt5640.h -- Platform data for RT5640
- *
- * Copyright 2011 Realtek Microelectronics
- *
- * 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
- * published by the Free Software Foundation.
- */
-
-#ifndef __LINUX_SND_RT5640_H
-#define __LINUX_SND_RT5640_H
-
-struct rt5640_platform_data {
-	/* IN1 & IN2 & IN3 can optionally be differential */
-	bool in1_diff;
-	bool in2_diff;
-	bool in3_diff;
-
-	bool dmic_en;
-	bool dmic1_data_pin; /* 0 = IN1P; 1 = GPIO3 */
-	bool dmic2_data_pin; /* 0 = IN1N; 1 = GPIO4 */
-
-	int ldo1_en; /* GPIO for LDO1_EN */
-};
-
-#endif
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
index 140bad07429e..616f0a69b850 100644
--- a/sound/soc/codecs/rt5640.c
+++ b/sound/soc/codecs/rt5640.c
@@ -2138,10 +2138,6 @@ static int rt5640_probe(struct snd_soc_component *component)
 		return -ENODEV;
 	}
 
-	if (rt5640->pdata.dmic_en)
-		rt5640_dmic_enable(component, rt5640->pdata.dmic1_data_pin,
-					  rt5640->pdata.dmic2_data_pin);
-
 	return 0;
 }
 
@@ -2159,8 +2155,8 @@ static int rt5640_suspend(struct snd_soc_component *component)
 	rt5640_reset(component);
 	regcache_cache_only(rt5640->regmap, true);
 	regcache_mark_dirty(rt5640->regmap);
-	if (gpio_is_valid(rt5640->pdata.ldo1_en))
-		gpio_set_value_cansleep(rt5640->pdata.ldo1_en, 0);
+	if (gpio_is_valid(rt5640->ldo1_en))
+		gpio_set_value_cansleep(rt5640->ldo1_en, 0);
 
 	return 0;
 }
@@ -2169,8 +2165,8 @@ static int rt5640_resume(struct snd_soc_component *component)
 {
 	struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component);
 
-	if (gpio_is_valid(rt5640->pdata.ldo1_en)) {
-		gpio_set_value_cansleep(rt5640->pdata.ldo1_en, 1);
+	if (gpio_is_valid(rt5640->ldo1_en)) {
+		gpio_set_value_cansleep(rt5640->ldo1_en, 1);
 		msleep(400);
 	}
 
@@ -2302,22 +2298,16 @@ MODULE_DEVICE_TABLE(acpi, rt5640_acpi_match);
 
 static int rt5640_parse_dt(struct rt5640_priv *rt5640, struct device_node *np)
 {
-	rt5640->pdata.in1_diff = of_property_read_bool(np,
-					"realtek,in1-differential");
-	rt5640->pdata.in2_diff = of_property_read_bool(np,
-					"realtek,in2-differential");
-
-	rt5640->pdata.ldo1_en = of_get_named_gpio(np,
-					"realtek,ldo1-en-gpios", 0);
+	rt5640->ldo1_en = of_get_named_gpio(np, "realtek,ldo1-en-gpios", 0);
 	/*
 	 * LDO1_EN is optional (it may be statically tied on the board).
 	 * -ENOENT means that the property doesn't exist, i.e. there is no
 	 * GPIO, so is not an error. Any other error code means the property
 	 * exists, but could not be parsed.
 	 */
-	if (!gpio_is_valid(rt5640->pdata.ldo1_en) &&
-			(rt5640->pdata.ldo1_en != -ENOENT))
-		return rt5640->pdata.ldo1_en;
+	if (!gpio_is_valid(rt5640->ldo1_en) &&
+			(rt5640->ldo1_en != -ENOENT))
+		return rt5640->ldo1_en;
 
 	return 0;
 }
@@ -2325,7 +2315,6 @@ static int rt5640_parse_dt(struct rt5640_priv *rt5640, struct device_node *np)
 static int rt5640_i2c_probe(struct i2c_client *i2c,
 		    const struct i2c_device_id *id)
 {
-	struct rt5640_platform_data *pdata = dev_get_platdata(&i2c->dev);
 	struct rt5640_priv *rt5640;
 	int ret;
 	unsigned int val;
@@ -2337,22 +2326,12 @@ static int rt5640_i2c_probe(struct i2c_client *i2c,
 		return -ENOMEM;
 	i2c_set_clientdata(i2c, rt5640);
 
-	if (pdata) {
-		rt5640->pdata = *pdata;
-		/*
-		 * Translate zero'd out (default) pdata value to an invalid
-		 * GPIO ID. This makes the pdata and DT paths consistent in
-		 * terms of the value left in this field when no GPIO is
-		 * specified, but means we can't actually use GPIO 0.
-		 */
-		if (!rt5640->pdata.ldo1_en)
-			rt5640->pdata.ldo1_en = -EINVAL;
-	} else if (i2c->dev.of_node) {
+	if (i2c->dev.of_node) {
 		ret = rt5640_parse_dt(rt5640, i2c->dev.of_node);
 		if (ret)
 			return ret;
 	} else
-		rt5640->pdata.ldo1_en = -EINVAL;
+		rt5640->ldo1_en = -EINVAL;
 
 	rt5640->regmap = devm_regmap_init_i2c(i2c, &rt5640_regmap);
 	if (IS_ERR(rt5640->regmap)) {
@@ -2362,13 +2341,13 @@ static int rt5640_i2c_probe(struct i2c_client *i2c,
 		return ret;
 	}
 
-	if (gpio_is_valid(rt5640->pdata.ldo1_en)) {
-		ret = devm_gpio_request_one(&i2c->dev, rt5640->pdata.ldo1_en,
+	if (gpio_is_valid(rt5640->ldo1_en)) {
+		ret = devm_gpio_request_one(&i2c->dev, rt5640->ldo1_en,
 					    GPIOF_OUT_INIT_HIGH,
 					    "RT5640 LDO1_EN");
 		if (ret < 0) {
 			dev_err(&i2c->dev, "Failed to request LDO1_EN %d: %d\n",
-				rt5640->pdata.ldo1_en, ret);
+				rt5640->ldo1_en, ret);
 			return ret;
 		}
 		msleep(400);
@@ -2391,15 +2370,15 @@ static int rt5640_i2c_probe(struct i2c_client *i2c,
 	regmap_update_bits(rt5640->regmap, RT5640_DUMMY1,
 				RT5640_MCLK_DET, RT5640_MCLK_DET);
 
-	if (rt5640->pdata.in1_diff)
+	if (device_property_read_bool(&i2c->dev, "realtek,in1-differential"))
 		regmap_update_bits(rt5640->regmap, RT5640_IN1_IN2,
 					RT5640_IN_DF1, RT5640_IN_DF1);
 
-	if (rt5640->pdata.in2_diff)
+	if (device_property_read_bool(&i2c->dev, "realtek,in2-differential"))
 		regmap_update_bits(rt5640->regmap, RT5640_IN3_IN4,
 					RT5640_IN_DF2, RT5640_IN_DF2);
 
-	if (rt5640->pdata.in3_diff)
+	if (device_property_read_bool(&i2c->dev, "realtek,in3-differential"))
 		regmap_update_bits(rt5640->regmap, RT5640_IN1_IN2,
 					RT5640_IN_DF2, RT5640_IN_DF2);
 
diff --git a/sound/soc/codecs/rt5640.h b/sound/soc/codecs/rt5640.h
index c473e8ae2eda..2db6586f5ab4 100644
--- a/sound/soc/codecs/rt5640.h
+++ b/sound/soc/codecs/rt5640.h
@@ -13,7 +13,6 @@
 #define _RT5640_H
 
 #include <linux/clk.h>
-#include <sound/rt5640.h>
 
 /* Info */
 #define RT5640_RESET				0x00
@@ -2103,10 +2102,10 @@ enum {
 
 struct rt5640_priv {
 	struct snd_soc_component *component;
-	struct rt5640_platform_data pdata;
 	struct regmap *regmap;
 	struct clk *mclk;
 
+	int ldo1_en; /* GPIO for LDO1_EN */
 	int sysclk;
 	int sysclk_src;
 	int lrck[RT5640_AIFS];
-- 
2.17.0

  parent reply	other threads:[~2018-05-08 15:36 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-08 15:35 [PATCH 00/19] ASoC: rt5640: Add jack-detect and button-press support Hans de Goede
2018-05-08 15:35 ` [PATCH 01/19] ASoC: rt5640: Remove is_sys_clk_from_pll, it has ordering issues Hans de Goede
2018-05-08 15:35 ` [PATCH 02/19] ASoC: rt5640: Add devicetree-bindings for dmic, jack-detect Hans de Goede
2018-05-08 15:35 ` Hans de Goede [this message]
2018-05-11  2:16   ` [PATCH 03/19] ASoC: rt5640: Remove unused rt5640_platform_data Mark Brown
2018-05-11  2:52   ` Applied "ASoC: rt5640: Remove unused rt5640_platform_data" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 04/19] ASoC: rt5640: Move checking of device-properties to component probe callback Hans de Goede
2018-05-11  2:51   ` Applied "ASoC: rt5640: Move checking of device-properties to component probe callback" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 05/19] ASoC: rt5640: Allow specifying dmic data pins through device-properties Hans de Goede
2018-05-11  2:51   ` Applied "ASoC: rt5640: Allow specifying dmic data pins through device-properties" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 06/19] ASoC: rt5640: Add jack-detect support Hans de Goede
2018-05-11  2:50   ` Applied "ASoC: rt5640: Add jack-detect support" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 07/19] ASoC: rt5640: Add button press support Hans de Goede
2018-05-11  2:50   ` Applied "ASoC: rt5640: Add button press support" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 08/19] ASoC: Intel: bytcr_rt5640: Configure PLL1 before using it Hans de Goede
2018-05-11  2:48   ` Applied "ASoC: Intel: bytcr_rt5640: Configure PLL1 before using it" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 09/19] ASoC: Intel: bytcr_rt5640: Use device-property for differential mics Hans de Goede
2018-05-11  2:48   ` Applied "ASoC: Intel: bytcr_rt5640: Use device-property for differential mics" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 10/19] ASoC: Intel: bytcr_rt5640: Use device properties for setting up dmic Hans de Goede
2018-05-11  2:25   ` Mark Brown
2018-05-08 15:35 ` [PATCH 11/19] ASoC: Intel: bytcr_rt5640: Fix Dell Venue 8 5830 Pro quirk Hans de Goede
2018-05-17 16:39   ` Applied "ASoC: Intel: bytcr_rt5640: Fix Dell Venue 8 5830 Pro quirk" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 12/19] ASoC: Intel: bytcr_rt5640: Enable jack detection Hans de Goede
2018-05-17 16:39   ` Applied "ASoC: Intel: bytcr_rt5640: Enable jack detection" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 13/19] ASoC: Intel: bytcr_rt5640: Change BYTCR default input to IN3 Hans de Goede
2018-05-17 16:39   ` Applied "ASoC: Intel: bytcr_rt5640: Change BYTCR default input to IN3" to the asoc tree Mark Brown
2018-05-08 15:35 ` [PATCH 14/19] ASoC: Intel: bytcr_rt5640: Unify BYTCR input defaults Hans de Goede
2018-05-17 16:39   ` Applied "ASoC: Intel: bytcr_rt5640: Unify BYTCR input defaults" to the asoc tree Mark Brown
2018-05-08 15:36 ` [PATCH 15/19] ASoC: Intel: bytcr_rt5640: Add default jack-detect settings Hans de Goede
2018-05-17 16:39   ` Applied "ASoC: Intel: bytcr_rt5640: Add default jack-detect settings" to the asoc tree Mark Brown
2018-05-08 15:36 ` [PATCH 16/19] ASoC: Intel: bytcr_rt5640: Sort DMI quirk list alphabetically Hans de Goede
2018-05-17 16:39   ` Applied "ASoC: Intel: bytcr_rt5640: Sort DMI quirk list alphabetically" to the asoc tree Mark Brown
2018-05-08 15:36 ` [PATCH 17/19] ASoC: Intel: bytcr_rt5640: Use dmi_first_match() for DMI quirk handling Hans de Goede
2018-05-17 16:38   ` Applied "ASoC: Intel: bytcr_rt5640: Use dmi_first_match() for DMI quirk handling" to the asoc tree Mark Brown
2018-05-08 15:36 ` [PATCH 18/19] ASoC: Intel: bytcr_rt5640: Add quirks for various devices Hans de Goede
2018-05-08 15:36 ` [PATCH 19/19] ASoC: Intel: bytcr_rt5640: Set card long_name based on quirks Hans de Goede
2018-05-08 18:35   ` Pierre-Louis Bossart
2018-05-10 10:27     ` Hans de Goede
2018-05-10 15:00       ` Pierre-Louis Bossart
2018-05-10 15:48         ` Hans de Goede
2018-05-10 17:46           ` Pierre-Louis Bossart
2018-05-10 18:01             ` Hans de Goede
2018-05-12 21:21               ` Pierre-Louis Bossart
2018-05-13  7:11                 ` Takashi Iwai
2018-05-13  7:28                   ` Hans de Goede
2018-05-18 15:55           ` Hans de Goede
2018-05-18 16:21             ` Pierre-Louis Bossart
2018-05-17 16:38   ` Applied "ASoC: Intel: bytcr_rt5640: Set card long_name based on quirks" to the asoc tree Mark Brown
2018-05-08 18:42 ` [PATCH 00/19] ASoC: rt5640: Add jack-detect and button-press support Pierre-Louis Bossart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180508153604.23711-4-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bardliao@realtek.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=oder_chiou@realtek.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).