Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Internal interface between the core pin control system and the |
| 3 | * pinmux portions |
| 4 | * |
| 5 | * Copyright (C) 2011 ST-Ericsson SA |
| 6 | * Written on behalf of Linaro for ST-Ericsson |
| 7 | * Based on bits of regulator core, gpio core and clk core |
| 8 | * |
| 9 | * Author: Linus Walleij <linus.walleij@linaro.org> |
| 10 | * |
| 11 | * License terms: GNU General Public License (GPL) version 2 |
| 12 | */ |
| 13 | #ifdef CONFIG_PINMUX |
| 14 | |
Tony Lindgren | b9130b7 | 2012-01-24 16:28:08 -0800 | [diff] [blame] | 15 | int pinmux_check_ops(struct pinctrl_dev *pctldev); |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 16 | void pinmux_init_device_debugfs(struct dentry *devroot, |
| 17 | struct pinctrl_dev *pctldev); |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame^] | 18 | int pinmux_request_gpio(struct pinctrl_dev *pctldev, |
| 19 | struct pinctrl_gpio_range *range, |
| 20 | unsigned pin, unsigned gpio); |
| 21 | void pinmux_free_gpio(struct pinctrl_dev *pctldev, unsigned pin, |
| 22 | struct pinctrl_gpio_range *range); |
| 23 | int pinmux_gpio_direction(struct pinctrl_dev *pctldev, |
| 24 | struct pinctrl_gpio_range *range, |
| 25 | unsigned pin, bool input); |
| 26 | static inline void pinmux_init_pinctrl_handle(struct pinctrl *p) |
| 27 | { |
| 28 | p->func_selector = UINT_MAX; |
| 29 | INIT_LIST_HEAD(&p->groups); |
| 30 | } |
| 31 | int pinmux_apply_muxmap(struct pinctrl_dev *pctldev, |
| 32 | struct pinctrl *p, |
| 33 | struct device *dev, |
| 34 | const char *devname, |
| 35 | struct pinctrl_map const *map); |
| 36 | void pinmux_put(struct pinctrl *p); |
| 37 | int pinmux_enable(struct pinctrl *p); |
| 38 | void pinmux_disable(struct pinctrl *p); |
| 39 | void pinmux_dbg_show(struct seq_file *s, struct pinctrl *p); |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 40 | |
| 41 | #else |
| 42 | |
Tony Lindgren | b9130b7 | 2012-01-24 16:28:08 -0800 | [diff] [blame] | 43 | static inline int pinmux_check_ops(struct pinctrl_dev *pctldev) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 44 | { |
| 45 | return 0; |
| 46 | } |
| 47 | |
| 48 | static inline void pinmux_init_device_debugfs(struct dentry *devroot, |
| 49 | struct pinctrl_dev *pctldev) |
| 50 | { |
| 51 | } |
| 52 | |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame^] | 53 | static inline int pinmux_request_gpio(struct pinctrl_dev *pctldev, |
| 54 | struct pinctrl_gpio_range *range, |
| 55 | unsigned pin, unsigned gpio) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 56 | { |
| 57 | return 0; |
| 58 | } |
| 59 | |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame^] | 60 | static inline void pinmux_free_gpio(struct pinctrl_dev *pctldev, |
| 61 | unsigned pin, |
| 62 | struct pinctrl_gpio_range *range) |
| 63 | { |
| 64 | } |
| 65 | |
| 66 | static inline int pinmux_gpio_direction(struct pinctrl_dev *pctldev, |
| 67 | struct pinctrl_gpio_range *range, |
| 68 | unsigned pin, bool input) |
| 69 | { |
| 70 | return 0; |
| 71 | } |
| 72 | |
| 73 | static inline void pinmux_init_pinctrl_handle(struct pinctrl *p) |
| 74 | { |
| 75 | } |
| 76 | |
| 77 | static inline int pinmux_apply_muxmap(struct pinctrl_dev *pctldev, |
| 78 | struct pinctrl *p, |
| 79 | struct device *dev, |
| 80 | const char *devname, |
| 81 | struct pinctrl_map const *map) |
| 82 | { |
| 83 | return 0; |
| 84 | } |
| 85 | |
| 86 | static inline void pinmux_put(struct pinctrl *p) |
| 87 | { |
| 88 | } |
| 89 | |
| 90 | static inline int pinmux_enable(struct pinctrl *p) |
| 91 | { |
| 92 | } |
| 93 | |
| 94 | static inline void pinmux_disable(struct pinctrl *p) |
| 95 | { |
| 96 | } |
| 97 | |
| 98 | void pinmux_dbg_show(struct seq_file *s, struct pinctrl *p) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 99 | { |
| 100 | } |
| 101 | |
| 102 | #endif |