Re: [PATCH 2/8] spmi: hi6421-spmi-pmic: move driver from staging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mauro,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.10-rc4 next-20201117]
[cannot apply to staging/staging-testing robh/for-next lee-mfd/for-mfd-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Mauro-Carvalho-Chehab/Move-Hikey-970-USB-support-out-of-staging-and-add-DT/20201116-210334
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 09162bc32c880a791c6c0668ce0745cf7958f576
config: x86_64-randconfig-s022-20201115 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-107-gaf3512a6-dirty
        # https://github.com/0day-ci/linux/commit/b972250f20fc571defa4b23c9cc959df61eb0803
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Mauro-Carvalho-Chehab/Move-Hikey-970-USB-support-out-of-staging-and-add-DT/20201116-210334
        git checkout b972250f20fc571defa4b23c9cc959df61eb0803
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

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


"sparse warnings: (new ones prefixed by >>)"
>> drivers/spmi/hisi-spmi-controller.c:164:24: sparse: sparse: cast to restricted __be32
>> drivers/spmi/hisi-spmi-controller.c:164:24: sparse: sparse: cast to restricted __be32
>> drivers/spmi/hisi-spmi-controller.c:164:24: sparse: sparse: cast to restricted __be32
>> drivers/spmi/hisi-spmi-controller.c:164:24: sparse: sparse: cast to restricted __be32
>> drivers/spmi/hisi-spmi-controller.c:164:24: sparse: sparse: cast to restricted __be32
>> drivers/spmi/hisi-spmi-controller.c:164:24: sparse: sparse: cast to restricted __be32
>> drivers/spmi/hisi-spmi-controller.c:239:25: sparse: sparse: cast from restricted __be32

vim +164 drivers/spmi/hisi-spmi-controller.c

70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  110  
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  111  static int spmi_read_cmd(struct spmi_controller *ctrl,
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  112  			 u8 opc, u8 slave_id, u16 slave_addr, u8 *__buf, size_t bc)
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  113  {
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  114  	struct spmi_controller_dev *spmi_controller = dev_get_drvdata(&ctrl->dev);
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  115  	u32 chnl_ofst = SPMI_CHANNEL_OFFSET * spmi_controller->channel;
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  116  	unsigned long flags;
6af364501949d99 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  117  	u8 *buf = __buf;
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  118  	u32 cmd, data;
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  119  	int rc;
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  120  	u8 op_code, i;
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  121  
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  122  	if (bc > SPMI_CONTROLLER_MAX_TRANS_BYTES) {
4d914a8c480c312 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  123  		dev_err(&ctrl->dev,
4c6491a343e91a5 drivers/staging/hikey9xx/hisi-spmi-controller.c YueHaibing            2020-09-01  124  			"spmi_controller supports 1..%d bytes per trans, but:%zu requested\n",
4d914a8c480c312 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  125  			SPMI_CONTROLLER_MAX_TRANS_BYTES, bc);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  126  		return  -EINVAL;
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  127  	}
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  128  
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  129  	switch (opc) {
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  130  	case SPMI_CMD_READ:
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  131  		op_code = SPMI_CMD_REG_READ;
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  132  		break;
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  133  	case SPMI_CMD_EXT_READ:
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  134  		op_code = SPMI_CMD_EXT_REG_READ;
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  135  		break;
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  136  	case SPMI_CMD_EXT_READL:
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  137  		op_code = SPMI_CMD_EXT_REG_READ_L;
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  138  		break;
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  139  	default:
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  140  		dev_err(&ctrl->dev, "invalid read cmd 0x%x\n", opc);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  141  		return -EINVAL;
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  142  	}
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  143  
2ea3f6a03b155f4 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  144  	cmd = SPMI_APB_SPMI_CMD_EN |
2ea3f6a03b155f4 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  145  	     (op_code << SPMI_APB_SPMI_CMD_TYPE_OFFSET) |
2ea3f6a03b155f4 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  146  	     ((bc - 1) << SPMI_APB_SPMI_CMD_LENGTH_OFFSET) |
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  147  	     ((slave_id & 0xf) << SPMI_APB_SPMI_CMD_SLAVEID_OFFSET) |  /* slvid */
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  148  	     ((slave_addr & 0xffff)  << SPMI_APB_SPMI_CMD_ADDR_OFFSET); /* slave_addr */
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  149  
2ea3f6a03b155f4 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  150  	spin_lock_irqsave(&spmi_controller->lock, flags);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  151  
2ea3f6a03b155f4 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  152  	writel(cmd, spmi_controller->base + chnl_ofst + SPMI_APB_SPMI_CMD_BASE_ADDR);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  153  
4d914a8c480c312 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  154  	rc = spmi_controller_wait_for_done(&ctrl->dev, spmi_controller,
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  155  					   spmi_controller->base, slave_id, slave_addr);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  156  	if (rc)
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  157  		goto done;
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  158  
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  159  	for (i = 0; bc > i * SPMI_PER_DATAREG_BYTE; i++) {
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  160  		data = readl(spmi_controller->base + chnl_ofst +
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  161  			     SPMI_SLAVE_OFFSET * slave_id +
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  162  			     SPMI_APB_SPMI_RDATA0_BASE_ADDR +
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  163  			     i * SPMI_PER_DATAREG_BYTE);
8788a30c12c7884 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17 @164  		data = be32_to_cpu((__be32)data);
2ea3f6a03b155f4 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  165  		if ((bc - i * SPMI_PER_DATAREG_BYTE) >> 2) {
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  166  			memcpy(buf, &data, sizeof(data));
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  167  			buf += sizeof(data);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  168  		} else {
2ea3f6a03b155f4 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  169  			memcpy(buf, &data, bc % SPMI_PER_DATAREG_BYTE);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  170  			buf += (bc % SPMI_PER_DATAREG_BYTE);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  171  		}
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  172  	}
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  173  
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  174  done:
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  175  	spin_unlock_irqrestore(&spmi_controller->lock, flags);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  176  	if (rc)
4d914a8c480c312 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  177  		dev_err(&ctrl->dev,
4c6491a343e91a5 drivers/staging/hikey9xx/hisi-spmi-controller.c YueHaibing            2020-09-01  178  			"spmi read wait timeout op:0x%x slave_id:%d slave_addr:0x%x bc:%zu\n",
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  179  			opc, slave_id, slave_addr, bc + 1);
6af364501949d99 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  180  	else
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  181  		dev_dbg(&ctrl->dev, "%s: id:%d slave_addr:0x%x, read value: %*ph\n",
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  182  			__func__, slave_id, slave_addr, (int)bc, __buf);
6af364501949d99 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  183  
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  184  	return rc;
2ea3f6a03b155f4 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  185  }
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  186  
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  187  static int spmi_write_cmd(struct spmi_controller *ctrl,
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  188  			  u8 opc, u8 slave_id, u16 slave_addr, const u8 *__buf, size_t bc)
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  189  {
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  190  	struct spmi_controller_dev *spmi_controller = dev_get_drvdata(&ctrl->dev);
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  191  	u32 chnl_ofst = SPMI_CHANNEL_OFFSET * spmi_controller->channel;
6af364501949d99 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  192  	const u8 *buf = __buf;
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  193  	unsigned long flags;
8788a30c12c7884 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  194  	u32 cmd, data;
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  195  	int rc;
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  196  	u8 op_code, i;
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  197  
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  198  	if (bc > SPMI_CONTROLLER_MAX_TRANS_BYTES) {
4d914a8c480c312 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  199  		dev_err(&ctrl->dev,
4c6491a343e91a5 drivers/staging/hikey9xx/hisi-spmi-controller.c YueHaibing            2020-09-01  200  			"spmi_controller supports 1..%d bytes per trans, but:%zu requested\n",
4d914a8c480c312 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  201  			SPMI_CONTROLLER_MAX_TRANS_BYTES, bc);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  202  		return  -EINVAL;
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  203  	}
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  204  
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  205  	switch (opc) {
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  206  	case SPMI_CMD_WRITE:
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  207  		op_code = SPMI_CMD_REG_WRITE;
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  208  		break;
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  209  	case SPMI_CMD_EXT_WRITE:
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  210  		op_code = SPMI_CMD_EXT_REG_WRITE;
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  211  		break;
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  212  	case SPMI_CMD_EXT_WRITEL:
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  213  		op_code = SPMI_CMD_EXT_REG_WRITE_L;
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  214  		break;
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  215  	default:
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  216  		dev_err(&ctrl->dev, "invalid write cmd 0x%x\n", opc);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  217  		return -EINVAL;
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  218  	}
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  219  
2ea3f6a03b155f4 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  220  	cmd = SPMI_APB_SPMI_CMD_EN |
2ea3f6a03b155f4 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  221  	      (op_code << SPMI_APB_SPMI_CMD_TYPE_OFFSET) |
2ea3f6a03b155f4 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  222  	      ((bc - 1) << SPMI_APB_SPMI_CMD_LENGTH_OFFSET) |
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  223  	      ((slave_id & 0xf) << SPMI_APB_SPMI_CMD_SLAVEID_OFFSET) |
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  224  	      ((slave_addr & 0xffff)  << SPMI_APB_SPMI_CMD_ADDR_OFFSET);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  225  
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  226  	/* Write data to FIFOs */
2ea3f6a03b155f4 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  227  	spin_lock_irqsave(&spmi_controller->lock, flags);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  228  
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  229  	for (i = 0; bc > i * SPMI_PER_DATAREG_BYTE; i++) {
8788a30c12c7884 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  230  		data = 0;
2ea3f6a03b155f4 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  231  		if ((bc - i * SPMI_PER_DATAREG_BYTE) >> 2) {
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  232  			memcpy(&data, buf, sizeof(data));
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  233  			buf += sizeof(data);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  234  		} else {
2ea3f6a03b155f4 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  235  			memcpy(&data, buf, bc % SPMI_PER_DATAREG_BYTE);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  236  			buf += (bc % SPMI_PER_DATAREG_BYTE);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  237  		}
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  238  
8788a30c12c7884 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17 @239  		writel((u32)cpu_to_be32(data),
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  240  		       spmi_controller->base + chnl_ofst +
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  241  		       SPMI_APB_SPMI_WDATA0_BASE_ADDR +
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  242  		       SPMI_PER_DATAREG_BYTE * i);
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  243  	}
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  244  
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  245  	/* Start the transaction */
2ea3f6a03b155f4 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  246  	writel(cmd, spmi_controller->base + chnl_ofst + SPMI_APB_SPMI_CMD_BASE_ADDR);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  247  
4d914a8c480c312 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  248  	rc = spmi_controller_wait_for_done(&ctrl->dev, spmi_controller,
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  249  					   spmi_controller->base, slave_id,
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  250  					   slave_addr);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  251  	spin_unlock_irqrestore(&spmi_controller->lock, flags);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  252  
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  253  	if (rc)
4c6491a343e91a5 drivers/staging/hikey9xx/hisi-spmi-controller.c YueHaibing            2020-09-01  254  		dev_err(&ctrl->dev, "spmi write wait timeout op:0x%x slave_id:%d slave_addr:0x%x bc:%zu\n",
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  255  			opc, slave_id, slave_addr, bc);
6af364501949d99 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  256  	else
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  257  		dev_dbg(&ctrl->dev, "%s: id:%d slave_addr:0x%x, wrote value: %*ph\n",
7f3ac6c502fd7ff drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  258  			__func__, slave_id, slave_addr, (int)bc, __buf);
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  259  
70f59c90c8199e8 drivers/staging/hikey9xx/hisi-spmi-controller.c Mayulong              2020-08-17  260  	return rc;
2ea3f6a03b155f4 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  261  }
2ea3f6a03b155f4 drivers/staging/hikey9xx/hisi-spmi-controller.c Mauro Carvalho Chehab 2020-08-17  262  

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux