Lines Matching full:pd
36 struct simtec_i2c_data *pd = pw; in simtec_i2c_setsda() local
37 writeb(CMD_SET_SDA | (state ? STATE_SDA : 0), pd->reg); in simtec_i2c_setsda()
42 struct simtec_i2c_data *pd = pw; in simtec_i2c_setscl() local
43 writeb(CMD_SET_SCL | (state ? STATE_SCL : 0), pd->reg); in simtec_i2c_setscl()
48 struct simtec_i2c_data *pd = pw; in simtec_i2c_getsda() local
49 return readb(pd->reg) & STATE_SDA ? 1 : 0; in simtec_i2c_getsda()
54 struct simtec_i2c_data *pd = pw; in simtec_i2c_getscl() local
55 return readb(pd->reg) & STATE_SCL ? 1 : 0; in simtec_i2c_getscl()
62 struct simtec_i2c_data *pd; in simtec_i2c_probe() local
67 pd = kzalloc(sizeof(struct simtec_i2c_data), GFP_KERNEL); in simtec_i2c_probe()
68 if (pd == NULL) in simtec_i2c_probe()
71 platform_set_drvdata(dev, pd); in simtec_i2c_probe()
82 pd->ioarea = request_mem_region(res->start, size, dev->name); in simtec_i2c_probe()
83 if (pd->ioarea == NULL) { in simtec_i2c_probe()
89 pd->reg = ioremap(res->start, size); in simtec_i2c_probe()
90 if (pd->reg == NULL) { in simtec_i2c_probe()
98 pd->adap.owner = THIS_MODULE; in simtec_i2c_probe()
99 pd->adap.algo_data = &pd->bit; in simtec_i2c_probe()
100 pd->adap.dev.parent = &dev->dev; in simtec_i2c_probe()
102 strlcpy(pd->adap.name, "Simtec I2C", sizeof(pd->adap.name)); in simtec_i2c_probe()
104 pd->bit.data = pd; in simtec_i2c_probe()
105 pd->bit.setsda = simtec_i2c_setsda; in simtec_i2c_probe()
106 pd->bit.setscl = simtec_i2c_setscl; in simtec_i2c_probe()
107 pd->bit.getsda = simtec_i2c_getsda; in simtec_i2c_probe()
108 pd->bit.getscl = simtec_i2c_getscl; in simtec_i2c_probe()
109 pd->bit.timeout = HZ; in simtec_i2c_probe()
110 pd->bit.udelay = 20; in simtec_i2c_probe()
112 ret = i2c_bit_add_bus(&pd->adap); in simtec_i2c_probe()
119 iounmap(pd->reg); in simtec_i2c_probe()
122 release_mem_region(pd->ioarea->start, size); in simtec_i2c_probe()
125 kfree(pd); in simtec_i2c_probe()
131 struct simtec_i2c_data *pd = platform_get_drvdata(dev); in simtec_i2c_remove() local
133 i2c_del_adapter(&pd->adap); in simtec_i2c_remove()
135 iounmap(pd->reg); in simtec_i2c_remove()
136 release_mem_region(pd->ioarea->start, resource_size(pd->ioarea)); in simtec_i2c_remove()
137 kfree(pd); in simtec_i2c_remove()