/* Modify the resource, the function returns the content of the register after the modification.  */
static int twl4030_codec_set_resource(enum twl4030_codec_res id, int enable)
/* Modify the resource, the function returns the content of the register after the modification.  */
static int twl4030_codec_set_resource(enum twl4030_codec_res id, int enable)
{
	struct twl4030_codec *codec = platform_get_drvdata(twl4030_codec_dev);
	u8 val;
	twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &val,
			codec->resource[id].reg);
	if (enable)
		val |= codec->resource[id].mask;
	else
		val &= ~codec->resource[id].mask;
	twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE,
					val, codec->resource[id].reg);
	return val;
}