################################################################################
# udev rules file for loading brcmfmac_sdio-firmware
################################################################################

ACTION!="add", GOTO="end"
SUBSYSTEMS=="sdio", ATTRS{vendor}=="0x02d0", ATTRS{device}=="0x4329", GOTO="begin"
SUBSYSTEMS=="sdio", ATTRS{vendor}=="0x02d0", ATTRS{device}=="0x4330", GOTO="begin"
SUBSYSTEMS=="sdio", ATTRS{vendor}=="0x02d0", ATTRS{device}=="0xa962", GOTO="begin"
GOTO="end"
LABEL="begin"
### Brodcom bcm4330 bluetooth device
ATTRS{vendor}=="0x02d0", ATTRS{device}=="0x4330", \
  ENV{brcm_device}="bcm4330"
### Brodcom bcm4329 bluetooth device
ATTRS{vendor}=="0x02d0", ATTRS{device}=="0x4329", \
  ENV{brcm_device}="bcm4329"
### Brodcom bcm43362/bcm20710a1 bluetooth device
ATTRS{vendor}=="0x02d0", ATTRS{device}=="0xa962", \
  ENV{brcm_device}="bcm20710a1"

ENV{brcm_device}=="bcm43*", ACTION=="add", \
  TAG+="systemd", ENV{SYSTEMD_WANTS}+="brcmfmac_sdio-firmware-imx@$env{brcm_device}.service"
ENV{brcm_device}=="bcm20*", ACTION=="add", \
  TAG+="systemd", ENV{SYSTEMD_WANTS}+="brcmfmac_sdio-firmware-aml@$env{brcm_device}.service"
LABEL="end"
