Lines Matching +full:light +full:- +full:to +full:- +full:digital
1 // SPDX-License-Identifier: GPL-2.0-or-later
7 Copyright (C) 2005-2008 Auvitek International, Ltd.
35 struct i2c_msg msg = { .addr = state->config.demod_address, in au8522_writereg()
38 ret = i2c_transfer(state->i2c, &msg, 1); in au8522_writereg()
44 return (ret != 1) ? -1 : 0; in au8522_writereg()
55 { .addr = state->config.demod_address, .flags = 0, in au8522_readreg()
57 { .addr = state->config.demod_address, .flags = I2C_M_RD, in au8522_readreg()
60 ret = i2c_transfer(state->i2c, msg, 2); in au8522_readreg()
71 struct au8522_state *state = fe->demodulator_priv; in au8522_i2c_gate_ctrl()
75 if (state->operational_mode == AU8522_ANALOG_MODE) { in au8522_i2c_gate_ctrl()
76 /* We're being asked to manage the gate even though we're in au8522_i2c_gate_ctrl()
77 not in digital mode. This can occur if we get switched in au8522_i2c_gate_ctrl()
78 over to analog mode before the dvb_frontend kernel thread in au8522_i2c_gate_ctrl()
92 struct au8522_state *state = fe->demodulator_priv; in au8522_analog_i2c_gate_ctrl()
104 to a default state. */
131 struct au8522_led_config *led_config = state->config.led_cfg; in au8522_led_gpio_enable()
135 if (!led_config || !led_config->gpio_output || in au8522_led_gpio_enable()
136 !led_config->gpio_output_enable || !led_config->gpio_output_disable) in au8522_led_gpio_enable()
140 (led_config->gpio_output & ~0xc000)); in au8522_led_gpio_enable()
143 val &= ~((led_config->gpio_output_enable >> 8) & 0xff); in au8522_led_gpio_enable()
144 val |= (led_config->gpio_output_enable & 0xff); in au8522_led_gpio_enable()
147 val &= ~((led_config->gpio_output_disable >> 8) & 0xff); in au8522_led_gpio_enable()
148 val |= (led_config->gpio_output_disable & 0xff); in au8522_led_gpio_enable()
151 (led_config->gpio_output & ~0xc000), val); in au8522_led_gpio_enable()
157 * led < 0 | only light led if leds are currently off
161 struct au8522_led_config *led_config = state->config.led_cfg; in au8522_led_ctrl()
165 if (!led_config || !led_config->gpio_leds || in au8522_led_ctrl()
166 !led_config->num_led_states || !led_config->led_states) in au8522_led_ctrl()
170 /* if LED is already lit, then leave it as-is */ in au8522_led_ctrl()
171 if (state->led_state) in au8522_led_ctrl()
174 led *= -1; in au8522_led_ctrl()
178 if (state->led_state != led) { in au8522_led_ctrl()
186 (led_config->gpio_leds & ~0xc000)); in au8522_led_ctrl()
189 for (i = 0; i < led_config->num_led_states; i++) in au8522_led_ctrl()
190 val &= ~led_config->led_states[i]; in au8522_led_ctrl()
193 if (led < led_config->num_led_states) in au8522_led_ctrl()
194 val |= led_config->led_states[led]; in au8522_led_ctrl()
195 else if (led_config->num_led_states) in au8522_led_ctrl()
197 led_config->led_states[led_config->num_led_states - 1]; in au8522_led_ctrl()
200 (led_config->gpio_leds & ~0xc000), val); in au8522_led_ctrl()
204 state->led_state = led; in au8522_led_ctrl()
216 struct au8522_state *state = fe->demodulator_priv; in au8522_init()
219 state->operational_mode = AU8522_DIGITAL_MODE; in au8522_init()
221 /* Clear out any state associated with the digital side of the in au8522_init()
224 state->current_frequency = 0; in au8522_init()
225 state->current_modulation = VSB_8; in au8522_init()
237 struct au8522_state *state = fe->demodulator_priv; in au8522_sleep()
240 /* Only power down if the digital side is currently using the chip */ in au8522_sleep()
241 if (state->operational_mode == AU8522_ANALOG_MODE) { in au8522_sleep()
243 that the DVB thread is probably telling us to go to sleep in au8522_sleep()
255 state->current_frequency = 0; in au8522_sleep()
264 MODULE_DESCRIPTION("Auvitek AU8522 QAM-B/ATSC Demodulator driver");