All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [frank-w-bpi-r2-4.14:5.16-r2pro 5/46] drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:191:6: error: no previous prototype for function 'mtk_wcn_consys_power_on'
Date: Thu, 16 Dec 2021 20:32:48 +0800	[thread overview]
Message-ID: <202112162013.yu4EBbAk-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 27073 bytes --]

tree:   https://github.com/frank-w/BPI-R2-4.14 5.16-r2pro
head:   128a9afefdc678ae6492ee2067b1e33e14b6c28f
commit: 8f3e42b3d0855dda8a76965487facfb915a4dd33 [5/46] mt6625l: add changes outside driver dir
config: arm-randconfig-r003-20211216 (https://download.01.org/0day-ci/archive/20211216/202112162013.yu4EBbAk-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project dd245bab9fbb364faa1581e4f92ba3119a872fba)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://github.com/frank-w/BPI-R2-4.14/commit/8f3e42b3d0855dda8a76965487facfb915a4dd33
        git remote add frank-w-bpi-r2-4.14 https://github.com/frank-w/BPI-R2-4.14
        git fetch --no-tags frank-w-bpi-r2-4.14 5.16-r2pro
        git checkout 8f3e42b3d0855dda8a76965487facfb915a4dd33
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/ drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/ drivers/power/supply/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:191:6: error: no previous prototype for function 'mtk_wcn_consys_power_on' [-Werror,-Wmissing-prototypes]
   VOID mtk_wcn_consys_power_on(VOID)
        ^
   drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:191:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   VOID mtk_wcn_consys_power_on(VOID)
   ^
   static 
>> drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:207:6: error: no previous prototype for function 'mtk_wcn_consys_power_off' [-Werror,-Wmissing-prototypes]
   VOID mtk_wcn_consys_power_off(VOID)
        ^
   drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:207:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   VOID mtk_wcn_consys_power_off(VOID)
   ^
   static 
>> drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:224:7: error: no previous prototype for function 'mtk_wcn_consys_hw_reg_ctrl' [-Werror,-Wmissing-prototypes]
   INT32 mtk_wcn_consys_hw_reg_ctrl(UINT32 on, UINT32 co_clock_type)
         ^
   drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:224:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   INT32 mtk_wcn_consys_hw_reg_ctrl(UINT32 on, UINT32 co_clock_type)
   ^
   static 
>> drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:335:7: error: no previous prototype for function 'mtk_wcn_consys_hw_gpio_ctrl' [-Werror,-Wmissing-prototypes]
   INT32 mtk_wcn_consys_hw_gpio_ctrl(UINT32 on)
         ^
   drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:335:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   INT32 mtk_wcn_consys_hw_gpio_ctrl(UINT32 on)
   ^
   static 
>> drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:539:7: error: no previous prototype for function 'mtk_wcn_consys_hw_restore' [-Werror,-Wmissing-prototypes]
   INT32 mtk_wcn_consys_hw_restore(struct device *device)
         ^
   drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:539:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   INT32 mtk_wcn_consys_hw_restore(struct device *device)
   ^
   static 
>> drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:592:5: error: no previous prototype for function 'reserve_memory_consys_fn' [-Werror,-Wmissing-prototypes]
   int reserve_memory_consys_fn(struct reserved_mem *rmem)
       ^
   drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c:592:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   int reserve_memory_consys_fn(struct reserved_mem *rmem)
   ^
   static 
   6 errors generated.
--
           static const struct proc_ops wmt_dbg_fops = {
                                        ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1289:7: error: no previous prototype for function 'wmt_dev_dbg_setup' [-Werror,-Wmissing-prototypes]
   INT32 wmt_dev_dbg_setup(VOID)
         ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1289:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   INT32 wmt_dev_dbg_setup(VOID)
   ^
   static 
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1303:7: error: no previous prototype for function 'wmt_dev_dbg_remove' [-Werror,-Wmissing-prototypes]
   INT32 wmt_dev_dbg_remove(VOID)
         ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1303:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   INT32 wmt_dev_dbg_remove(VOID)
   ^
   static 
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1376:31: error: unused variable 'wmt_aee_fops' [-Werror,-Wunused-variable]
           static const struct proc_ops wmt_aee_fops = {
                                        ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1374:7: error: no previous prototype for function 'wmt_dev_proc_for_aee_setup' [-Werror,-Wmissing-prototypes]
   INT32 wmt_dev_proc_for_aee_setup(VOID)
         ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1374:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   INT32 wmt_dev_proc_for_aee_setup(VOID)
   ^
   static 
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1390:7: error: no previous prototype for function 'wmt_dev_proc_for_aee_remove' [-Werror,-Wmissing-prototypes]
   INT32 wmt_dev_proc_for_aee_remove(VOID)
         ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1390:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   INT32 wmt_dev_proc_for_aee_remove(VOID)
   ^
   static 
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1494:20: error: implicit declaration of function 'get_fs' [-Werror,-Wimplicit-function-declaration]
                   fs=get_fs();
                      ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1494:20: note: did you mean 'sget_fc'?
   include/linux/fs.h:2564:21: note: 'sget_fc' declared here
   struct super_block *sget_fc(struct fs_context *fc,
                       ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1494:19: error: assigning to 'mm_segment_t' from incompatible type 'int'
                   fs=get_fs();
                     ^~~~~~~~~
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1496:17: error: implicit declaration of function 'set_fs' [-Werror,-Wimplicit-function-declaration]
                   set_fs(fs);
                   ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1496:17: note: did you mean 'get_fs'?
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1494:20: note: 'get_fs' declared here
                   fs=get_fs();
                      ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1435:7: error: no previous prototype for function 'wmt_dev_read_file' [-Werror,-Wmissing-prototypes]
   INT32 wmt_dev_read_file(PUINT8 pName, const PPUINT8 ppBufPtr, INT32 offset, INT32 padSzBuf)
         ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1435:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   INT32 wmt_dev_read_file(PUINT8 pName, const PPUINT8 ppBufPtr, INT32 offset, INT32 padSzBuf)
   ^
   static 
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1528:25: error: implicit declaration of function 'get_fs' [-Werror,-Wimplicit-function-declaration]
           mm_segment_t orig_fs = get_fs();
                                  ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1528:15: error: initializing 'mm_segment_t' with an expression of incompatible type 'int'
           mm_segment_t orig_fs = get_fs();
                        ^         ~~~~~~~~
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1555:2: error: implicit declaration of function 'set_fs' [-Werror,-Wimplicit-function-declaration]
           set_fs(get_ds());
           ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1597:14: error: no previous prototype for function 'wmt_dev_is_file_exist' [-Werror,-Wmissing-prototypes]
   MTK_WCN_BOOL wmt_dev_is_file_exist(PUINT8 pFileName)
                ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1597:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   MTK_WCN_BOOL wmt_dev_is_file_exist(PUINT8 pFileName)
   ^
   static 
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1645:14: error: no previous prototype for function 'wmt_dev_tra_bitf_update' [-Werror,-Wmissing-prototypes]
   extern INT32 wmt_dev_tra_bitf_update(void)
                ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1645:8: note: declare 'static' if the function is not intended to be used outside of this translation unit
   extern INT32 wmt_dev_tra_bitf_update(void)
          ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1703:6: error: no previous prototype for function 'wmt_dev_tm_temp_query' [-Werror,-Wmissing-prototypes]
   long wmt_dev_tm_temp_query(void)
        ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1703:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   long wmt_dev_tm_temp_query(void)
   ^
   static 
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1801:9: error: no previous prototype for function 'WMT_write' [-Werror,-Wmissing-prototypes]
   ssize_t WMT_write(struct file *filp, const char __user *buf, size_t count, loff_t *f_pos)
           ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1801:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   ssize_t WMT_write(struct file *filp, const char __user *buf, size_t count, loff_t *f_pos)
   ^
   static 
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1834:9: error: no previous prototype for function 'WMT_read' [-Werror,-Wmissing-prototypes]
   ssize_t WMT_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
           ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1834:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   ssize_t WMT_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
   ^
   static 
>> drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1865:14: error: no previous prototype for function 'WMT_poll' [-Werror,-Wmissing-prototypes]
   unsigned int WMT_poll(struct file *filp, poll_table *wait)
                ^
   drivers/misc/mediatek/connectivity/common/conn_soc/linux/pri/wmt_dev.c:1865:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   unsigned int WMT_poll(struct file *filp, poll_table *wait)
   ^
   static 
   fatal error: too many errors emitted, stopping now [-ferror-limit=]
   20 errors generated.


vim +/mtk_wcn_consys_power_on +191 drivers/misc/mediatek/connectivity/common/conn_soc/mt7623/mtk_wcn_consys_hw.c

d03a149ef0a8e6 Frank Wunderlich 2021-08-29  190  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29 @191  VOID mtk_wcn_consys_power_on(VOID)
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  192  {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  193  	INT32 iRet = -1;
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  194  	iRet = pm_runtime_get_sync(&my_pdev->dev);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  195  	if (iRet)
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  196  		WMT_PLAT_ERR_FUNC("pm_runtime_get_sync() fail(%d)\n", iRet);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  197  	else
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  198  		WMT_PLAT_INFO_FUNC("pm_runtime_get_sync() CONSYS ok\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  199  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  200  	iRet = device_init_wakeup(&my_pdev->dev, true);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  201  	if (iRet)
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  202  		WMT_PLAT_ERR_FUNC("device_init_wakeup(true) fail.\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  203  	else
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  204  		WMT_PLAT_INFO_FUNC("device_init_wakeup(true) CONSYS ok\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  205  }
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  206  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29 @207  VOID mtk_wcn_consys_power_off(VOID)
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  208  {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  209  	INT32 iRet = -1;
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  210  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  211  	iRet = pm_runtime_put_sync(&my_pdev->dev);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  212  	if (iRet)
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  213  		WMT_PLAT_ERR_FUNC("pm_runtime_put_sync() fail.\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  214  	else
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  215  		WMT_PLAT_INFO_FUNC("pm_runtime_put_sync() CONSYS ok\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  216  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  217  	iRet = device_init_wakeup(&my_pdev->dev, false);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  218  	if (iRet)
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  219  		WMT_PLAT_ERR_FUNC("device_init_wakeup(false) fail.\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  220  	else
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  221  		WMT_PLAT_INFO_FUNC("device_init_wakeup(false) CONSYS ok\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  222  }
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  223  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29 @224  INT32 mtk_wcn_consys_hw_reg_ctrl(UINT32 on, UINT32 co_clock_type)
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  225  {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  226  	UINT32 retry = 10;
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  227  	UINT32 consysHwChipId = 0;
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  228  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  229  	WMT_PLAT_DBG_FUNC("CONSYS-HW-REG-CTRL(0x%08x),start\n", on);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  230  	if (on) {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  231  		WMT_PLAT_DBG_FUNC("++\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  232  		/*need PMIC driver provide new API protocol */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  233  		/*1.AP power on VCN_1V8 LDO (with PMIC_WRAP API) VCN_1V8  */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  234  		regulator_set_mode(reg_VCN18, REGULATOR_MODE_STANDBY);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  235  		/* VOL_DEFAULT, VOL_1200, VOL_1300, VOL_1500, VOL_1800... */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  236  		if (reg_VCN18) {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  237  			regulator_set_voltage(reg_VCN18, 1800000, 1800000);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  238  			if (regulator_enable(reg_VCN18))
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  239  				WMT_PLAT_ERR_FUNC("enable VCN18 fail\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  240  			else
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  241  				WMT_PLAT_DBG_FUNC("enable VCN18 ok\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  242  		}
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  243  		udelay(150);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  244  		if (co_clock_type) {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  245  			/*step0,clk buf ctrl */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  246  			WMT_PLAT_INFO_FUNC("co clock type(%d),turn on clk buf\n", co_clock_type);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  247  #if CONSYS_CLOCK_BUF_CTRL
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  248  			clk_buf_ctrl(CLK_BUF_CONN, 1);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  249  #endif
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  250  			/*if co-clock mode: */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  251  			/*2.set VCN28 to SW control mode (with PMIC_WRAP API) */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  252  			/*turn on VCN28 LDO only when FMSYS is activated"  */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  253  			regmap_update_bits(pmic_regmap, 0x41C, 0x1 << 14, 0x0 << 14);/*V28*/
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  254  		} else {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  255  			/*if NOT co-clock: */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  256  			/*2.1.switch VCN28 to HW control mode (with PMIC_WRAP API) */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  257  			regmap_update_bits(pmic_regmap, 0x41C, 0x1 << 14, 0x1 << 14);/*V28*/
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  258  			/*2.2.turn on VCN28 LDO (with PMIC_WRAP API)" */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  259  			/*fix vcn28 not balance warning */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  260  			if (reg_VCN28) {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  261  				regulator_set_voltage(reg_VCN28, 2800000, 2800000);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  262  				if (regulator_enable(reg_VCN28))
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  263  					WMT_PLAT_ERR_FUNC("enable VCN_2V8 fail!\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  264  				else
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  265  					WMT_PLAT_DBG_FUNC("enable VCN_2V8 ok\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  266  			}
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  267  		}
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  268  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  269  		/*3.assert CONNSYS CPU SW reset  0x10007018 "[12]=1'b1  [31:24]=8'h88 (key)" */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  270  		reset_control_reset(rstc);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  271  		mtk_wcn_consys_power_on();
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  272  		/*11.26M is ready now, delay 10us for mem_pd de-assert */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  273  		udelay(10);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  274  		/*enable AP bus clock : connmcu_bus_pd  API: enable_clock() ++?? */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  275  		clk_prepare_enable(clk_infra_conn_main);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  276  		WMT_PLAT_DBG_FUNC("[CCF]enable clk_infra_conn_main\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  277  		/*12.poll CONNSYS CHIP ID until chipid is returned  0x18070008 */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  278  		while (retry-- > 0) {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  279  			consysHwChipId = CONSYS_REG_READ(conn_reg.mcu_base + CONSYS_CHIP_ID_OFFSET) - 0xf6d;
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  280  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  281  			if ((consysHwChipId == 0x0321) || (consysHwChipId == 0x0335) || (consysHwChipId == 0x0337)) {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  282  				WMT_PLAT_INFO_FUNC("retry(%d)consys chipId(0x%08x)\n", retry, consysHwChipId);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  283  				break;
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  284  			}
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  285  			if ((consysHwChipId == 0x8163) || (consysHwChipId == 0x8127) || (consysHwChipId == 0x7623)) {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  286  				WMT_PLAT_INFO_FUNC("retry(%d)consys chipId(0x%08x)\n", retry, consysHwChipId);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  287  				break;
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  288  			}
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  289  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  290  			WMT_PLAT_ERR_FUNC("Read CONSYS chipId(0x%08x)", consysHwChipId);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  291  			msleep(20);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  292  		}
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  293  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  294  		if ((0 == retry) || (0 == consysHwChipId))
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  295  			WMT_PLAT_ERR_FUNC("Maybe has a consys power on issue,(0x%08x)\n", consysHwChipId);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  296  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  297  		msleep(40);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  298  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  299  	} else {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  300  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  301  		clk_disable_unprepare(clk_infra_conn_main);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  302  		WMT_PLAT_DBG_FUNC("[CCF] clk_disable_unprepare(clk_infra_conn_main) calling\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  303  		mtk_wcn_consys_power_off();
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  304  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  305  		if (co_clock_type) {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  306  			/*VCN28 has been turned off by GPS OR FM */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  307  #if CONSYS_CLOCK_BUF_CTRL
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  308  			clk_buf_ctrl(CLK_BUF_CONN, 0);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  309  #endif
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  310  		} else {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  311  			regmap_update_bits(pmic_regmap, 0x41C, 0x1 << 14, 0x0 << 14);/*V28*/
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  312  			/*turn off VCN28 LDO (with PMIC_WRAP API)" */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  313  			if (reg_VCN28) {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  314  				if (regulator_disable(reg_VCN28))
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  315  					WMT_PLAT_ERR_FUNC("disable VCN_2V8 fail!\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  316  				else
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  317  					WMT_PLAT_DBG_FUNC("disable VCN_2V8 ok\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  318  			}
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  319  		}
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  320  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  321  		/*AP power off MT6625L VCN_1V8 LDO */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  322  		regulator_set_mode(reg_VCN18, REGULATOR_MODE_STANDBY);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  323  		if (reg_VCN18) {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  324  			if (regulator_disable(reg_VCN18))
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  325  				WMT_PLAT_ERR_FUNC("disable VCN_1V8 fail!\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  326  			else
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  327  				WMT_PLAT_DBG_FUNC("disable VCN_1V8 ok\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  328  		}
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  329  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  330  	}
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  331  	WMT_PLAT_DBG_FUNC("CONSYS-HW-REG-CTRL(0x%08x),finish\n", on);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  332  	return 0;
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  333  }
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  334  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29 @335  INT32 mtk_wcn_consys_hw_gpio_ctrl(UINT32 on)
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  336  {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  337  	INT32 iRet = 0;
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  338  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  339  	WMT_PLAT_DBG_FUNC("CONSYS-HW-GPIO-CTRL(0x%08x), start\n", on);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  340  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  341  	if (on) {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  342  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  343  		/* TODO: [FixMe][GeorgeKuo] double check if BGF_INT is implemented ok */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  344  		/* iRet += wmt_plat_gpio_ctrl(PIN_BGF_EINT, PIN_STA_MUX); */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  345  		iRet += wmt_plat_eirq_ctrl(PIN_BGF_EINT, PIN_STA_INIT);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  346  		iRet += wmt_plat_eirq_ctrl(PIN_BGF_EINT, PIN_STA_EINT_DIS);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  347  		WMT_PLAT_DBG_FUNC("CONSYS-HW, BGF IRQ registered and disabled\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  348  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  349  	} else {
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  350  
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  351  		/* set bgf eint/all eint to deinit state, namely input low state */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  352  		iRet += wmt_plat_eirq_ctrl(PIN_BGF_EINT, PIN_STA_EINT_DIS);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  353  		iRet += wmt_plat_eirq_ctrl(PIN_BGF_EINT, PIN_STA_DEINIT);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  354  		WMT_PLAT_DBG_FUNC("CONSYS-HW, BGF IRQ unregistered and disabled\n");
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  355  		/* iRet += wmt_plat_gpio_ctrl(PIN_BGF_EINT, PIN_STA_DEINIT); */
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  356  	}
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  357  	WMT_PLAT_DBG_FUNC("CONSYS-HW-GPIO-CTRL(0x%08x), finish\n", on);
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  358  	return iRet;
d03a149ef0a8e6 Frank Wunderlich 2021-08-29  359  

:::::: The code@line 191 was first introduced by commit
:::::: d03a149ef0a8e6180c7c086fc189dedb7ecb8af5 mt6625l: add driver folder from 5.14

:::::: TO: Frank Wunderlich <frank-w@public-files.de>
:::::: CC: Frank Wunderlich <frank-w@public-files.de>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

                 reply	other threads:[~2021-12-16 12:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202112162013.yu4EBbAk-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.