Lines Matching +full:activate +full:- +full:to +full:- +full:activate
4 * Copyright (C) 2005 T. Adachi <tadachi@tadachi-net.com>
7 * - Cleanup
20 * along with this program; if not, write to the Free Software
31 #include <media/v4l2-device.h>
32 #include <media/v4l2-chip-ident.h>
33 #include <media/v4l2-ctrls.h>
43 MODULE_PARM_DESC(debug, "Debug level (0-1)");
46 /* ------------------------------------------------------------------------ */
73 return &container_of(ctrl->handler, struct wm8739_state, hdl)->sd; in to_sd()
76 /* ------------------------------------------------------------------------ */
85 return -1; in wm8739_write()
94 v4l2_err(sd, "I2C: cannot write %03x to register R%d\n", val, reg); in wm8739_write()
95 return -1; in wm8739_write()
103 u8 vol_l; /* +12dB to -34.5dB 1.5dB step (5bit) def:0dB */ in wm8739_s_ctrl()
104 u8 vol_r; /* +12dB to -34.5dB 1.5dB step (5bit) def:0dB */ in wm8739_s_ctrl()
107 switch (ctrl->id) { in wm8739_s_ctrl()
112 return -EINVAL; in wm8739_s_ctrl()
115 /* normalize ( 65535 to 0 -> 31 to 0 (12dB to -34.5dB) ) */ in wm8739_s_ctrl()
116 work_l = (min(65536 - state->balance->val, 32768) * state->volume->val) / 32768; in wm8739_s_ctrl()
117 work_r = (min(state->balance->val, 32768) * state->volume->val) / 32768; in wm8739_s_ctrl()
123 mute = state->mute->val ? 0x80 : 0; in wm8739_s_ctrl()
125 /* Volume setting: bits 0-4, 0x1f = 12 dB, 0x00 = -34.5 dB in wm8739_s_ctrl()
133 /* ------------------------------------------------------------------------ */
139 state->clock_freq = audiofreq; in wm8739_s_clock_freq()
140 /* de-activate */ in wm8739_s_clock_freq()
158 /* activate */ in wm8739_s_clock_freq()
174 v4l2_info(sd, "Frequency: %u Hz\n", state->clock_freq); in wm8739_log_status()
175 v4l2_ctrl_handler_log_status(&state->hdl, sd->name); in wm8739_log_status()
179 /* ----------------------------------------------------------------------- */
206 /* ------------------------------------------------------------------------ */
217 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) in wm8739_probe()
218 return -EIO; in wm8739_probe()
221 client->addr << 1, client->adapter->name); in wm8739_probe()
225 return -ENOMEM; in wm8739_probe()
226 sd = &state->sd; in wm8739_probe()
228 v4l2_ctrl_handler_init(&state->hdl, 2); in wm8739_probe()
229 state->volume = v4l2_ctrl_new_std(&state->hdl, &wm8739_ctrl_ops, in wm8739_probe()
231 state->mute = v4l2_ctrl_new_std(&state->hdl, &wm8739_ctrl_ops, in wm8739_probe()
233 state->balance = v4l2_ctrl_new_std(&state->hdl, &wm8739_ctrl_ops, in wm8739_probe()
235 sd->ctrl_handler = &state->hdl; in wm8739_probe()
236 if (state->hdl.error) { in wm8739_probe()
237 int err = state->hdl.error; in wm8739_probe()
239 v4l2_ctrl_handler_free(&state->hdl); in wm8739_probe()
243 v4l2_ctrl_cluster(3, &state->volume); in wm8739_probe()
245 state->clock_freq = 48000; in wm8739_probe()
260 /* activate */ in wm8739_probe()
263 v4l2_ctrl_handler_setup(&state->hdl); in wm8739_probe()
273 v4l2_ctrl_handler_free(&state->hdl); in wm8739_remove()