Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soc: bcm: brcmstb: add stubs for getting platform IDs

Some brcmstb drivers may be shared with other SoC families. E.g. the
same USB PHY block is shared by brcmstb and BCM4908.

To avoid building brcmstb common code on non-brcmstb platforms we need
stubs for:
1. brcmstb_get_family_id()
2. brcmstb_get_product_id()
(to avoid "undefined reference to" errors).

With this change PHY_BRCM_USB will not have to unconditionally select
SOC_BRCMSTB anymore.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

authored by

Rafał Miłecki and committed by
Florian Fainelli
149ae80b 8bcac401

+16
+16
include/linux/soc/brcmstb/brcmstb.h
··· 2 2 #ifndef __BRCMSTB_SOC_H 3 3 #define __BRCMSTB_SOC_H 4 4 5 + #include <linux/kconfig.h> 6 + 5 7 static inline u32 BRCM_ID(u32 reg) 6 8 { 7 9 return reg >> 28 ? reg >> 16 : reg >> 8; ··· 14 12 return reg & 0xff; 15 13 } 16 14 15 + #if IS_ENABLED(CONFIG_SOC_BRCMSTB) 16 + 17 17 /* 18 18 * Helper functions for getting family or product id from the 19 19 * SoC driver. 20 20 */ 21 21 u32 brcmstb_get_family_id(void); 22 22 u32 brcmstb_get_product_id(void); 23 + 24 + #else 25 + static inline u32 brcmstb_get_family_id(void) 26 + { 27 + return 0; 28 + } 29 + 30 + static inline u32 brcmstb_get_product_id(void) 31 + { 32 + return 0; 33 + } 34 + #endif 23 35 24 36 #endif /* __BRCMSTB_SOC_H */