Lines Matching refs:core
9 #include <linux/mfd/wl1273-core.h>
21 static int wl1273_fm_read_reg(struct wl1273_core *core, u8 reg, u16 *value)
23 struct i2c_client *client = core->client;
38 static int wl1273_fm_write_cmd(struct wl1273_core *core, u8 cmd, u16 param)
40 struct i2c_client *client = core->client;
53 static int wl1273_fm_write_data(struct wl1273_core *core, u8 *data, u16 len)
55 struct i2c_client *client = core->client;
75 * @core: A pointer to the device struct.
80 static int wl1273_fm_set_audio(struct wl1273_core *core, unsigned int new_mode)
84 if (core->mode == WL1273_MODE_OFF ||
85 core->mode == WL1273_MODE_SUSPENDED)
88 if (core->mode == WL1273_MODE_RX && new_mode == WL1273_AUDIO_DIGITAL) {
89 r = wl1273_fm_write_cmd(core, WL1273_PCM_MODE_SET,
94 r = wl1273_fm_write_cmd(core, WL1273_I2S_MODE_CONFIG_SET,
95 core->i2s_mode);
99 r = wl1273_fm_write_cmd(core, WL1273_AUDIO_ENABLE,
104 } else if (core->mode == WL1273_MODE_RX &&
106 r = wl1273_fm_write_cmd(core, WL1273_AUDIO_ENABLE,
111 } else if (core->mode == WL1273_MODE_TX &&
113 r = wl1273_fm_write_cmd(core, WL1273_I2S_MODE_CONFIG_SET,
114 core->i2s_mode);
118 r = wl1273_fm_write_cmd(core, WL1273_AUDIO_IO_SET,
123 } else if (core->mode == WL1273_MODE_TX &&
125 r = wl1273_fm_write_cmd(core, WL1273_AUDIO_IO_SET,
131 core->audio_mode = new_mode;
138 * @core: A pointer to the device struct.
141 static int wl1273_fm_set_volume(struct wl1273_core *core, unsigned int volume)
148 if (core->volume == volume)
151 r = wl1273_fm_write_cmd(core, WL1273_VOLUME_SET, volume);
155 core->volume = volume;
163 struct wl1273_core *core;
180 core = devm_kzalloc(&client->dev, sizeof(*core), GFP_KERNEL);
181 if (!core)
184 core->pdata = pdata;
185 core->client = client;
186 mutex_init(&core->lock);
188 i2c_set_clientdata(client, core);
192 cell = &core->cells[children];
194 cell->platform_data = &core;
195 cell->pdata_size = sizeof(core);
198 core->read = wl1273_fm_read_reg;
199 core->write = wl1273_fm_write_cmd;
200 core->write_data = wl1273_fm_write_data;
201 core->set_audio = wl1273_fm_set_audio;
202 core->set_volume = wl1273_fm_set_volume;
205 cell = &core->cells[children];
209 cell->platform_data = &core;
210 cell->pdata_size = sizeof(core);
217 r = devm_mfd_add_devices(&client->dev, -1, core->cells,