1 From 149ae80b1d50e7db5ac7df1cdf0820017b70e716 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Thu, 14 Jan 2021 11:53:18 +0100
4 Subject: [PATCH] soc: bcm: brcmstb: add stubs for getting platform IDs
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 Some brcmstb drivers may be shared with other SoC families. E.g. the
10 same USB PHY block is shared by brcmstb and BCM4908.
12 To avoid building brcmstb common code on non-brcmstb platforms we need
14 1. brcmstb_get_family_id()
15 2. brcmstb_get_product_id()
16 (to avoid "undefined reference to" errors).
18 With this change PHY_BRCM_USB will not have to unconditionally select
21 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
22 Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
24 include/linux/soc/brcmstb/brcmstb.h | 16 ++++++++++++++++
25 1 file changed, 16 insertions(+)
27 --- a/include/linux/soc/brcmstb/brcmstb.h
28 +++ b/include/linux/soc/brcmstb/brcmstb.h
30 #ifndef __BRCMSTB_SOC_H
31 #define __BRCMSTB_SOC_H
33 +#include <linux/kconfig.h>
35 static inline u32 BRCM_ID(u32 reg)
37 return reg >> 28 ? reg >> 16 : reg >> 8;
38 @@ -12,6 +14,8 @@ static inline u32 BRCM_REV(u32 reg)
42 +#if IS_ENABLED(CONFIG_SOC_BRCMSTB)
45 * Helper functions for getting family or product id from the
47 @@ -19,4 +23,16 @@ static inline u32 BRCM_REV(u32 reg)
48 u32 brcmstb_get_family_id(void);
49 u32 brcmstb_get_product_id(void);
52 +static inline u32 brcmstb_get_family_id(void)
57 +static inline u32 brcmstb_get_product_id(void)
63 #endif /* __BRCMSTB_SOC_H */