aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-12-22 19:43:42 -0500
committerDave Airlie <airlied@redhat.com>2013-12-22 19:43:42 -0500
commit785e15ecefbfe8ea311ae320fdacd482a84b3cc3 (patch)
tree46ed5413424d3893bf6236684e597388f68ad5ad /include
parente6c3dcdea6c95e4de98681a6cb3124ed8eacd5d6 (diff)
parent81239c6f7972d4909a6862d08ed1d2943983ffd4 (diff)
Merge tag 'drm/for-3.14-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next
drm/tegra: Changes for v3.14-rc1 This series of changes brings DRM panel support as well as initial code to register DSI hosts and peripherals and bind them to DSI drivers. The panel and DSI code are both used by the simple panel driver. The Tegra-specific changes build on top of this work to add support for various panels found on Tegra boards. New drivers enable the DSI host found on Tegra114 and a special hardware block that calibrates the pads used for DSI and CSI. The host1x and the display controller drivers gain basic Tegra124 support. To round of the new features, the DRM driver now sports a very simple PRIME implementation. In addition there are various improvements such as the host1x API being exported so that client drivers (like the Tegra DRM driver) can be built as modules. HDMI now does better power management and legacy FBDEV can now be disabled via Kconfig (though it's still enabled by default). A few sparse warnings have been squashed and various parts of the code have become more robust. * tag 'drm/for-3.14-rc1' of git://anongit.freedesktop.org/tegra/linux: (121 commits) drm/tegra: fix compile w/ CONFIG_DYNAMIC_DEBUG drm/tegra: Add PRIME support drm/tegra: Relocate some output-specific code drm/tegra: Add Tegra124 DC support drm/tegra: Fix small leak on error in tegra_fb_alloc() drm/tegra: Make legacy fbdev support optional drm/tegra: Sort reverse-dependencies alphabetically drm/tegra: Fix return value check drm/tegra: Add DSI support drm/tegra: Disable outputs for power-saving drm/tegra: Track HDMI enable state drm/tegra: Fix HDMI audio frequency typo drm/tegra: Do not export tegra_bo_ops drm/tegra: Remove spurious blank line drm/tegra: Increase compile test coverage drm/tegra: Allow the driver to be built as a module gpu: host1x: Add Tegra124 support gpu: host1x: clk_round_rate() can return a zero upon error gpu: host1x: Fix build warnings gpu: host1x: Increase compile test coverage ...
Diffstat (limited to 'include')
-rw-r--r--include/drm/drm_mipi_dsi.h158
-rw-r--r--include/drm/drm_panel.h82
-rw-r--r--include/dt-bindings/clock/tegra114-car.h8
-rw-r--r--include/dt-bindings/clock/tegra124-car.h341
-rw-r--r--include/dt-bindings/clock/tegra20-car.h2
-rw-r--r--include/dt-bindings/clock/tegra30-car.h12
-rw-r--r--include/linux/clk/tegra.h7
-rw-r--r--include/linux/dmaengine.h9
-rw-r--r--include/linux/host1x.h6
-rw-r--r--include/linux/tegra-powergate.h55
-rw-r--r--include/sound/dmaengine_pcm.h10
11 files changed, 674 insertions, 16 deletions
diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
new file mode 100644
index 000000000000..d32628acdd90
--- /dev/null
+++ b/include/drm/drm_mipi_dsi.h
@@ -0,0 +1,158 @@
1/*
2 * MIPI DSI Bus
3 *
4 * Copyright (C) 2012-2013, Samsung Electronics, Co., Ltd.
5 * Andrzej Hajda <a.hajda@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __DRM_MIPI_DSI_H__
13#define __DRM_MIPI_DSI_H__
14
15#include <linux/device.h>
16
17struct mipi_dsi_host;
18struct mipi_dsi_device;
19
20/**
21 * struct mipi_dsi_msg - read/write DSI buffer
22 * @channel: virtual channel id
23 * @type: payload data type
24 * @tx_len: length of @tx_buf
25 * @tx_buf: data to be written
26 * @rx_len: length of @rx_buf
27 * @rx_buf: data to be read, or NULL
28 */
29struct mipi_dsi_msg {
30 u8 channel;
31 u8 type;
32
33 size_t tx_len;
34 const void *tx_buf;
35
36 size_t rx_len;
37 void *rx_buf;
38};
39
40/**
41 * struct mipi_dsi_host_ops - DSI bus operations
42 * @attach: attach DSI device to DSI host
43 * @detach: detach DSI device from DSI host
44 * @transfer: send and/or receive DSI packet, return number of received bytes,
45 * or error
46 */
47struct mipi_dsi_host_ops {
48 int (*attach)(struct mipi_dsi_host *host,
49 struct mipi_dsi_device *dsi);
50 int (*detach)(struct mipi_dsi_host *host,
51 struct mipi_dsi_device *dsi);
52 ssize_t (*transfer)(struct mipi_dsi_host *host,
53 struct mipi_dsi_msg *msg);
54};
55
56/**
57 * struct mipi_dsi_host - DSI host device
58 * @dev: driver model device node for this DSI host
59 * @ops: DSI host operations
60 */
61struct mipi_dsi_host {
62 struct device *dev;
63 const struct mipi_dsi_host_ops *ops;
64};
65
66int mipi_dsi_host_register(struct mipi_dsi_host *host);
67void mipi_dsi_host_unregister(struct mipi_dsi_host *host);
68
69/* DSI mode flags */
70
71/* video mode */
72#define MIPI_DSI_MODE_VIDEO BIT(0)
73/* video burst mode */
74#define MIPI_DSI_MODE_VIDEO_BURST BIT(1)
75/* video pulse mode */
76#define MIPI_DSI_MODE_VIDEO_SYNC_PULSE BIT(2)
77/* enable auto vertical count mode */
78#define MIPI_DSI_MODE_VIDEO_AUTO_VERT BIT(3)
79/* enable hsync-end packets in vsync-pulse and v-porch area */
80#define MIPI_DSI_MODE_VIDEO_HSE BIT(4)
81/* disable hfront-porch area */
82#define MIPI_DSI_MODE_VIDEO_HFP BIT(5)
83/* disable hback-porch area */
84#define MIPI_DSI_MODE_VIDEO_HBP BIT(6)
85/* disable hsync-active area */
86#define MIPI_DSI_MODE_VIDEO_HSA BIT(7)
87/* flush display FIFO on vsync pulse */
88#define MIPI_DSI_MODE_VSYNC_FLUSH BIT(8)
89/* disable EoT packets in HS mode */
90#define MIPI_DSI_MODE_EOT_PACKET BIT(9)
91
92enum mipi_dsi_pixel_format {
93 MIPI_DSI_FMT_RGB888,
94 MIPI_DSI_FMT_RGB666,
95 MIPI_DSI_FMT_RGB666_PACKED,
96 MIPI_DSI_FMT_RGB565,
97};
98
99/**
100 * struct mipi_dsi_device - DSI peripheral device
101 * @host: DSI host for this peripheral
102 * @dev: driver model device node for this peripheral
103 * @channel: virtual channel assigned to the peripheral
104 * @format: pixel format for video mode
105 * @lanes: number of active data lanes
106 * @mode_flags: DSI operation mode related flags
107 */
108struct mipi_dsi_device {
109 struct mipi_dsi_host *host;
110 struct device dev;
111
112 unsigned int channel;
113 unsigned int lanes;
114 enum mipi_dsi_pixel_format format;
115 unsigned long mode_flags;
116};
117
118#define to_mipi_dsi_device(d) container_of(d, struct mipi_dsi_device, dev)
119
120int mipi_dsi_attach(struct mipi_dsi_device *dsi);
121int mipi_dsi_detach(struct mipi_dsi_device *dsi);
122int mipi_dsi_dcs_write(struct mipi_dsi_device *dsi, unsigned int channel,
123 const void *data, size_t len);
124ssize_t mipi_dsi_dcs_read(struct mipi_dsi_device *dsi, unsigned int channel,
125 u8 cmd, void *data, size_t len);
126
127/**
128 * struct mipi_dsi_driver - DSI driver
129 * @driver: device driver model driver
130 * @probe: callback for device binding
131 * @remove: callback for device unbinding
132 */
133struct mipi_dsi_driver {
134 struct device_driver driver;
135 int(*probe)(struct mipi_dsi_device *dsi);
136 int(*remove)(struct mipi_dsi_device *dsi);
137};
138
139#define to_mipi_dsi_driver(d) container_of(d, struct mipi_dsi_driver, driver)
140
141static inline void *mipi_dsi_get_drvdata(const struct mipi_dsi_device *dsi)
142{
143 return dev_get_drvdata(&dsi->dev);
144}
145
146static inline void mipi_dsi_set_drvdata(struct mipi_dsi_device *dsi, void *data)
147{
148 dev_set_drvdata(&dsi->dev, data);
149}
150
151int mipi_dsi_driver_register(struct mipi_dsi_driver *driver);
152void mipi_dsi_driver_unregister(struct mipi_dsi_driver *driver);
153
154#define module_mipi_dsi_driver(__mipi_dsi_driver) \
155 module_driver(__mipi_dsi_driver, mipi_dsi_driver_register, \
156 mipi_dsi_driver_unregister)
157
158#endif /* __DRM_MIPI_DSI__ */
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
new file mode 100644
index 000000000000..c2ab77add67c
--- /dev/null
+++ b/include/drm/drm_panel.h
@@ -0,0 +1,82 @@
1/*
2 * Copyright (C) 2013, NVIDIA Corporation. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sub license,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the
12 * next paragraph) shall be included in all copies or substantial portions
13 * of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 */
23
24#ifndef __DRM_PANEL_H__
25#define __DRM_PANEL_H__
26
27#include <linux/list.h>
28
29struct drm_connector;
30struct drm_device;
31struct drm_panel;
32
33struct drm_panel_funcs {
34 int (*disable)(struct drm_panel *panel);
35 int (*enable)(struct drm_panel *panel);
36 int (*get_modes)(struct drm_panel *panel);
37};
38
39struct drm_panel {
40 struct drm_device *drm;
41 struct drm_connector *connector;
42 struct device *dev;
43
44 const struct drm_panel_funcs *funcs;
45
46 struct list_head list;
47};
48
49static inline int drm_panel_disable(struct drm_panel *panel)
50{
51 if (panel && panel->funcs && panel->funcs->disable)
52 return panel->funcs->disable(panel);
53
54 return panel ? -ENOSYS : -EINVAL;
55}
56
57static inline int drm_panel_enable(struct drm_panel *panel)
58{
59 if (panel && panel->funcs && panel->funcs->enable)
60 return panel->funcs->enable(panel);
61
62 return panel ? -ENOSYS : -EINVAL;
63}
64
65void drm_panel_init(struct drm_panel *panel);
66
67int drm_panel_add(struct drm_panel *panel);
68void drm_panel_remove(struct drm_panel *panel);
69
70int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector);
71int drm_panel_detach(struct drm_panel *panel);
72
73#ifdef CONFIG_OF
74struct drm_panel *of_drm_find_panel(struct device_node *np);
75#else
76static inline struct drm_panel *of_drm_find_panel(struct device_node *np)
77{
78 return NULL;
79}
80#endif
81
82#endif
diff --git a/include/dt-bindings/clock/tegra114-car.h b/include/dt-bindings/clock/tegra114-car.h
index 614aec417902..6d0d8d8ef31e 100644
--- a/include/dt-bindings/clock/tegra114-car.h
+++ b/include/dt-bindings/clock/tegra114-car.h
@@ -37,10 +37,10 @@
37#define TEGRA114_CLK_I2S2 18 37#define TEGRA114_CLK_I2S2 18
38#define TEGRA114_CLK_EPP 19 38#define TEGRA114_CLK_EPP 19
39/* 20 (register bit affects vi and vi_sensor) */ 39/* 20 (register bit affects vi and vi_sensor) */
40#define TEGRA114_CLK_GR_2D 21 40#define TEGRA114_CLK_GR2D 21
41#define TEGRA114_CLK_USBD 22 41#define TEGRA114_CLK_USBD 22
42#define TEGRA114_CLK_ISP 23 42#define TEGRA114_CLK_ISP 23
43#define TEGRA114_CLK_GR_3D 24 43#define TEGRA114_CLK_GR3D 24
44/* 25 */ 44/* 25 */
45#define TEGRA114_CLK_DISP2 26 45#define TEGRA114_CLK_DISP2 26
46#define TEGRA114_CLK_DISP1 27 46#define TEGRA114_CLK_DISP1 27
@@ -289,8 +289,8 @@
289#define TEGRA114_CLK_PCLK 261 289#define TEGRA114_CLK_PCLK 261
290#define TEGRA114_CLK_CCLK_G 262 290#define TEGRA114_CLK_CCLK_G 262
291#define TEGRA114_CLK_CCLK_LP 263 291#define TEGRA114_CLK_CCLK_LP 263
292/* 264 */ 292#define TEGRA114_CLK_DFLL_REF 264
293/* 265 */ 293#define TEGRA114_CLK_DFLL_SOC 265
294/* 266 */ 294/* 266 */
295/* 267 */ 295/* 267 */
296/* 268 */ 296/* 268 */
diff --git a/include/dt-bindings/clock/tegra124-car.h b/include/dt-bindings/clock/tegra124-car.h
new file mode 100644
index 000000000000..a1116a3b54ef
--- /dev/null
+++ b/include/dt-bindings/clock/tegra124-car.h
@@ -0,0 +1,341 @@
1/*
2 * This header provides constants for binding nvidia,tegra124-car.
3 *
4 * The first 192 clocks are numbered to match the bits in the CAR's CLK_OUT_ENB
5 * registers. These IDs often match those in the CAR's RST_DEVICES registers,
6 * but not in all cases. Some bits in CLK_OUT_ENB affect multiple clocks. In
7 * this case, those clocks are assigned IDs above 185 in order to highlight
8 * this issue. Implementations that interpret these clock IDs as bit values
9 * within the CLK_OUT_ENB or RST_DEVICES registers should be careful to
10 * explicitly handle these special cases.
11 *
12 * The balance of the clocks controlled by the CAR are assigned IDs of 185 and
13 * above.
14 */
15
16#ifndef _DT_BINDINGS_CLOCK_TEGRA124_CAR_H
17#define _DT_BINDINGS_CLOCK_TEGRA124_CAR_H
18
19/* 0 */
20/* 1 */
21/* 2 */
22#define TEGRA124_CLK_ISPB 3
23#define TEGRA124_CLK_RTC 4
24#define TEGRA124_CLK_TIMER 5
25#define TEGRA124_CLK_UARTA 6
26/* 7 (register bit affects uartb and vfir) */
27/* 8 */
28#define TEGRA124_CLK_SDMMC2 9
29/* 10 (register bit affects spdif_in and spdif_out) */
30#define TEGRA124_CLK_I2S1 11
31#define TEGRA124_CLK_I2C1 12
32#define TEGRA124_CLK_NDFLASH 13
33#define TEGRA124_CLK_SDMMC1 14
34#define TEGRA124_CLK_SDMMC4 15
35/* 16 */
36#define TEGRA124_CLK_PWM 17
37#define TEGRA124_CLK_I2S2 18
38/* 20 (register bit affects vi and vi_sensor) */
39#define TEGRA124_CLK_GR_2D 21
40#define TEGRA124_CLK_USBD 22
41#define TEGRA124_CLK_ISP 23
42#define TEGRA124_CLK_GR_3D 24
43/* 25 */
44#define TEGRA124_CLK_DISP2 26
45#define TEGRA124_CLK_DISP1 27
46#define TEGRA124_CLK_HOST1X 28
47#define TEGRA124_CLK_VCP 29
48#define TEGRA124_CLK_I2S0 30
49/* 31 */
50
51/* 32 */
52/* 33 */
53#define TEGRA124_CLK_APBDMA 34
54/* 35 */
55#define TEGRA124_CLK_KBC 36
56/* 37 */
57/* 38 */
58/* 39 (register bit affects fuse and fuse_burn) */
59#define TEGRA124_CLK_KFUSE 40
60#define TEGRA124_CLK_SBC1 41
61#define TEGRA124_CLK_NOR 42
62/* 43 */
63#define TEGRA124_CLK_SBC2 44
64/* 45 */
65#define TEGRA124_CLK_SBC3 46
66#define TEGRA124_CLK_I2C5 47
67#define TEGRA124_CLK_DSIA 48
68/* 49 */
69#define TEGRA124_CLK_MIPI 50
70#define TEGRA124_CLK_HDMI 51
71#define TEGRA124_CLK_CSI 52
72/* 53 */
73#define TEGRA124_CLK_I2C2 54
74#define TEGRA124_CLK_UARTC 55
75#define TEGRA124_CLK_MIPI_CAL 56
76#define TEGRA124_CLK_EMC 57
77#define TEGRA124_CLK_USB2 58
78#define TEGRA124_CLK_USB3 59
79/* 60 */
80#define TEGRA124_CLK_VDE 61
81#define TEGRA124_CLK_BSEA 62
82#define TEGRA124_CLK_BSEV 63
83
84/* 64 */
85#define TEGRA124_CLK_UARTD 65
86#define TEGRA124_CLK_UARTE 66
87#define TEGRA124_CLK_I2C3 67
88#define TEGRA124_CLK_SBC4 68
89#define TEGRA124_CLK_SDMMC3 69
90#define TEGRA124_CLK_PCIE 70
91#define TEGRA124_CLK_OWR 71
92#define TEGRA124_CLK_AFI 72
93#define TEGRA124_CLK_CSITE 73
94/* 74 */
95/* 75 */
96#define TEGRA124_CLK_LA 76
97#define TEGRA124_CLK_TRACE 77
98#define TEGRA124_CLK_SOC_THERM 78
99#define TEGRA124_CLK_DTV 79
100#define TEGRA124_CLK_NDSPEED 80
101#define TEGRA124_CLK_I2CSLOW 81
102#define TEGRA124_CLK_DSIB 82
103#define TEGRA124_CLK_TSEC 83
104/* 84 */
105/* 85 */
106/* 86 */
107/* 87 */
108/* 88 */
109#define TEGRA124_CLK_XUSB_HOST 89
110/* 90 */
111#define TEGRA124_CLK_MSENC 91
112#define TEGRA124_CLK_CSUS 92
113/* 93 */
114/* 94 */
115/* 95 (bit affects xusb_dev and xusb_dev_src) */
116
117/* 96 */
118/* 97 */
119/* 98 */
120#define TEGRA124_CLK_MSELECT 99
121#define TEGRA124_CLK_TSENSOR 100
122#define TEGRA124_CLK_I2S3 101
123#define TEGRA124_CLK_I2S4 102
124#define TEGRA124_CLK_I2C4 103
125#define TEGRA124_CLK_SBC5 104
126#define TEGRA124_CLK_SBC6 105
127#define TEGRA124_CLK_D_AUDIO 106
128#define TEGRA124_CLK_APBIF 107
129#define TEGRA124_CLK_DAM0 108
130#define TEGRA124_CLK_DAM1 109
131#define TEGRA124_CLK_DAM2 110
132#define TEGRA124_CLK_HDA2CODEC_2X 111
133/* 112 */
134#define TEGRA124_CLK_AUDIO0_2X 113
135#define TEGRA124_CLK_AUDIO1_2X 114
136#define TEGRA124_CLK_AUDIO2_2X 115
137#define TEGRA124_CLK_AUDIO3_2X 116
138#define TEGRA124_CLK_AUDIO4_2X 117
139#define TEGRA124_CLK_SPDIF_2X 118
140#define TEGRA124_CLK_ACTMON 119
141#define TEGRA124_CLK_EXTERN1 120
142#define TEGRA124_CLK_EXTERN2 121
143#define TEGRA124_CLK_EXTERN3 122
144#define TEGRA124_CLK_SATA_OOB 123
145#define TEGRA124_CLK_SATA 124
146#define TEGRA124_CLK_HDA 125
147/* 126 */
148#define TEGRA124_CLK_SE 127
149
150#define TEGRA124_CLK_HDA2HDMI 128
151#define TEGRA124_CLK_SATA_COLD 129
152/* 130 */
153/* 131 */
154/* 132 */
155/* 133 */
156/* 134 */
157/* 135 */
158/* 136 */
159/* 137 */
160/* 138 */
161/* 139 */
162/* 140 */
163/* 141 */
164/* 142 */
165/* 143 (bit affects xusb_falcon_src, xusb_fs_src, */
166/* xusb_host_src and xusb_ss_src) */
167#define TEGRA124_CLK_CILAB 144
168#define TEGRA124_CLK_CILCD 145
169#define TEGRA124_CLK_CILE 146
170#define TEGRA124_CLK_DSIALP 147
171#define TEGRA124_CLK_DSIBLP 148
172#define TEGRA124_CLK_ENTROPY 149
173#define TEGRA124_CLK_DDS 150
174/* 151 */
175#define TEGRA124_CLK_DP2 152
176#define TEGRA124_CLK_AMX 153
177#define TEGRA124_CLK_ADX 154
178/* 155 (bit affects dfll_ref and dfll_soc) */
179#define TEGRA124_CLK_XUSB_SS 156
180/* 157 */
181/* 158 */
182/* 159 */
183
184/* 160 */
185/* 161 */
186/* 162 */
187/* 163 */
188/* 164 */
189/* 165 */
190#define TEGRA124_CLK_I2C6 166
191/* 167 */
192/* 168 */
193/* 169 */
194/* 170 */
195#define TEGRA124_CLK_VIM2_CLK 171
196/* 172 */
197/* 173 */
198/* 174 */
199/* 175 */
200#define TEGRA124_CLK_HDMI_AUDIO 176
201#define TEGRA124_CLK_CLK72MHZ 177
202#define TEGRA124_CLK_VIC03 178
203/* 179 */
204#define TEGRA124_CLK_ADX1 180
205#define TEGRA124_CLK_DPAUX 181
206#define TEGRA124_CLK_SOR0 182
207/* 183 */
208#define TEGRA124_CLK_GPU 184
209#define TEGRA124_CLK_AMX1 185
210/* 186 */
211/* 187 */
212/* 188 */
213/* 189 */
214/* 190 */
215/* 191 */
216#define TEGRA124_CLK_UARTB 192
217#define TEGRA124_CLK_VFIR 193
218#define TEGRA124_CLK_SPDIF_IN 194
219#define TEGRA124_CLK_SPDIF_OUT 195
220#define TEGRA124_CLK_VI 196
221#define TEGRA124_CLK_VI_SENSOR 197
222#define TEGRA124_CLK_FUSE 198
223#define TEGRA124_CLK_FUSE_BURN 199
224#define TEGRA124_CLK_CLK_32K 200
225#define TEGRA124_CLK_CLK_M 201
226#define TEGRA124_CLK_CLK_M_DIV2 202
227#define TEGRA124_CLK_CLK_M_DIV4 203
228#define TEGRA124_CLK_PLL_REF 204
229#define TEGRA124_CLK_PLL_C 205
230#define TEGRA124_CLK_PLL_C_OUT1 206
231#define TEGRA124_CLK_PLL_C2 207
232#define TEGRA124_CLK_PLL_C3 208
233#define TEGRA124_CLK_PLL_M 209
234#define TEGRA124_CLK_PLL_M_OUT1 210
235#define TEGRA124_CLK_PLL_P 211
236#define TEGRA124_CLK_PLL_P_OUT1 212
237#define TEGRA124_CLK_PLL_P_OUT2 213
238#define TEGRA124_CLK_PLL_P_OUT3 214
239#define TEGRA124_CLK_PLL_P_OUT4 215
240#define TEGRA124_CLK_PLL_A 216
241#define TEGRA124_CLK_PLL_A_OUT0 217
242#define TEGRA124_CLK_PLL_D 218
243#define TEGRA124_CLK_PLL_D_OUT0 219
244#define TEGRA124_CLK_PLL_D2 220
245#define TEGRA124_CLK_PLL_D2_OUT0 221
246#define TEGRA124_CLK_PLL_U 222
247#define TEGRA124_CLK_PLL_U_480M 223
248
249#define TEGRA124_CLK_PLL_U_60M 224
250#define TEGRA124_CLK_PLL_U_48M 225
251#define TEGRA124_CLK_PLL_U_12M 226
252#define TEGRA124_CLK_PLL_X 227
253#define TEGRA124_CLK_PLL_X_OUT0 228
254#define TEGRA124_CLK_PLL_RE_VCO 229
255#define TEGRA124_CLK_PLL_RE_OUT 230
256#define TEGRA124_CLK_PLL_E 231
257#define TEGRA124_CLK_SPDIF_IN_SYNC 232
258#define TEGRA124_CLK_I2S0_SYNC 233
259#define TEGRA124_CLK_I2S1_SYNC 234
260#define TEGRA124_CLK_I2S2_SYNC 235
261#define TEGRA124_CLK_I2S3_SYNC 236
262#define TEGRA124_CLK_I2S4_SYNC 237
263#define TEGRA124_CLK_VIMCLK_SYNC 238
264#define TEGRA124_CLK_AUDIO0 239
265#define TEGRA124_CLK_AUDIO1 240
266#define TEGRA124_CLK_AUDIO2 241
267#define TEGRA124_CLK_AUDIO3 242
268#define TEGRA124_CLK_AUDIO4 243
269#define TEGRA124_CLK_SPDIF 244
270#define TEGRA124_CLK_CLK_OUT_1 245
271#define TEGRA124_CLK_CLK_OUT_2 246
272#define TEGRA124_CLK_CLK_OUT_3 247
273#define TEGRA124_CLK_BLINK 248
274/* 249 */
275/* 250 */
276/* 251 */
277#define TEGRA124_CLK_XUSB_HOST_SRC 252
278#define TEGRA124_CLK_XUSB_FALCON_SRC 253
279#define TEGRA124_CLK_XUSB_FS_SRC 254
280#define TEGRA124_CLK_XUSB_SS_SRC 255
281
282#define TEGRA124_CLK_XUSB_DEV_SRC 256
283#define TEGRA124_CLK_XUSB_DEV 257
284#define TEGRA124_CLK_XUSB_HS_SRC 258
285#define TEGRA124_CLK_SCLK 259
286#define TEGRA124_CLK_HCLK 260
287#define TEGRA124_CLK_PCLK 261
288#define TEGRA124_CLK_CCLK_G 262
289#define TEGRA124_CLK_CCLK_LP 263
290#define TEGRA124_CLK_DFLL_REF 264
291#define TEGRA124_CLK_DFLL_SOC 265
292#define TEGRA124_CLK_VI_SENSOR2 266
293#define TEGRA124_CLK_PLL_P_OUT5 267
294#define TEGRA124_CLK_CML0 268
295#define TEGRA124_CLK_CML1 269
296#define TEGRA124_CLK_PLL_C4 270
297#define TEGRA124_CLK_PLL_DP 271
298#define TEGRA124_CLK_PLL_E_MUX 272
299/* 273 */
300/* 274 */
301/* 275 */
302/* 276 */
303/* 277 */
304/* 278 */
305/* 279 */
306/* 280 */
307/* 281 */
308/* 282 */
309/* 283 */
310/* 284 */
311/* 285 */
312/* 286 */
313/* 287 */
314
315/* 288 */
316/* 289 */
317/* 290 */
318/* 291 */
319/* 292 */
320/* 293 */
321/* 294 */
322/* 295 */
323/* 296 */
324/* 297 */
325/* 298 */
326/* 299 */
327#define TEGRA124_CLK_AUDIO0_MUX 300
328#define TEGRA124_CLK_AUDIO1_MUX 301
329#define TEGRA124_CLK_AUDIO2_MUX 302
330#define TEGRA124_CLK_AUDIO3_MUX 303
331#define TEGRA124_CLK_AUDIO4_MUX 304
332#define TEGRA124_CLK_SPDIF_MUX 305
333#define TEGRA124_CLK_CLK_OUT_1_MUX 306
334#define TEGRA124_CLK_CLK_OUT_2_MUX 307
335#define TEGRA124_CLK_CLK_OUT_3_MUX 308
336#define TEGRA124_CLK_DSIA_MUX 309
337#define TEGRA124_CLK_DSIB_MUX 310
338#define TEGRA124_CLK_SOR0_LVDS 311
339#define TEGRA124_CLK_CLK_MAX 312
340
341#endif /* _DT_BINDINGS_CLOCK_TEGRA124_CAR_H */
diff --git a/include/dt-bindings/clock/tegra20-car.h b/include/dt-bindings/clock/tegra20-car.h
index a1ae9a8fdd6c..9406207cfac8 100644
--- a/include/dt-bindings/clock/tegra20-car.h
+++ b/include/dt-bindings/clock/tegra20-car.h
@@ -92,7 +92,7 @@
92#define TEGRA20_CLK_OWR 71 92#define TEGRA20_CLK_OWR 71
93#define TEGRA20_CLK_AFI 72 93#define TEGRA20_CLK_AFI 72
94#define TEGRA20_CLK_CSITE 73 94#define TEGRA20_CLK_CSITE 73
95#define TEGRA20_CLK_PCIE_XCLK 74 95/* 74 */
96#define TEGRA20_CLK_AVPUCQ 75 96#define TEGRA20_CLK_AVPUCQ 75
97#define TEGRA20_CLK_LA 76 97#define TEGRA20_CLK_LA 76
98/* 77 */ 98/* 77 */
diff --git a/include/dt-bindings/clock/tegra30-car.h b/include/dt-bindings/clock/tegra30-car.h
index e40fae8f9a8d..889e49ba0aa3 100644
--- a/include/dt-bindings/clock/tegra30-car.h
+++ b/include/dt-bindings/clock/tegra30-car.h
@@ -92,7 +92,7 @@
92#define TEGRA30_CLK_OWR 71 92#define TEGRA30_CLK_OWR 71
93#define TEGRA30_CLK_AFI 72 93#define TEGRA30_CLK_AFI 72
94#define TEGRA30_CLK_CSITE 73 94#define TEGRA30_CLK_CSITE 73
95#define TEGRA30_CLK_PCIEX 74 95/* 74 */
96#define TEGRA30_CLK_AVPUCQ 75 96#define TEGRA30_CLK_AVPUCQ 75
97#define TEGRA30_CLK_LA 76 97#define TEGRA30_CLK_LA 76
98/* 77 */ 98/* 77 */
@@ -260,6 +260,14 @@
260/* 298 */ 260/* 298 */
261/* 299 */ 261/* 299 */
262#define TEGRA30_CLK_CLK_OUT_1_MUX 300 262#define TEGRA30_CLK_CLK_OUT_1_MUX 300
263#define TEGRA30_CLK_CLK_MAX 301 263#define TEGRA30_CLK_CLK_OUT_2_MUX 301
264#define TEGRA30_CLK_CLK_OUT_3_MUX 302
265#define TEGRA30_CLK_AUDIO0_MUX 303
266#define TEGRA30_CLK_AUDIO1_MUX 304
267#define TEGRA30_CLK_AUDIO2_MUX 305
268#define TEGRA30_CLK_AUDIO3_MUX 306
269#define TEGRA30_CLK_AUDIO4_MUX 307
270#define TEGRA30_CLK_SPDIF_MUX 308
271#define TEGRA30_CLK_CLK_MAX 309
264 272
265#endif /* _DT_BINDINGS_CLOCK_TEGRA30_CAR_H */ 273#endif /* _DT_BINDINGS_CLOCK_TEGRA30_CAR_H */
diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h
index 23a0ceee831f..3ca9fca827a2 100644
--- a/include/linux/clk/tegra.h
+++ b/include/linux/clk/tegra.h
@@ -120,13 +120,6 @@ static inline void tegra_cpu_clock_resume(void)
120} 120}
121#endif 121#endif
122 122
123#ifdef CONFIG_ARCH_TEGRA
124void tegra_periph_reset_deassert(struct clk *c);
125void tegra_periph_reset_assert(struct clk *c);
126#else
127static inline void tegra_periph_reset_deassert(struct clk *c) {}
128static inline void tegra_periph_reset_assert(struct clk *c) {}
129#endif
130void tegra_clocks_apply_init_table(void); 123void tegra_clocks_apply_init_table(void);
131 124
132#endif /* __LINUX_CLK_TEGRA_H_ */ 125#endif /* __LINUX_CLK_TEGRA_H_ */
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 41cf0c399288..bae1568416f8 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -22,6 +22,7 @@
22#define LINUX_DMAENGINE_H 22#define LINUX_DMAENGINE_H
23 23
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/err.h>
25#include <linux/uio.h> 26#include <linux/uio.h>
26#include <linux/bug.h> 27#include <linux/bug.h>
27#include <linux/scatterlist.h> 28#include <linux/scatterlist.h>
@@ -1040,6 +1041,8 @@ enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
1040void dma_issue_pending_all(void); 1041void dma_issue_pending_all(void);
1041struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, 1042struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
1042 dma_filter_fn fn, void *fn_param); 1043 dma_filter_fn fn, void *fn_param);
1044struct dma_chan *dma_request_slave_channel_reason(struct device *dev,
1045 const char *name);
1043struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name); 1046struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name);
1044void dma_release_channel(struct dma_chan *chan); 1047void dma_release_channel(struct dma_chan *chan);
1045#else 1048#else
@@ -1063,6 +1066,11 @@ static inline struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
1063{ 1066{
1064 return NULL; 1067 return NULL;
1065} 1068}
1069static inline struct dma_chan *dma_request_slave_channel_reason(
1070 struct device *dev, const char *name)
1071{
1072 return ERR_PTR(-ENODEV);
1073}
1066static inline struct dma_chan *dma_request_slave_channel(struct device *dev, 1074static inline struct dma_chan *dma_request_slave_channel(struct device *dev,
1067 const char *name) 1075 const char *name)
1068{ 1076{
@@ -1079,6 +1087,7 @@ int dma_async_device_register(struct dma_device *device);
1079void dma_async_device_unregister(struct dma_device *device); 1087void dma_async_device_unregister(struct dma_device *device);
1080void dma_run_dependencies(struct dma_async_tx_descriptor *tx); 1088void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
1081struct dma_chan *dma_get_slave_channel(struct dma_chan *chan); 1089struct dma_chan *dma_get_slave_channel(struct dma_chan *chan);
1090struct dma_chan *dma_get_any_slave_channel(struct dma_device *device);
1082struct dma_chan *net_dma_find_channel(void); 1091struct dma_chan *net_dma_find_channel(void);
1083#define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) 1092#define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y)
1084#define dma_request_slave_channel_compat(mask, x, y, dev, name) \ 1093#define dma_request_slave_channel_compat(mask, x, y, dev, name) \
diff --git a/include/linux/host1x.h b/include/linux/host1x.h
index f5b9b87ac9a9..3af847273277 100644
--- a/include/linux/host1x.h
+++ b/include/linux/host1x.h
@@ -281,4 +281,10 @@ int host1x_device_exit(struct host1x_device *device);
281int host1x_client_register(struct host1x_client *client); 281int host1x_client_register(struct host1x_client *client);
282int host1x_client_unregister(struct host1x_client *client); 282int host1x_client_unregister(struct host1x_client *client);
283 283
284struct tegra_mipi_device;
285
286struct tegra_mipi_device *tegra_mipi_request(struct device *device);
287void tegra_mipi_free(struct tegra_mipi_device *device);
288int tegra_mipi_calibrate(struct tegra_mipi_device *device);
289
284#endif 290#endif
diff --git a/include/linux/tegra-powergate.h b/include/linux/tegra-powergate.h
index fd4498329c7c..e6f2ab3014a7 100644
--- a/include/linux/tegra-powergate.h
+++ b/include/linux/tegra-powergate.h
@@ -19,6 +19,7 @@
19#define _MACH_TEGRA_POWERGATE_H_ 19#define _MACH_TEGRA_POWERGATE_H_
20 20
21struct clk; 21struct clk;
22struct reset_control;
22 23
23#define TEGRA_POWERGATE_CPU 0 24#define TEGRA_POWERGATE_CPU 0
24#define TEGRA_POWERGATE_3D 1 25#define TEGRA_POWERGATE_3D 1
@@ -37,14 +38,49 @@ struct clk;
37#define TEGRA_POWERGATE_CPU0 14 38#define TEGRA_POWERGATE_CPU0 14
38#define TEGRA_POWERGATE_C0NC 15 39#define TEGRA_POWERGATE_C0NC 15
39#define TEGRA_POWERGATE_C1NC 16 40#define TEGRA_POWERGATE_C1NC 16
41#define TEGRA_POWERGATE_SOR 17
40#define TEGRA_POWERGATE_DIS 18 42#define TEGRA_POWERGATE_DIS 18
41#define TEGRA_POWERGATE_DISB 19 43#define TEGRA_POWERGATE_DISB 19
42#define TEGRA_POWERGATE_XUSBA 20 44#define TEGRA_POWERGATE_XUSBA 20
43#define TEGRA_POWERGATE_XUSBB 21 45#define TEGRA_POWERGATE_XUSBB 21
44#define TEGRA_POWERGATE_XUSBC 22 46#define TEGRA_POWERGATE_XUSBC 22
47#define TEGRA_POWERGATE_VIC 23
48#define TEGRA_POWERGATE_IRAM 24
45 49
46#define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D 50#define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D
47 51
52#define TEGRA_IO_RAIL_CSIA 0
53#define TEGRA_IO_RAIL_CSIB 1
54#define TEGRA_IO_RAIL_DSI 2
55#define TEGRA_IO_RAIL_MIPI_BIAS 3
56#define TEGRA_IO_RAIL_PEX_BIAS 4
57#define TEGRA_IO_RAIL_PEX_CLK1 5
58#define TEGRA_IO_RAIL_PEX_CLK2 6
59#define TEGRA_IO_RAIL_USB0 9
60#define TEGRA_IO_RAIL_USB1 10
61#define TEGRA_IO_RAIL_USB2 11
62#define TEGRA_IO_RAIL_USB_BIAS 12
63#define TEGRA_IO_RAIL_NAND 13
64#define TEGRA_IO_RAIL_UART 14
65#define TEGRA_IO_RAIL_BB 15
66#define TEGRA_IO_RAIL_AUDIO 17
67#define TEGRA_IO_RAIL_HSIC 19
68#define TEGRA_IO_RAIL_COMP 22
69#define TEGRA_IO_RAIL_HDMI 28
70#define TEGRA_IO_RAIL_PEX_CNTRL 32
71#define TEGRA_IO_RAIL_SDMMC1 33
72#define TEGRA_IO_RAIL_SDMMC3 34
73#define TEGRA_IO_RAIL_SDMMC4 35
74#define TEGRA_IO_RAIL_CAM 36
75#define TEGRA_IO_RAIL_RES 37
76#define TEGRA_IO_RAIL_HV 38
77#define TEGRA_IO_RAIL_DSIB 39
78#define TEGRA_IO_RAIL_DSIC 40
79#define TEGRA_IO_RAIL_DSID 41
80#define TEGRA_IO_RAIL_CSIE 44
81#define TEGRA_IO_RAIL_LVDS 57
82#define TEGRA_IO_RAIL_SYS_DDC 58
83
48#ifdef CONFIG_ARCH_TEGRA 84#ifdef CONFIG_ARCH_TEGRA
49int tegra_powergate_is_powered(int id); 85int tegra_powergate_is_powered(int id);
50int tegra_powergate_power_on(int id); 86int tegra_powergate_power_on(int id);
@@ -52,7 +88,11 @@ int tegra_powergate_power_off(int id);
52int tegra_powergate_remove_clamping(int id); 88int tegra_powergate_remove_clamping(int id);
53 89
54/* Must be called with clk disabled, and returns with clk enabled */ 90/* Must be called with clk disabled, and returns with clk enabled */
55int tegra_powergate_sequence_power_up(int id, struct clk *clk); 91int tegra_powergate_sequence_power_up(int id, struct clk *clk,
92 struct reset_control *rst);
93
94int tegra_io_rail_power_on(int id);
95int tegra_io_rail_power_off(int id);
56#else 96#else
57static inline int tegra_powergate_is_powered(int id) 97static inline int tegra_powergate_is_powered(int id)
58{ 98{
@@ -74,7 +114,18 @@ static inline int tegra_powergate_remove_clamping(int id)
74 return -ENOSYS; 114 return -ENOSYS;
75} 115}
76 116
77static inline int tegra_powergate_sequence_power_up(int id, struct clk *clk) 117static inline int tegra_powergate_sequence_power_up(int id, struct clk *clk,
118 struct reset_control *rst);
119{
120 return -ENOSYS;
121}
122
123static inline int tegra_io_rail_power_on(int id)
124{
125 return -ENOSYS;
126}
127
128static inline int tegra_io_rail_power_off(int id)
78{ 129{
79 return -ENOSYS; 130 return -ENOSYS;
80} 131}
diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h
index 15017311f2e9..eb73a3a39ec2 100644
--- a/include/sound/dmaengine_pcm.h
+++ b/include/sound/dmaengine_pcm.h
@@ -114,6 +114,10 @@ void snd_dmaengine_pcm_set_config_from_dai_data(
114 * @compat_filter_fn: Will be used as the filter function when requesting a 114 * @compat_filter_fn: Will be used as the filter function when requesting a
115 * channel for platforms which do not use devicetree. The filter parameter 115 * channel for platforms which do not use devicetree. The filter parameter
116 * will be the DAI's DMA data. 116 * will be the DAI's DMA data.
117 * @dma_dev: If set, request DMA channel on this device rather than the DAI
118 * device.
119 * @chan_names: If set, these custom DMA channel names will be requested at
120 * registration time.
117 * @pcm_hardware: snd_pcm_hardware struct to be used for the PCM. 121 * @pcm_hardware: snd_pcm_hardware struct to be used for the PCM.
118 * @prealloc_buffer_size: Size of the preallocated audio buffer. 122 * @prealloc_buffer_size: Size of the preallocated audio buffer.
119 * 123 *
@@ -130,6 +134,8 @@ struct snd_dmaengine_pcm_config {
130 struct snd_soc_pcm_runtime *rtd, 134 struct snd_soc_pcm_runtime *rtd,
131 struct snd_pcm_substream *substream); 135 struct snd_pcm_substream *substream);
132 dma_filter_fn compat_filter_fn; 136 dma_filter_fn compat_filter_fn;
137 struct device *dma_dev;
138 const char *chan_names[SNDRV_PCM_STREAM_LAST + 1];
133 139
134 const struct snd_pcm_hardware *pcm_hardware; 140 const struct snd_pcm_hardware *pcm_hardware;
135 unsigned int prealloc_buffer_size; 141 unsigned int prealloc_buffer_size;
@@ -140,6 +146,10 @@ int snd_dmaengine_pcm_register(struct device *dev,
140 unsigned int flags); 146 unsigned int flags);
141void snd_dmaengine_pcm_unregister(struct device *dev); 147void snd_dmaengine_pcm_unregister(struct device *dev);
142 148
149int devm_snd_dmaengine_pcm_register(struct device *dev,
150 const struct snd_dmaengine_pcm_config *config,
151 unsigned int flags);
152
143int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream, 153int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream,
144 struct snd_pcm_hw_params *params, 154 struct snd_pcm_hw_params *params,
145 struct dma_slave_config *slave_config); 155 struct dma_slave_config *slave_config);