lkml.org 
[lkml]   [2019]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v8 4/6] pwm: add push-pull mode support
    Date
    From: Claudiu Beznea <claudiu.beznea@microchip.com>

    Add push-pull mode support. In push-pull mode the channels' outputs have
    same polarities and the edges are complementary delayed for one period.

    Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
    ---
    drivers/pwm/core.c | 3 +++
    include/linux/pwm.h | 3 +++
    2 files changed, 6 insertions(+)

    diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
    index eb444ee8d486..f182d1eb564e 100644
    --- a/drivers/pwm/core.c
    +++ b/drivers/pwm/core.c
    @@ -328,6 +328,9 @@ const char *pwm_get_mode_name(unsigned long modebit)
    if (modebit == PWM_MODE_BIT(COMPLEMENTARY))
    return "complementary";

    + if (modebit == PWM_MODE_BIT(PUSH_PULL))
    + return "push-pull";
    +
    return "normal";
    }

    diff --git a/include/linux/pwm.h b/include/linux/pwm.h
    index 3d89343bc405..629754902ab0 100644
    --- a/include/linux/pwm.h
    +++ b/include/linux/pwm.h
    @@ -29,11 +29,14 @@ enum pwm_polarity {
    * PWM modes capabilities
    * @PWM_MODE_NORMAL: PWM has one output
    * @PWM_MODE_COMPLEMENTARY: PWM has 2 outputs with opposite polarities
    + * @PWM_MODE_PUSH_PULL: PWM has 2 outputs with same polarities and the edges
    + * are complementary delayed for one period
    * @PWM_MODE_CNT: PWM modes count
    */
    enum pwm_mode {
    PWM_MODE_NORMAL,
    PWM_MODE_COMPLEMENTARY,
    + PWM_MODE_PUSH_PULL,
    PWM_MODE_CNT,
    };

    --
    2.7.4
    \
     
     \ /
      Last update: 2019-01-03 14:31    [W:3.327 / U:0.208 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site