Lines Matching refs:ds2404_gpio
30 struct ds2404_gpio { struct
36 struct ds2404_gpio *gpio; argument
40 static struct ds2404_gpio ds2404_gpio[] = { variable
51 ds2404_gpio[DS2404_RST].gpio = pdata->gpio_rst; in ds2404_gpio_map()
52 ds2404_gpio[DS2404_CLK].gpio = pdata->gpio_clk; in ds2404_gpio_map()
53 ds2404_gpio[DS2404_DQ].gpio = pdata->gpio_dq; in ds2404_gpio_map()
55 for (i = 0; i < ARRAY_SIZE(ds2404_gpio); i++) { in ds2404_gpio_map()
56 err = gpio_request(ds2404_gpio[i].gpio, ds2404_gpio[i].name); in ds2404_gpio_map()
59 ds2404_gpio[i].name, err); in ds2404_gpio_map()
63 gpio_direction_output(ds2404_gpio[i].gpio, 1); in ds2404_gpio_map()
66 chip->gpio = ds2404_gpio; in ds2404_gpio_map()
71 gpio_free(ds2404_gpio[i].gpio); in ds2404_gpio_map()
79 for (i = 0; i < ARRAY_SIZE(ds2404_gpio); i++) in ds2404_gpio_unmap()
80 gpio_free(ds2404_gpio[i].gpio); in ds2404_gpio_unmap()
85 gpio_set_value(ds2404_gpio[DS2404_RST].gpio, 0); in ds2404_reset()
87 gpio_set_value(ds2404_gpio[DS2404_RST].gpio, 1); in ds2404_reset()
88 gpio_set_value(ds2404_gpio[DS2404_CLK].gpio, 0); in ds2404_reset()
89 gpio_direction_output(ds2404_gpio[DS2404_DQ].gpio, 0); in ds2404_reset()
97 gpio_direction_output(ds2404_gpio[DS2404_DQ].gpio, 1); in ds2404_write_byte()
99 gpio_set_value(ds2404_gpio[DS2404_DQ].gpio, byte & (1 << i)); in ds2404_write_byte()
101 gpio_set_value(ds2404_gpio[DS2404_CLK].gpio, 1); in ds2404_write_byte()
103 gpio_set_value(ds2404_gpio[DS2404_CLK].gpio, 0); in ds2404_write_byte()
113 gpio_direction_input(ds2404_gpio[DS2404_DQ].gpio); in ds2404_read_byte()
116 gpio_set_value(ds2404_gpio[DS2404_CLK].gpio, 0); in ds2404_read_byte()
118 if (gpio_get_value(ds2404_gpio[DS2404_DQ].gpio)) in ds2404_read_byte()
120 gpio_set_value(ds2404_gpio[DS2404_CLK].gpio, 1); in ds2404_read_byte()
171 gpio_direction_input(ds2404_gpio[DS2404_DQ].gpio); in ds2404_write_memory()
172 while (gpio_get_value(ds2404_gpio[DS2404_DQ].gpio)) in ds2404_write_memory()