~ubuntu-branches/ubuntu/trusty/linux-armadaxp/trusty

« back to all changes in this revision

Viewing changes to include/linux/pinctrl/machine.h

  • Committer: Package Import Robot
  • Author(s): Michael Casadevall, Bryan Wu, Dann Frazier, Michael Casadeall
  • Date: 2012-03-10 15:00:54 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120310150054-flugb39zon8vvgwe
Tags: 3.2.0-1600.1
[ Bryan Wu ]
* UBUNTU: import debian/debian.env and debian.armadaxp

[ Dann Frazier ]
* ARM: Armada XP: remove trailing '/' in dirnames in mvRules.mk

[ Michael Casadeall ]
* tools: add some tools for Marvell Armada XP processor
* kernel: timer tick hacking from Marvell
* kernel: Sheeva Errata: add delay on Sheeva when powering down
* net: add Marvell NFP netfilter
* net: socket and skb modifications made by Marvell
* miscdevice: add minor IDs for some Marvell Armada drivers
* fs: introduce memory pool for splice()
* video: EDID detection updates from Marvell Armada XP patchset
* video: backlight: add Marvell Dove LCD backlight driver
* video: display: add THS8200 display driver
* video: framebuffer: add Marvell Dove and Armada XP processor onchip LCD controller driver
* usbtest: add Interrupt transfer testing by Marvell Armada XP code
* usb: ehci: add support for Marvell EHCI controler
* tty/serial: 8250: add support for Marvell Armada XP processor and DeviceTree work
* rtc: add support for Marvell Armada XP onchip RTC controller
* net: pppoe: add Marvell ethernet NFP hook in PPPoE networking driver
* mtd: nand: add support for Marvell Armada XP Nand Flash Controller
* mtd: maps: add Marvell Armada XP specific map driver
* mmc: add support for Marvell Armada XP MMC/SD host controller
* i2c: add support for Marvell Armada XP onchip i2c bus controller
* hwmon: add Kconfig option for Armada XP onchip thermal sensor driver
* dmaengine: add Net DMA support for splice and update Marvell XOR DMA engine driver
* ata: add support for Marvell Armada XP SATA controller and update some quirks
* ARM: add Marvell Armada XP machine to mach-types
* ARM: oprofile: add support for Marvell PJ4B core
* ARM: mm: more ARMv6 switches for Marvell Armada XP
* ARM: remove static declaration to allow compilation
* ARM: alignment access fault trick
* ARM: mm: skip some fault fixing when run on NONE SMP ARMv6 mode during early abort event
* ARM: mm: add Marvell Sheeva CPU Architecture for PJ4B
* ARM: introduce optimized copy operation for Marvell Armada XP
* ARM: SAUCE: hardware breakpoint trick for Marvell Armada XP
* ARM: big endian and little endian tricks for Marvell Armada XP
* ARM: SAUCE: Add Marvell Armada XP build rules to arch/arm/kernel/Makefile
* ARM: vfp: add special handling for Marvell Armada XP
* ARM: add support for Marvell U-Boot
* ARM: add mv_controller_num for ARM PCI drivers
* ARM: add support for local PMUs, general SMP tweaks and cache flushing
* ARM: add Marvell device identifies in glue-proc.h
* ARM: add IPC driver support for Marvell platforms
* ARM: add DMA mapping for Marvell platforms
* ARM: add Sheeva errata and PJ4B code for booting
* ARM: update Kconfig and Makefile to include Marvell Armada XP platforms
* ARM: Armada XP: import LSP from Marvell for Armada XP 3.2 kernel enablement

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Machine interface for the pinctrl subsystem.
 
3
 *
 
4
 * Copyright (C) 2011 ST-Ericsson SA
 
5
 * Written on behalf of Linaro for ST-Ericsson
 
6
 * Based on bits of regulator core, gpio core and clk core
 
7
 *
 
8
 * Author: Linus Walleij <linus.walleij@linaro.org>
 
9
 *
 
10
 * License terms: GNU General Public License (GPL) version 2
 
11
 */
 
12
#ifndef __LINUX_PINMUX_MACHINE_H
 
13
#define __LINUX_PINMUX_MACHINE_H
 
14
 
 
15
/**
 
16
 * struct pinmux_map - boards/machines shall provide this map for devices
 
17
 * @name: the name of this specific map entry for the particular machine.
 
18
 *      This is the second parameter passed to pinmux_get() when you want
 
19
 *      to have several mappings to the same device
 
20
 * @ctrl_dev: the pin control device to be used by this mapping, may be NULL
 
21
 *      if you provide .ctrl_dev_name instead (this is more common)
 
22
 * @ctrl_dev_name: the name of the device controlling this specific mapping,
 
23
 *      the name must be the same as in your struct device*, may be NULL if
 
24
 *      you provide .ctrl_dev instead
 
25
 * @function: a function in the driver to use for this mapping, the driver
 
26
 *      will lookup the function referenced by this ID on the specified
 
27
 *      pin control device
 
28
 * @group: sometimes a function can map to different pin groups, so this
 
29
 *      selects a certain specific pin group to activate for the function, if
 
30
 *      left as NULL, the first applicable group will be used
 
31
 * @dev: the device using this specific mapping, may be NULL if you provide
 
32
 *      .dev_name instead (this is more common)
 
33
 * @dev_name: the name of the device using this specific mapping, the name
 
34
 *      must be the same as in your struct device*, may be NULL if you
 
35
 *      provide .dev instead
 
36
 * @hog_on_boot: if this is set to true, the pin control subsystem will itself
 
37
 *      hog the mappings as the pinmux device drivers are attached, so this is
 
38
 *      typically used with system maps (mux mappings without an assigned
 
39
 *      device) that you want to get hogged and enabled by default as soon as
 
40
 *      a pinmux device supporting it is registered. These maps will not be
 
41
 *      disabled and put until the system shuts down.
 
42
 */
 
43
struct pinmux_map {
 
44
        const char *name;
 
45
        struct device *ctrl_dev;
 
46
        const char *ctrl_dev_name;
 
47
        const char *function;
 
48
        const char *group;
 
49
        struct device *dev;
 
50
        const char *dev_name;
 
51
        const bool hog_on_boot;
 
52
};
 
53
 
 
54
/*
 
55
 * Convenience macro to set a simple map from a certain pin controller and a
 
56
 * certain function to a named device
 
57
 */
 
58
#define PINMUX_MAP(a, b, c, d) \
 
59
        { .name = a, .ctrl_dev_name = b, .function = c, .dev_name = d }
 
60
 
 
61
/*
 
62
 * Convenience macro to map a system function onto a certain pinctrl device.
 
63
 * System functions are not assigned to a particular device.
 
64
 */
 
65
#define PINMUX_MAP_SYS(a, b, c) \
 
66
        { .name = a, .ctrl_dev_name = b, .function = c }
 
67
 
 
68
/*
 
69
 * Convenience macro to map a function onto the primary device pinctrl device
 
70
 * this is especially helpful on systems that have only one pin controller
 
71
 * or need to set up a lot of mappings on the primary controller.
 
72
 */
 
73
#define PINMUX_MAP_PRIMARY(a, b, c) \
 
74
        { .name = a, .ctrl_dev_name = "pinctrl.0", .function = b, \
 
75
          .dev_name = c }
 
76
 
 
77
/*
 
78
 * Convenience macro to map a system function onto the primary pinctrl device.
 
79
 * System functions are not assigned to a particular device.
 
80
 */
 
81
#define PINMUX_MAP_PRIMARY_SYS(a, b) \
 
82
        { .name = a, .ctrl_dev_name = "pinctrl.0", .function = b }
 
83
 
 
84
/*
 
85
 * Convenience macro to map a system function onto the primary pinctrl device,
 
86
 * to be hogged by the pinmux core until the system shuts down.
 
87
 */
 
88
#define PINMUX_MAP_PRIMARY_SYS_HOG(a, b) \
 
89
        { .name = a, .ctrl_dev_name = "pinctrl.0", .function = b, \
 
90
          .hog_on_boot = true }
 
91
 
 
92
 
 
93
#ifdef CONFIG_PINMUX
 
94
 
 
95
extern int pinmux_register_mappings(struct pinmux_map const *map,
 
96
                                unsigned num_maps);
 
97
 
 
98
#else
 
99
 
 
100
static inline int pinmux_register_mappings(struct pinmux_map const *map,
 
101
                                           unsigned num_maps)
 
102
{
 
103
        return 0;
 
104
}
 
105
 
 
106
#endif /* !CONFIG_PINMUX */
 
107
#endif