A consumer is the device that actually uses PWM channels. A PWM channel is represented in the kernel as an instance of the struct pwm_device structure:
struct pwm_device {
const char *label;
unsigned long flags;
unsigned int hwpwm;
unsigned int pwm;
struct pwm_chip *chip;
void *chip_data;
unsigned int period; /* in nanoseconds */
unsigned int duty_cycle; /* in nanoseconds */
enum pwm_polarity polarity;
};
- Label: This is the name of this PWM device
- Flags: This represents the flags associated with the PWM device
- hwpw: This is a relative index of the PWM device, local to the chip
- pwm: This is a system global index of the PWM device
- chip: This is a PWM chip, the controller providing this PWM device
- chip_data: This is chip-private data associated with this PWM device
Since kernel v4.7, the structure changed to:
...