struct pwm_ops
Prev | Chapter 13. Pulse-Width Modulation (PWM) | Next

## Name

struct pwm_ops — PWM controller operations

## Synopsis

    struct pwm_ops {
      int (* request) (struct pwm_chip *chip, struct pwm_device *pwm);
      void (* free) (struct pwm_chip *chip, struct pwm_device *pwm);
      int (* config) (struct pwm_chip *chip, struct pwm_device *pwm,int duty_ns, int period_ns);
      int (* set_polarity) (struct pwm_chip *chip, struct pwm_device *pwm,enum pwm_polarity polarity);
      int (* enable) (struct pwm_chip *chip, struct pwm_device *pwm);
      void (* disable) (struct pwm_chip *chip, struct pwm_device *pwm);
    #ifdef CONFIG_DEBUG_FS
      void (* dbg_show) (struct pwm_chip *chip, struct seq_file *s);
    #endif
      struct module * owner;
    };

## Members

request

  optional hook for requesting a PWM

free

  optional hook for freeing a PWM

config

  configure duty cycles and period length for this PWM

set_polarity

  configure the polarity of this PWM

enable

  enable PWM output toggling

disable

  disable PWM output toggling

dbg_show

  optional routine to show contents in debugfs

owner

  helps prevent removal of modules exporting active PWMs

Prev | Up | Next
struct pwm_device | Home | struct pwm_chip