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)
#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)
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();
}