• Home
  • Raw
  • Download

Lines Matching refs:pd

44 	struct simtec_i2c_data *pd = pw;  in simtec_i2c_setsda()  local
45 writeb(CMD_SET_SDA | (state ? STATE_SDA : 0), pd->reg); in simtec_i2c_setsda()
50 struct simtec_i2c_data *pd = pw; in simtec_i2c_setscl() local
51 writeb(CMD_SET_SCL | (state ? STATE_SCL : 0), pd->reg); in simtec_i2c_setscl()
56 struct simtec_i2c_data *pd = pw; in simtec_i2c_getsda() local
57 return readb(pd->reg) & STATE_SDA ? 1 : 0; in simtec_i2c_getsda()
62 struct simtec_i2c_data *pd = pw; in simtec_i2c_getscl() local
63 return readb(pd->reg) & STATE_SCL ? 1 : 0; in simtec_i2c_getscl()
70 struct simtec_i2c_data *pd; in simtec_i2c_probe() local
75 pd = kzalloc(sizeof(struct simtec_i2c_data), GFP_KERNEL); in simtec_i2c_probe()
76 if (pd == NULL) in simtec_i2c_probe()
79 platform_set_drvdata(dev, pd); in simtec_i2c_probe()
90 pd->ioarea = request_mem_region(res->start, size, dev->name); in simtec_i2c_probe()
91 if (pd->ioarea == NULL) { in simtec_i2c_probe()
97 pd->reg = ioremap(res->start, size); in simtec_i2c_probe()
98 if (pd->reg == NULL) { in simtec_i2c_probe()
106 pd->adap.owner = THIS_MODULE; in simtec_i2c_probe()
107 pd->adap.algo_data = &pd->bit; in simtec_i2c_probe()
108 pd->adap.dev.parent = &dev->dev; in simtec_i2c_probe()
110 strlcpy(pd->adap.name, "Simtec I2C", sizeof(pd->adap.name)); in simtec_i2c_probe()
112 pd->bit.data = pd; in simtec_i2c_probe()
113 pd->bit.setsda = simtec_i2c_setsda; in simtec_i2c_probe()
114 pd->bit.setscl = simtec_i2c_setscl; in simtec_i2c_probe()
115 pd->bit.getsda = simtec_i2c_getsda; in simtec_i2c_probe()
116 pd->bit.getscl = simtec_i2c_getscl; in simtec_i2c_probe()
117 pd->bit.timeout = HZ; in simtec_i2c_probe()
118 pd->bit.udelay = 20; in simtec_i2c_probe()
120 ret = i2c_bit_add_bus(&pd->adap); in simtec_i2c_probe()
127 iounmap(pd->reg); in simtec_i2c_probe()
130 release_resource(pd->ioarea); in simtec_i2c_probe()
131 kfree(pd->ioarea); in simtec_i2c_probe()
134 kfree(pd); in simtec_i2c_probe()
140 struct simtec_i2c_data *pd = platform_get_drvdata(dev); in simtec_i2c_remove() local
142 i2c_del_adapter(&pd->adap); in simtec_i2c_remove()
144 iounmap(pd->reg); in simtec_i2c_remove()
145 release_resource(pd->ioarea); in simtec_i2c_remove()
146 kfree(pd->ioarea); in simtec_i2c_remove()
147 kfree(pd); in simtec_i2c_remove()