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