Hi,
I can correctly write and read the trf7970's registers when seeing in oscilloscope.
I removed the my test code in trf7970.c and only added printk in trf7970a_read function(below). When I run the poll with neard application,I was seeing 0x40 value in 0x0f address. NFC tag closer to antenna does not change anything. Driver consistently read 0x0f address( rssi register) and this register value 0x40. What is the reason of this situation?
static int trf7970a_read(struct trf7970a *trf, u8 reg, u8 *val)
{
u8 addr = TRF7970A_CMD_BIT_RW | reg;
int ret;
ret = spi_write_then_read(trf->spi, &addr, 1, val, 1);
if (ret)
dev_err(trf->dev, "%s - addr: 0x%x, ret: %d\n", __func__, addr,
ret);
printk(KERN_INFO" reading adress: 0x%02x data: 0x%02x \n",reg,*val);
dev_dbg(trf->dev, "read(0x%x): 0x%x\n", addr, *val);
return ret;
}