Search Linux Wireless

Re: [PATCH] mt76: mt7615: introduce LED support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>
> On 2019-12-11 15:21, Lorenzo Bianconi wrote:
> > Initialize brightness_set and blink_set callbacks to
> > mt7615_led_set_brightness and mt7615_led_set_blink in order to enable
> > LED support in mt7615 driver
> >

[...]

> >  #define MT_TX_AGG_CNT(n)             MT_WF_MIB(0xa8 + ((n) << 2))
> >
> > +#define MT_LED_BASE_PHYS             0x80024000
> > +#define MT_LED_PHYS(_n)                      (MT_LED_BASE_PHYS + (_n))
> > +
> > +#define MT_LED_CTRL                  MT_LED_PHYS(0x00)
> > +
> > +#define MT_LED_CTRL_REPLAY(_n)               BIT(0 + (8 * (_n)))
> > +#define MT_LED_CTRL_POLARITY(_n)     BIT(1 + (8 * (_n)))
> > +#define MT_LED_CTRL_TX_BLINK_MODE(_n)        BIT(2 + (8 * (_n)))
> > +#define MT_LED_CTRL_TX_MANUAL_BLINK(_n)      BIT(3 + (8 * (_n)))
> > +#define MT_LED_CTRL_TX_OVER_BLINK(_n)        BIT(5 + (8 * (_n)))
> > +#define MT_LED_CTRL_KICK(_n)         BIT(7 + (8 * (_n)))
> > +
> > +#define MT_LED_STATUS_0(_n)          MT_LED_PHYS(0x10 + ((_n) * 8))
> > +#define MT_LED_STATUS_1(_n)          MT_LED_PHYS(0x14 + ((_n) * 8))
> > +#define MT_LED_STATUS_OFF_MASK               GENMASK(31, 24)
> > +#define MT_LED_STATUS_OFF(_v)                (((_v) << \
> > +                                       __ffs(MT_LED_STATUS_OFF_MASK)) & \
> > +                                      MT_LED_STATUS_OFF_MASK)
> > +#define MT_LED_STATUS_ON_MASK                GENMASK(23, 16)
> > +#define MT_LED_STATUS_ON(_v)         (((_v) << \
> > +                                       __ffs(MT_LED_STATUS_ON_MASK)) & \
> > +                                      MT_LED_STATUS_ON_MASK)
> > +#define MT_LED_STATUS_DURATION_MASK  GENMASK(15, 0)
> > +#define MT_LED_STATUS_DURATION(_v)   (((_v) << \
> > +                                       __ffs(MT_LED_STATUS_DURATION_MASK)) &\
> > +                                      MT_LED_STATUS_DURATION_MASK
>
> Why are you using separate _MASK fields and macros using __ffs in
> bitshift instead of FIELD_PREP like the rest of the code?
>

ack, I will fix it in v2.

Regards,
Lorenzo

> - Felix
>




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux