Lines Matching refs:gw
37 struct gw_pld *gw = gpiochip_get_data(gc);
39 gw->out |= BIT(offset);
40 return i2c_smbus_write_byte(gw->client, gw->out);
45 struct gw_pld *gw = gpiochip_get_data(gc);
48 val = i2c_smbus_read_byte(gw->client);
55 struct gw_pld *gw = gpiochip_get_data(gc);
58 gw->out |= BIT(offset);
60 gw->out &= ~BIT(offset);
62 return i2c_smbus_write_byte(gw->client, gw->out);
75 struct gw_pld *gw;
78 gw = devm_kzalloc(dev, sizeof(*gw), GFP_KERNEL);
79 if (!gw)
82 gw->chip.base = -1;
83 gw->chip.can_sleep = true;
84 gw->chip.parent = dev;
85 gw->chip.of_node = np;
86 gw->chip.owner = THIS_MODULE;
87 gw->chip.label = dev_name(dev);
88 gw->chip.ngpio = 8;
89 gw->chip.direction_input = gw_pld_input8;
90 gw->chip.get = gw_pld_get8;
91 gw->chip.direction_output = gw_pld_output8;
92 gw->chip.set = gw_pld_set8;
93 gw->client = client;
101 gw->out = 0xFF;
103 i2c_set_clientdata(client, gw);
105 ret = devm_gpiochip_add_data(dev, &gw->chip, gw);
115 { "gw-pld", },