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); |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 16 | |
Stephen Warren | 1e2082b | 2012-03-02 13:05:48 -0700 | [diff] [blame] | 17 | int pinmux_validate_map(struct pinctrl_map const *map, int i); |
| 18 | |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 19 | int pinmux_request_gpio(struct pinctrl_dev *pctldev, |
| 20 | struct pinctrl_gpio_range *range, |
| 21 | unsigned pin, unsigned gpio); |
| 22 | void pinmux_free_gpio(struct pinctrl_dev *pctldev, unsigned pin, |
| 23 | struct pinctrl_gpio_range *range); |
| 24 | int pinmux_gpio_direction(struct pinctrl_dev *pctldev, |
| 25 | struct pinctrl_gpio_range *range, |
| 26 | unsigned pin, bool input); |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 27 | |
| 28 | int pinmux_map_to_setting(struct pinctrl_map const *map, |
| 29 | struct pinctrl_setting *setting); |
| 30 | void pinmux_free_setting(struct pinctrl_setting const *setting); |
| 31 | int pinmux_enable_setting(struct pinctrl_setting const *setting); |
| 32 | void pinmux_disable_setting(struct pinctrl_setting const *setting); |
| 33 | |
Stephen Warren | 1e2082b | 2012-03-02 13:05:48 -0700 | [diff] [blame] | 34 | void pinmux_show_map(struct seq_file *s, struct pinctrl_map const *map); |
| 35 | void pinmux_show_setting(struct seq_file *s, |
| 36 | struct pinctrl_setting const *setting); |
Stephen Warren | 03665e0 | 2012-02-19 23:45:45 -0700 | [diff] [blame] | 37 | void pinmux_init_device_debugfs(struct dentry *devroot, |
| 38 | struct pinctrl_dev *pctldev); |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 39 | |
| 40 | #else |
| 41 | |
Tony Lindgren | b9130b7 | 2012-01-24 16:28:08 -0800 | [diff] [blame] | 42 | static inline int pinmux_check_ops(struct pinctrl_dev *pctldev) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 43 | { |
| 44 | return 0; |
| 45 | } |
| 46 | |
Stephen Warren | 1e2082b | 2012-03-02 13:05:48 -0700 | [diff] [blame] | 47 | static inline int pinmux_validate_map(struct pinctrl_map const *map, int i) |
| 48 | { |
| 49 | return 0; |
| 50 | } |
| 51 | |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 52 | static inline int pinmux_request_gpio(struct pinctrl_dev *pctldev, |
| 53 | struct pinctrl_gpio_range *range, |
| 54 | unsigned pin, unsigned gpio) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 55 | { |
| 56 | return 0; |
| 57 | } |
| 58 | |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 59 | static inline void pinmux_free_gpio(struct pinctrl_dev *pctldev, |
| 60 | unsigned pin, |
| 61 | struct pinctrl_gpio_range *range) |
| 62 | { |
| 63 | } |
| 64 | |
| 65 | static inline int pinmux_gpio_direction(struct pinctrl_dev *pctldev, |
| 66 | struct pinctrl_gpio_range *range, |
| 67 | unsigned pin, bool input) |
| 68 | { |
| 69 | return 0; |
| 70 | } |
| 71 | |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 72 | static inline int pinmux_map_to_setting(struct pinctrl_map const *map, |
| 73 | struct pinctrl_setting *setting) |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 74 | { |
| 75 | return 0; |
| 76 | } |
| 77 | |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 78 | static inline void pinmux_free_setting(struct pinctrl_setting const *setting) |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 79 | { |
| 80 | } |
| 81 | |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 82 | static inline int pinmux_enable_setting(struct pinctrl_setting const *setting) |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 83 | { |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 84 | return 0; |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 85 | } |
| 86 | |
Stephen Warren | 7ecdb16 | 2012-03-02 13:05:45 -0700 | [diff] [blame] | 87 | static inline void pinmux_disable_setting( |
| 88 | struct pinctrl_setting const *setting) |
Linus Walleij | befe5bd | 2012-02-09 19:47:48 +0100 | [diff] [blame] | 89 | { |
| 90 | } |
| 91 | |
Stephen Warren | 1e2082b | 2012-03-02 13:05:48 -0700 | [diff] [blame] | 92 | static inline void pinmux_show_map(struct seq_file *s, |
| 93 | struct pinctrl_map const *map) |
Stephen Warren | 03665e0 | 2012-02-19 23:45:45 -0700 | [diff] [blame] | 94 | { |
| 95 | } |
| 96 | |
Stephen Warren | 1e2082b | 2012-03-02 13:05:48 -0700 | [diff] [blame] | 97 | static inline void pinmux_show_setting(struct seq_file *s, |
| 98 | struct pinctrl_setting const *setting) |
| 99 | { |
| 100 | } |
| 101 | |
| 102 | static inline void pinmux_init_device_debugfs(struct dentry *devroot, |
| 103 | struct pinctrl_dev *pctldev) |
Linus Walleij | 2744e8a | 2011-05-02 20:50:54 +0200 | [diff] [blame] | 104 | { |
| 105 | } |
| 106 | |
| 107 | #endif |