Lines Matching +full:push +full:- +full:pull
1 // SPDX-License-Identifier: GPL-2.0-only
4 National Semiconductor common GPIO device-file/VFS methods.
7 Copyright (c) 2001,2002 Christer Weinigel <wingel@nano-system.com>
26 u32 config = amp->gpio_config(index, ~0, 0); in nsc_gpio_dump()
29 dev_info(amp->dev, "io%02u: 0x%04x %s %s %s %s %s %s %s\tio:%d/%d\n", in nsc_gpio_dump()
31 (config & 1) ? "OE" : "TS", /* output-enabled/tristate */ in nsc_gpio_dump()
32 (config & 2) ? "PP" : "OD", /* push pull / open drain */ in nsc_gpio_dump()
33 (config & 4) ? "PUE" : "PUD", /* pull up enabled/disabled */ in nsc_gpio_dump()
39 amp->gpio_get(index), amp->gpio_current(index)); in nsc_gpio_dump()
46 struct nsc_gpio_ops *amp = file->private_data; in nsc_gpio_write()
47 struct device *dev = amp->dev; in nsc_gpio_write()
54 return -EFAULT; in nsc_gpio_write()
57 amp->gpio_set(m, 0); in nsc_gpio_write()
60 amp->gpio_set(m, 1); in nsc_gpio_write()
64 amp->gpio_config(m, ~1, 1); in nsc_gpio_write()
68 amp->gpio_config(m, ~1, 0); in nsc_gpio_write()
71 dev_dbg(dev, "GPIO%d output is push pull\n", m); in nsc_gpio_write()
72 amp->gpio_config(m, ~2, 2); in nsc_gpio_write()
76 amp->gpio_config(m, ~2, 0); in nsc_gpio_write()
79 dev_dbg(dev, "GPIO%d pull up enabled\n", m); in nsc_gpio_write()
80 amp->gpio_config(m, ~4, 4); in nsc_gpio_write()
83 dev_dbg(dev, "GPIO%d pull up disabled\n", m); in nsc_gpio_write()
84 amp->gpio_config(m, ~4, 0); in nsc_gpio_write()
88 amp->gpio_dump(amp, m); in nsc_gpio_write()
100 return -EINVAL; /* full string handled, report error */ in nsc_gpio_write()
110 struct nsc_gpio_ops *amp = file->private_data; in nsc_gpio_read()
112 value = amp->gpio_get(m); in nsc_gpio_read()
114 return -EFAULT; in nsc_gpio_read()
119 /* common file-ops routines for both scx200_gpio and pc87360_gpio */