Lines Matching +full:multi +full:- +full:channel

4  * SPDX-License-Identifier: Apache-2.0
43 int channel; member
56 const struct pwm_it8801_config *config = dev->config; in pwm_enable()
60 ret = i2c_reg_update_byte_dt(&config->i2c_dev, config->reg_mcr, in pwm_enable()
63 ret = i2c_reg_update_byte_dt(&config->i2c_dev, config->reg_mcr, in pwm_enable()
72 static int pwm_it8801_get_cycles_per_sec(const struct device *dev, uint32_t channel, in pwm_it8801_get_cycles_per_sec() argument
76 ARG_UNUSED(channel); in pwm_it8801_get_cycles_per_sec()
83 static int pwm_it8801_set_cycles(const struct device *dev, uint32_t channel, uint32_t period_cycles, in pwm_it8801_set_cycles() argument
86 ARG_UNUSED(channel); in pwm_it8801_set_cycles()
88 const struct pwm_it8801_config *config = dev->config; in pwm_it8801_set_cycles()
89 int ch = config->channel, ret; in pwm_it8801_set_cycles()
92 /* Enable PWM output push-pull */ in pwm_it8801_set_cycles()
96 ret = i2c_reg_update_byte_dt(&config->i2c_dev, IT8801_REG_PWMODDSR, mask, mask); in pwm_it8801_set_cycles()
98 LOG_ERR("Failed to set push-pull (ret %d)", ret); in pwm_it8801_set_cycles()
103 /* Set PWM channel duty cycle */ in pwm_it8801_set_cycles()
107 duty = pulse_cycles * 256 / period_cycles - 1; in pwm_it8801_set_cycles()
111 ret = i2c_reg_write_byte_dt(&config->i2c_dev, config->reg_dcr, duty); in pwm_it8801_set_cycles()
117 /* PWM channel clock source not gating */ in pwm_it8801_set_cycles()
125 const struct pwm_it8801_config *config = dev->config; in pwm_it8801_init()
128 /* Verify multi-function parent is ready */ in pwm_it8801_init()
129 if (!device_is_ready(config->mfd)) { in pwm_it8801_init()
130 LOG_ERR("(pwm)%s is not ready", config->mfd->name); in pwm_it8801_init()
131 return -ENODEV; in pwm_it8801_init()
134 /* PWM channel clock source gating before configuring */ in pwm_it8801_init()
137 for (int i = 0; i < config->mfdctrl_len; i++) { in pwm_it8801_init()
139 ret = mfd_it8801_configure_pins(&config->i2c_dev, config->altctrl[i].gpiocr, in pwm_it8801_init()
140 config->altctrl[i].pin, in pwm_it8801_init()
141 config->altctrl[i].alt_func); in pwm_it8801_init()
165 .channel = DT_INST_PROP(inst, channel), \