How to drive Mikrotik RB750GR3 buzzer?

Hi, i am trying to drive RB750GR3's built in buzzer
it has built in bootloader

 OpenWrt 21.02.3, r16554-1d4dea6d4f
Linux OpenWrt 5.4.188 #0 SMP Sat Apr 16 12:59:34 2022 mips GNU/Linux

according to this commit reference it is pwm driven

Could you help to to drive this ? thanks for any help

root@OpenWrt:~# ls /sys/class/gpio/
buzzer       export       gpiochip416  gpiochip448  gpiochip480  unexport     usb_power

root@OpenWrt:~# ls /sys/class/gpio/buzzer/
active_low  device      subsystem   uevent      value

root@OpenWrt:~# cat /sys/kernel/debug/gpio
gpiochip2: GPIOs 416-447, parent: platform/1e000600.gpio, 1e000600.gpio-bank2:

gpiochip1: GPIOs 448-479, parent: platform/1e000600.gpio, 1e000600.gpio-bank1:

gpiochip0: GPIOs 480-511, parent: platform/1e000600.gpio, 1e000600.gpio-bank0:
 gpio-480 (                    |green:usr           ) out hi 
 gpio-492 (                    |usb_power           ) out hi 
 gpio-493 (                    |mode                ) in  hi IRQ ACTIVE LOW
 **gpio-495 (                    |buzzer              ) out lo** 
 gpio-496 (                    |blue:pwr            ) out hi 
 gpio-498 (                    |reset               ) in  hi IRQ ACTIVE LOW

I think the GPIO sysfs interface only allows ON/OFF state control, not configuring hardware timers or counter comparators for PWM frequency control.

Is there a /sys/class/pwm?

Hi,

There is no pwm in /sys/class

root@OpenWrt:~# ls /sys/class/
bdi           bsg           dma           firmware      leds          mem           mt            net           phy           ppp           rtc           thermal       ubi
block         devcoredump   extcon        gpio          mdio_bus      misc          mtd           pci_bus       power_supply  regulator     spi_master    tty           watchdog

i found a way for addiing PWM support :

to kernel but it failed when
make kernel_menuconfig V=s -j 8
proccess

here is error logs:

...
Applying /media/alfa/openwrt_2022/openwrt_ath79/target/linux/ramips/patches-5.4/0051-serial-add-ugly-custom-baud-rate-hack.patch using plaintext: 
patching file drivers/tty/serial/serial_core.c

Applying /media/alfa/openwrt_2022/openwrt_ath79/target/linux/ramips/patches-5.4/0052-pwm-add-mediatek-support.patch using plaintext: 
patching file drivers/pwm/Kconfig
Hunk #1 FAILED at 316.
1 out of 1 hunk FAILED -- saving rejects to file drivers/pwm/Kconfig.rej
patching file drivers/pwm/Makefile
Hunk #1 FAILED at 29.
1 out of 1 hunk FAILED -- saving rejects to file drivers/pwm/Makefile.rej
patching file drivers/pwm/pwm-mediatek-ramips.c
Patch failed!  Please fix /media/alfa/openwrt_2022/openwrt_ath79/target/linux/ramips/patches-5.4/0052-pwm-add-mediatek-support.patch!
make[2]: *** [Makefile:33: /media/alfa/openwrt_2022/openwrt_ath79/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-5.4.188/.prepared_f9cffdc5e20d1f85fc4334f66908bd08] Error 1
make[2]: Leaving directory '/media/alfa/openwrt_2022/openwrt_ath79/target/linux/ramips'
make[1]: *** [Makefile:11: menuconfig] Error 2
make[1]: Leaving directory '/media/alfa/openwrt_2022/openwrt_ath79/target/linux'
make: *** [/media/alfa/openwrt_2022/openwrt_ath79/include/toplevel.mk:170: kernel_menuconfig] Error 2