lkml.org 
[lkml]   [2018]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC PATCH 1/9] leds: add TI LMU backlight driver
    * Dan Murphy <dmurphy@ti.com> [180926 13:14]:
    > --- /dev/null
    > +++ b/drivers/leds/ti-lmu-led-common.c
    > +static int ti_lmu_common_enable(struct ti_lmu_bank *lmu_bank, bool enable)
    > +{
    > + struct regmap *regmap = lmu_bank->regmap;
    > + unsigned long enable_time = lmu_bank->enable_usec;
    > + u8 reg = lmu_bank->enable_reg;
    > + u8 mask = BIT(lmu_bank->bank_id);
    > + u8 val = (enable == true) ? mask : 0;
    > + int ret;
    > +
    > + return 0;

    Hmm this early return probably needs to be left out on real hardawre?

    > + if (!reg)
    > + return -EINVAL;
    > +
    > + ret = regmap_update_bits(regmap, reg, mask, val);
    > + if (ret)
    > + return ret;
    > +
    > + if (enable_time > 0)
    > + usleep_range(enable_time, enable_time + 100);
    > +
    > + return 0;
    > +}

    Regards,

    Tony

    \
     
     \ /
      Last update: 2018-09-26 17:02    [W:4.493 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site