Merge tag 'ntb-4.3' of git://github.com/jonmason/ntb
[deliverable/linux.git] / sound / soc / codecs / cs4349.c
index a6604a34db347769dca3b1806a8080ce10288c36..0ac8fc5ed4ae4ac23940d19fce9079a52b0f0976 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 #include <linux/platform_device.h>
 #include <linux/pm.h>
 #include <linux/i2c.h>
@@ -45,7 +46,6 @@ static const struct reg_default cs4349_reg_defaults[] = {
 /* Private data for the CS4349 */
 struct  cs4349_private {
        struct regmap                   *regmap;
-       struct cs4349_platform_data     pdata;
        struct gpio_desc                *reset_gpio;
        unsigned int                    mode;
        int                             rate;
@@ -281,8 +281,7 @@ static int cs4349_i2c_probe(struct i2c_client *client,
                                      const struct i2c_device_id *id)
 {
        struct cs4349_private *cs4349;
-       struct cs4349_platform_data *pdata = dev_get_platdata(&client->dev);
-       int ret = 0;
+       int ret;
 
        cs4349 = devm_kzalloc(&client->dev, sizeof(*cs4349), GFP_KERNEL);
        if (!cs4349)
@@ -295,17 +294,13 @@ static int cs4349_i2c_probe(struct i2c_client *client,
                return ret;
        }
 
-       if (pdata)
-               cs4349->pdata = *pdata;
-
        /* Reset the Device */
        cs4349->reset_gpio = devm_gpiod_get_optional(&client->dev,
                "reset", GPIOD_OUT_LOW);
        if (IS_ERR(cs4349->reset_gpio))
                return PTR_ERR(cs4349->reset_gpio);
 
-       if (cs4349->reset_gpio)
-               gpiod_set_value_cansleep(cs4349->reset_gpio, 1);
+       gpiod_set_value_cansleep(cs4349->reset_gpio, 1);
 
        i2c_set_clientdata(client, cs4349);
 
@@ -320,8 +315,7 @@ static int cs4349_i2c_remove(struct i2c_client *client)
        snd_soc_unregister_codec(&client->dev);
 
        /* Hold down reset */
-       if (cs4349->reset_gpio)
-               gpiod_set_value_cansleep(cs4349->reset_gpio, 0);
+       gpiod_set_value_cansleep(cs4349->reset_gpio, 0);
 
        return 0;
 }
@@ -332,15 +326,14 @@ static int cs4349_runtime_suspend(struct device *dev)
        struct cs4349_private *cs4349 = dev_get_drvdata(dev);
        int ret;
 
-       ret = regmap_update_bits(cs4349->regmap, CS4349_MISC, PWR_DWN, 1);
+       ret = regmap_update_bits(cs4349->regmap, CS4349_MISC, PWR_DWN, PWR_DWN);
        if (ret < 0)
                return ret;
 
        regcache_cache_only(cs4349->regmap, true);
 
        /* Hold down reset */
-       if (cs4349->reset_gpio)
-               gpiod_set_value_cansleep(cs4349->reset_gpio, 0);
+       gpiod_set_value_cansleep(cs4349->reset_gpio, 0);
 
        return 0;
 }
@@ -354,8 +347,7 @@ static int cs4349_runtime_resume(struct device *dev)
        if (ret < 0)
                return ret;
 
-       if (cs4349->reset_gpio)
-               gpiod_set_value_cansleep(cs4349->reset_gpio, 1);
+       gpiod_set_value_cansleep(cs4349->reset_gpio, 1);
 
        regcache_cache_only(cs4349->regmap, false);
        regcache_sync(cs4349->regmap);
@@ -386,7 +378,6 @@ MODULE_DEVICE_TABLE(i2c, cs4349_i2c_id);
 static struct i2c_driver cs4349_i2c_driver = {
        .driver = {
                .name           = "cs4349",
-               .owner          = THIS_MODULE,
                .of_match_table = cs4349_of_match,
        },
        .id_table       = cs4349_i2c_id,
This page took 0.057689 seconds and 5 git commands to generate.