ASoC: Merge branch 'for-2.6.39' into for-2.6.40
[firefly-linux-kernel-4.4.55.git] / sound / soc / soc-cache.c
index 22b099076223b3a7473f24100d120b5efd9e1301..f46a198a48c0928f847ccf5458f99f893fe95be8 100644 (file)
@@ -245,7 +245,6 @@ static unsigned int do_i2c_read(struct snd_soc_codec *codec,
        xfer[1].buf = data;
 
        ret = i2c_transfer(client->adapter, xfer, 2);
-       dev_err(&client->dev, "i2c_transfer() returned %d\n", ret);
        if (ret == 2)
                return 0;
        else if (ret < 0)
@@ -394,10 +393,11 @@ static int snd_soc_16_16_spi_write(void *control_data, const char *data,
 #define snd_soc_16_16_spi_write NULL
 #endif
 
-/* Primitive bulk write support for soc-cache.  The data pointed to by `data' needs
- * to already be in the form the hardware expects including any leading register specific
- * data.  Any data written through this function will not go through the cache as it
- * only handles writing to volatile or out of bounds registers.
+/* Primitive bulk write support for soc-cache.  The data pointed to by
+ * `data' needs to already be in the form the hardware expects
+ * including any leading register specific data.  Any data written
+ * through this function will not go through the cache as it only
+ * handles writing to volatile or out of bounds registers.
  */
 static int snd_soc_hw_bulk_write_raw(struct snd_soc_codec *codec, unsigned int reg,
                                     const void *data, size_t len)
@@ -414,12 +414,16 @@ static int snd_soc_hw_bulk_write_raw(struct snd_soc_codec *codec, unsigned int r
                return -EINVAL;
 
        switch (codec->control_type) {
+#if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
        case SND_SOC_I2C:
                ret = i2c_master_send(codec->control_data, data, len);
                break;
+#endif
+#if defined(CONFIG_SPI_MASTER)
        case SND_SOC_SPI:
                ret = do_spi_write(codec->control_data, data, len);
                break;
+#endif
        default:
                BUG();
        }