• Alvin Šipraga's avatar
    wifi: brcmfmac: support brcm,ccode-map-trivial DT property · 5c54ab24
    Alvin Šipraga authored
    Commit a21bf90e ("brcmfmac: use ISO3166 country code and 0 rev as
    fallback on some devices") introduced a fallback mechanism whereby a
    trivial mapping from ISO3166 country codes to firmware country code and
    revision is used on some devices. This fallback operates on the device
    level, so it is enabled only for certain supported chipsets.
    
    In general though, the firmware country codes are determined by the CLM
    blob, which is board-specific and may vary despite the underlying
    chipset being the same.
    
    The aforementioned commit is actually a refinement of a previous commit
    that was reverted in commit 151a7c12 ("Revert "brcmfmac: use ISO3166
    country code and 0 rev as fallback"") due to regressions with a BCM4359
    device. The refinement restricted the fallback mechanism to specific
    chipsets such as the BCM4345.
    
    We use a chipset - CYW88359 - that the driver identifies as a BCM4359
    too. But in our case, the CLM blob uses ISO3166 country codes
    internally, and all with revision 0. So the trivial mapping is exactly
    what is needed in order for the driver to sync the kernel regulatory
    domain to the firmware. This is just a matter of how the CLM blob was
    prepared by the hardware vendor. The same could hold for other boards
    too.
    
    Although the brcm,ccode-map device tree property is useful for cases
    where the mapping is more complex, the trivial case invites a much
    simpler specification. This patch adds support for parsing the
    brcm,ccode-map-trivial device tree property. Subordinate to the more
    specific brcm,ccode-map property, this new proprety simply informs the
    driver that the fallback method should be used in every case.
    
    In the absence of the new property in the device tree, expect no
    functional change.
    Signed-off-by: default avatarAlvin Šipraga <alsi@bang-olufsen.dk>
    Reviewed-by: default avatarAhmad Fatoum <a.fatoum@pengutronix.de>
    Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220711123005.3055300-3-alvin@pqrs.dk
    5c54ab24
of.c 2.97 KB