Lines Matching refs:pd

49 	struct simtec_i2c_data *pd = pw;  in simtec_i2c_setsda()  local
50 writeb(CMD_SET_SDA | (state ? STATE_SDA : 0), pd->reg); in simtec_i2c_setsda()
55 struct simtec_i2c_data *pd = pw; in simtec_i2c_setscl() local
56 writeb(CMD_SET_SCL | (state ? STATE_SCL : 0), pd->reg); in simtec_i2c_setscl()
61 struct simtec_i2c_data *pd = pw; in simtec_i2c_getsda() local
62 return readb(pd->reg) & STATE_SDA ? 1 : 0; in simtec_i2c_getsda()
67 struct simtec_i2c_data *pd = pw; in simtec_i2c_getscl() local
68 return readb(pd->reg) & STATE_SCL ? 1 : 0; in simtec_i2c_getscl()
75 struct simtec_i2c_data *pd; in simtec_i2c_probe() local
80 pd = kzalloc(sizeof(struct simtec_i2c_data), GFP_KERNEL); in simtec_i2c_probe()
81 if (pd == NULL) { in simtec_i2c_probe()
86 platform_set_drvdata(dev, pd); in simtec_i2c_probe()
97 pd->ioarea = request_mem_region(res->start, size, dev->name); in simtec_i2c_probe()
98 if (pd->ioarea == NULL) { in simtec_i2c_probe()
104 pd->reg = ioremap(res->start, size); in simtec_i2c_probe()
105 if (pd->reg == NULL) { in simtec_i2c_probe()
113 pd->adap.owner = THIS_MODULE; in simtec_i2c_probe()
114 pd->adap.algo_data = &pd->bit; in simtec_i2c_probe()
115 pd->adap.dev.parent = &dev->dev; in simtec_i2c_probe()
117 strlcpy(pd->adap.name, "Simtec I2C", sizeof(pd->adap.name)); in simtec_i2c_probe()
119 pd->bit.data = pd; in simtec_i2c_probe()
120 pd->bit.setsda = simtec_i2c_setsda; in simtec_i2c_probe()
121 pd->bit.setscl = simtec_i2c_setscl; in simtec_i2c_probe()
122 pd->bit.getsda = simtec_i2c_getsda; in simtec_i2c_probe()
123 pd->bit.getscl = simtec_i2c_getscl; in simtec_i2c_probe()
124 pd->bit.timeout = HZ; in simtec_i2c_probe()
125 pd->bit.udelay = 20; in simtec_i2c_probe()
127 ret = i2c_bit_add_bus(&pd->adap); in simtec_i2c_probe()
134 iounmap(pd->reg); in simtec_i2c_probe()
137 release_resource(pd->ioarea); in simtec_i2c_probe()
138 kfree(pd->ioarea); in simtec_i2c_probe()
141 kfree(pd); in simtec_i2c_probe()
147 struct simtec_i2c_data *pd = platform_get_drvdata(dev); in simtec_i2c_remove() local
149 i2c_del_adapter(&pd->adap); in simtec_i2c_remove()
151 iounmap(pd->reg); in simtec_i2c_remove()
152 release_resource(pd->ioarea); in simtec_i2c_remove()
153 kfree(pd->ioarea); in simtec_i2c_remove()
154 kfree(pd); in simtec_i2c_remove()