Search Linux Wireless

Re: [PATCH] mt76: mt7915: add LED support

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

 



On Fri, 2021-08-13 at 12:52 +0200, Felix Fietkau wrote:
> On 2021-06-21 16:14, MeiChia Chiu wrote:
> > From: MeiChia Chiu <meichia.chiu@xxxxxxxxxxxx>
> > 
> > Initialize brightness_set and blink_set callbacks to enable LED
> > support.
> > 
> > Signed-off-by: MeiChia Chiu <meichia.chiu@xxxxxxxxxxxx>
> > Signed-off-by: Ryder Lee <ryder.lee@xxxxxxxxxxxx>
> > Signed-off-by: Money Wang <money.wang@xxxxxxxxxxxx>
> > ---
> >  .../net/wireless/mediatek/mt76/mt7915/init.c | 69
> > +++++++++++++++++++++++++++++++++++++++++++++++++++
> >  .../net/wireless/mediatek/mt76/mt7915/mmio.c |  6 +++--
> >  .../net/wireless/mediatek/mt76/mt7915/regs.h | 19 ++++++++++++++
> >  3 files changed, 92 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> > b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> > index e027273..defb0ec 100644
> > --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> > +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> > @@ -151,6 +151,64 @@ static int mt7915_thermal_init(struct
> > mt7915_phy *phy)
> >  	return 0;
> >  }
> >  
> > +static void mt7915_led_set_config(struct led_classdev *led_cdev,
> > +				  u8 delay_on, u8 delay_off)
> > +{
> > +	struct mt7915_dev *dev;
> > +	struct mt76_dev *mt76;
> > +	u32 val;
> > +
> > +	mt76 = container_of(led_cdev, struct mt76_dev, led_cdev);
> > +	dev = container_of(mt76, struct mt7915_dev, mt76);
> > +
> > +	/* select TX blink mode, 2: only data frames */
> > +	mt76_rmw_field(dev, MT_TMAC_TCR0(0), MT_TMAC_TCR0_TX_BLINK, 2);
> 
> Does that mean the hw triggers the LED with the configured on/off
> delay
> on TX? I think blinking should be controlled entirely by software.
> 

Blink is still contolled by software. This means upper layer can set
on/off directly.


Ryder




[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