For our design we add XR20M1172 to AM3715,we think we add the driver correctly,but why we read the registers in XR20M1172,they are all zeros.
in the board.c,we add
static struct xr20m1172_platform_data xr20m1172_data = {
.uartclk = 14745600,
.uart_base = 0,
.gpio_base = 0,
.label = "eser",
};
struct spi_board_info __initdata xr20m1172_spi_slave_info[] = {
{
.modalias = "xr20m1172", /* driver name */
.platform_data = &xr20m1172_data,
.max_speed_hz = 1000000,
.bus_num = 2,
.chip_select = 0,
},
};
and in the probe() of xr20m1172.c
printk(KERN_INFO DRIVER_NAME " at CS%d (irq %d), 2 UARTs, 8 GPIOs\n"
" eser%d, eser%d, gpiochip%d\n",
spi->chip_select, spi->irq,
pdata->uart_base, pdata->uart_base + 1,
pdata->gpio_base);
printk("the value in REG_LCR is %8x\n",xr20m1172_read(spi,0x03,0));
ret = xr20m1172_write(spi,REG_IOD,0,0xf0);
if(ret){
printk("write err!\n");
goto exit_uart1;
}
printk("the value in REG_IOD is %8x\n",xr20m1172_read(spi,REG_IOD,0));
ret = xr20m1172_write_async(spi,0x01,1,0xf0);
if(ret){
printk("write err!\n");
goto exit_uart1;
}
printk("the value in 0x01 is %8x\n",xr20m1172_read(spi,0x01,1));
printk("the value in 0x01 is %8x\n",xr20m1172_read(spi,0x01,1));
and the result is
[ 0.033081] ****************************xr20m1172_probe*****************************
[ 0.033111] out.cmd= 70,out.value= 8,sizeof(out)=2
[ 0.033660] IRQ 0 uses trigger mode 0; requested 2
[ 0.033966] xr20m1172 at CS0 (irq 0), 2 UARTs, 8 GPIOs
[ 0.033966] eser0, eser1, gpiochip0
[ 0.033996] read_cmd(reg,ch)= 98
[ 0.034057] the value in REG_LCR is 0
[ 0.034088] out.cmd= 50,out.value= f0,sizeof(out)=2
[ 0.034149] read_cmd(reg,ch)= d0
[ 0.034179] the value in REG_IOD is 0
[ 0.034210] read_cmd(reg,ch)= 8a
[ 0.034301] the value in 0x01 is 0
[ 0.034301] read_cmd(reg,ch)= 8a
[ 0.034362] the value in 0x01 is 0
As there is no error, we think the function is performed correctly, but why the value is 0, and we have set the RST pin 1 in software,could anybody help us ?
thank you in advace