/*
* soc-cache.c -- ASoC register cache helpers
*
* Copyright 2009 Wolfson Microelectronics PLC.
*
* Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
#include <linux/i2c.h>
#include <linux/spi/spi.h>
#include <sound/soc.h>
#include <linux/lzo.h>
#include <linux/bitmap.h>
#include <linux/rbtree.h>
#include <trace/events/asoc.h>
#if defined(CONFIG_SPI_MASTER)
static int do_spi_write(void *control_data, const void *msg,
int len)
{
struct spi_device *spi = control_data;
struct spi_transfer t;
struct spi_message m;
if (len <= 0)
return 0;
spi_message_init(&m);
memset(&t, 0, sizeof t);
t.tx_buf = msg;
t.len = len;
spi_message_add_tail(&t, &m);
spi_sync(spi, &m);
return len;
}
#endif
static int do_hw_write(struct snd_soc_codec *codec, unsigned int reg,
unsigned int value, const void *