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