@@ -159,7 +159,7 @@ static int sprd_adi_read(struct sprd_adi *sadi, u32 reg, u32 *read_val)
159
159
{
160
160
int read_timeout = ADI_READ_TIMEOUT ;
161
161
unsigned long flags ;
162
- u32 val , rd_addr , paddr ;
162
+ u32 val , rd_addr ;
163
163
int ret = 0 ;
164
164
165
165
if (sadi -> hwlock ) {
@@ -177,11 +177,10 @@ static int sprd_adi_read(struct sprd_adi *sadi, u32 reg, u32 *read_val)
177
177
goto out ;
178
178
179
179
/*
180
- * Set the physical register address need to read into RD_CMD register,
180
+ * Set the slave address offset need to read into RD_CMD register,
181
181
* then ADI controller will start to transfer automatically.
182
182
*/
183
- paddr = sadi -> slave_pbase + reg ;
184
- writel_relaxed (paddr , sadi -> base + REG_ADI_RD_CMD );
183
+ writel_relaxed (reg , sadi -> base + REG_ADI_RD_CMD );
185
184
186
185
/*
187
186
* Wait read operation complete, the BIT_RD_CMD_BUSY will be set
@@ -211,9 +210,9 @@ static int sprd_adi_read(struct sprd_adi *sadi, u32 reg, u32 *read_val)
211
210
*/
212
211
rd_addr = (val & RD_ADDR_MASK ) >> RD_ADDR_SHIFT ;
213
212
214
- if (rd_addr != (paddr & REG_ADDR_LOW_MASK )) {
213
+ if (rd_addr != (reg & REG_ADDR_LOW_MASK )) {
215
214
dev_err (sadi -> dev , "read error, reg addr = 0x%x, val = 0x%x\n" ,
216
- paddr , val );
215
+ reg , val );
217
216
ret = - EIO ;
218
217
goto out ;
219
218
}
0 commit comments