blob: 461a2bf66abb37577ec031c0ed9ce9c3157fadbb [file] [log] [blame]
Duy Truonge833aca2013-02-12 13:35:08 -08001/* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef _LINUX_SLIMBUS_H
14#define _LINUX_SLIMBUS_H
15#include <linux/module.h>
16#include <linux/device.h>
17#include <linux/mutex.h>
18#include <linux/mod_devicetable.h>
19
20/* Interfaces between SLIMbus manager drivers and SLIMbus infrastructure. */
21
22extern struct bus_type slimbus_type;
23
24/* Standard values per SLIMbus spec needed by controllers and devices */
25#define SLIM_CL_PER_SUPERFRAME 6144
26#define SLIM_CL_PER_SUPERFRAME_DIV8 (SLIM_CL_PER_SUPERFRAME >> 3)
27#define SLIM_MAX_CLK_GEAR 10
Sagar Dharia98a7ecb2011-07-25 15:25:35 -060028#define SLIM_MIN_CLK_GEAR 1
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070029#define SLIM_CL_PER_SL 4
30#define SLIM_SL_PER_SUPERFRAME (SLIM_CL_PER_SUPERFRAME >> 2)
31#define SLIM_FRM_SLOTS_PER_SUPERFRAME 16
32#define SLIM_GDE_SLOTS_PER_SUPERFRAME 2
33
34/*
35 * SLIMbus message types. Related to interpretation of message code.
36 * Values are defined in Table 32 (slimbus spec 1.01.01)
37 */
38#define SLIM_MSG_MT_CORE 0x0
39#define SLIM_MSG_MT_DEST_REFERRED_CLASS 0x1
40#define SLIM_MSG_MT_DEST_REFERRED_USER 0x2
41#define SLIM_MSG_MT_SRC_REFERRED_CLASS 0x5
42#define SLIM_MSG_MT_SRC_REFERRED_USER 0x6
43
44/*
45 * SLIMbus core type Message Codes.
46 * Values are defined in Table 65 (slimbus spec 1.01.01)
47 */
48/* Device management messages */
49#define SLIM_MSG_MC_REPORT_PRESENT 0x1
50#define SLIM_MSG_MC_ASSIGN_LOGICAL_ADDRESS 0x2
51#define SLIM_MSG_MC_RESET_DEVICE 0x4
52#define SLIM_MSG_MC_CHANGE_LOGICAL_ADDRESS 0x8
53#define SLIM_MSG_MC_CHANGE_ARBITRATION_PRIORITY 0x9
54#define SLIM_MSG_MC_REQUEST_SELF_ANNOUNCEMENT 0xC
55#define SLIM_MSG_MC_REPORT_ABSENT 0xF
56
57/* Data channel management messages */
58#define SLIM_MSG_MC_CONNECT_SOURCE 0x10
59#define SLIM_MSG_MC_CONNECT_SINK 0x11
60#define SLIM_MSG_MC_DISCONNECT_PORT 0x14
61#define SLIM_MSG_MC_CHANGE_CONTENT 0x18
62
63/* Information management messages */
64#define SLIM_MSG_MC_REQUEST_INFORMATION 0x20
65#define SLIM_MSG_MC_REQUEST_CLEAR_INFORMATION 0x21
66#define SLIM_MSG_MC_REPLY_INFORMATION 0x24
67#define SLIM_MSG_MC_CLEAR_INFORMATION 0x28
68#define SLIM_MSG_MC_REPORT_INFORMATION 0x29
69
70/* Reconfiguration messages */
71#define SLIM_MSG_MC_BEGIN_RECONFIGURATION 0x40
72#define SLIM_MSG_MC_NEXT_ACTIVE_FRAMER 0x44
73#define SLIM_MSG_MC_NEXT_SUBFRAME_MODE 0x45
74#define SLIM_MSG_MC_NEXT_CLOCK_GEAR 0x46
75#define SLIM_MSG_MC_NEXT_ROOT_FREQUENCY 0x47
76#define SLIM_MSG_MC_NEXT_PAUSE_CLOCK 0x4A
77#define SLIM_MSG_MC_NEXT_RESET_BUS 0x4B
78#define SLIM_MSG_MC_NEXT_SHUTDOWN_BUS 0x4C
79#define SLIM_MSG_MC_NEXT_DEFINE_CHANNEL 0x50
80#define SLIM_MSG_MC_NEXT_DEFINE_CONTENT 0x51
81#define SLIM_MSG_MC_NEXT_ACTIVATE_CHANNEL 0x54
82#define SLIM_MSG_MC_NEXT_DEACTIVATE_CHANNEL 0x55
83#define SLIM_MSG_MC_NEXT_REMOVE_CHANNEL 0x58
84#define SLIM_MSG_MC_RECONFIGURE_NOW 0x5F
85
Sagar Dharia45ee38a2011-08-03 17:01:31 -060086/*
87 * Clock pause flag to indicate that the reconfig message
88 * corresponds to clock pause sequence
89 */
90#define SLIM_MSG_CLK_PAUSE_SEQ_FLG (1U << 8)
91
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070092/* Value management messages */
93#define SLIM_MSG_MC_REQUEST_VALUE 0x60
94#define SLIM_MSG_MC_REQUEST_CHANGE_VALUE 0x61
95#define SLIM_MSG_MC_REPLY_VALUE 0x64
96#define SLIM_MSG_MC_CHANGE_VALUE 0x68
97
Sagar Dharia33f34442011-08-08 16:22:03 -060098/* Clock pause values defined in Table 66 (slimbus spec 1.01.01) */
99#define SLIM_CLK_FAST 0
100#define SLIM_CLK_CONST_PHASE 1
101#define SLIM_CLK_UNSPECIFIED 2
102
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700103struct slim_controller;
104struct slim_device;
105
106/* Destination type Values defined in Table 33 (slimbus spec 1.01.01) */
107#define SLIM_MSG_DEST_LOGICALADDR 0
108#define SLIM_MSG_DEST_ENUMADDR 1
109#define SLIM_MSG_DEST_BROADCAST 3
110
111/*
112 * @start_offset: Specifies starting offset in information/value element map
113 * @num_bytes: Can be 1, 2, 3, 4, 6, 8, 12, 16 per spec. This ensures that the
114 * message will fit in the 40-byte message limit and the slicesize can be
115 * compatible with values in table 21 (slimbus spec 1.01.01)
116 * @comp: Completion to indicate end of message-transfer. Used if client wishes
117 * to use the API asynchronously.
118 */
119struct slim_ele_access {
120 u16 start_offset;
121 u8 num_bytes;
122 struct completion *comp;
123};
124
125/*
126 * struct slim_framer - Represents Slimbus framer.
127 * Every controller may have multiple framers.
128 * Manager is responsible for framer hand-over.
129 * @e_addr: 6 byte Elemental address of the framer.
130 * @rootfreq: Root Frequency at which the framer can run. This is maximum
131 * frequency (clock gear 10 per slimbus spec) at which the bus can operate.
132 * @superfreq: Superframes per root frequency. Every frame is 6144 cells (bits)
133 * per slimbus specification.
134 */
135struct slim_framer {
136 u8 e_addr[6];
137 int rootfreq;
138 int superfreq;
139};
140#define to_slim_framer(d) container_of(d, struct slim_framer, dev);
141
142/*
143 * struct slim_addrt: slimbus address used internally by the slimbus framework.
144 * @valid: If the device is still there or if the address can be reused.
145 * @eaddr: 6-bytes-long elemental address
146 */
147struct slim_addrt {
148 bool valid;
149 u8 eaddr[6];
150};
151
152/*
153 * struct slim_msg_txn: Message to be sent by the controller.
154 * Linux framework uses this structure with drivers implementing controller.
155 * This structure has packet header, payload and buffer to be filled (if any)
156 * For the header information, refer to Table 34-36.
157 * @rl: Header field. remaining length.
158 * @mt: Header field. Message type.
Sagar Dharia45ee38a2011-08-03 17:01:31 -0600159 * @mc: Header field. LSB is message code for type mt. Framework will set MSB to
160 * SLIM_MSG_CLK_PAUSE_SEQ_FLG in case "mc" in the reconfiguration sequence
161 * is for pausing the clock.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700162 * @dt: Header field. Destination type.
163 * @ec: Element size. Used for elemental access APIs.
164 * @len: Length of payload. (excludes ec)
165 * @tid: Transaction ID. Used for messages expecting response.
166 * (e.g. relevant for mc = SLIM_MSG_MC_REQUEST_INFORMATION)
167 * @la: Logical address of the device this message is going to.
168 * (Not used when destination type is broadcast.)
169 * @rbuf: Buffer to be populated by controller when response is received.
170 * @wbuf: Payload of the message. (e.g. channel number for DATA channel APIs)
171 * @comp: Completion structure. Used by controller to notify response.
172 * (Field is relevant when tid is used)
173 */
174struct slim_msg_txn {
175 u8 rl;
176 u8 mt;
Sagar Dharia45ee38a2011-08-03 17:01:31 -0600177 u16 mc;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700178 u8 dt;
179 u16 ec;
180 u8 len;
181 u8 tid;
182 u8 la;
183 u8 *rbuf;
184 const u8 *wbuf;
185 struct completion *comp;
186};
187
188/* Internal port state used by slimbus framework to manage data-ports */
189enum slim_port_state {
190 SLIM_P_FREE,
191 SLIM_P_UNCFG,
192 SLIM_P_CFG,
193};
194
195/*
196 * enum slim_port_req: Request port type by user through APIs to manage ports
197 * User can request default, half-duplex or port to be used in multi-channel
198 * configuration. Default indicates a simplex port.
199 */
200enum slim_port_req {
201 SLIM_REQ_DEFAULT,
202 SLIM_REQ_HALF_DUP,
203 SLIM_REQ_MULTI_CH,
204};
205
206/*
207 * enum slim_port_cfg: Port configuration parameters requested.
208 * User can request no configuration, packed data, or MSB aligned data port
209 */
210enum slim_port_cfg {
211 SLIM_CFG_NONE,
212 SLIM_CFG_PACKED,
213 SLIM_CFG_ALIGN_MSB,
214};
215
216/* enum slim_port_flow: Port flow type (inbound/outbound). */
217enum slim_port_flow {
218 SLIM_SRC,
219 SLIM_SINK,
220};
221
222/* enum slim_port_err: Port errors */
223enum slim_port_err {
224 SLIM_P_INPROGRESS,
225 SLIM_P_OVERFLOW,
226 SLIM_P_UNDERFLOW,
227 SLIM_P_DISCONNECT,
228 SLIM_P_NOT_OWNED,
229};
230
231/*
232 * struct slim_port: Internal structure used by framework to manage ports
233 * @err: Port error if any for this port. Refer to enum above.
234 * @state: Port state. Refer to enum above.
235 * @req: Port request for this port.
236 * @cfg: Port configuration for this port.
237 * @flow: Flow type of this port.
238 * @ch: Channel association of this port.
239 * @xcomp: Completion to indicate error, data transfer done event.
240 * @ctrl: Controller to which this port belongs to. This is useful to associate
241 * port with the SW since port hardware interrupts may only contain port
242 * information.
243 */
244struct slim_port {
245 enum slim_port_err err;
246 enum slim_port_state state;
247 enum slim_port_req req;
248 enum slim_port_cfg cfg;
249 enum slim_port_flow flow;
250 struct slim_ch *ch;
251 struct completion *xcomp;
252 struct slim_controller *ctrl;
253};
254
255/*
256 * enum slim_ch_state: Channel state of a channel.
257 * Channel transition happens from free-to-allocated-to-defined-to-pending-
258 * active-to-active.
259 * Once active, channel can be removed or suspended. Suspended channels are
260 * still scheduled, but data transfer doesn't happen.
261 * Removed channels are not deallocated until dealloc_ch API is used.
262 * Deallocation reset channel state back to free.
263 * Removed channels can be defined with different parameters.
264 */
265enum slim_ch_state {
266 SLIM_CH_FREE,
267 SLIM_CH_ALLOCATED,
268 SLIM_CH_DEFINED,
269 SLIM_CH_PENDING_ACTIVE,
270 SLIM_CH_ACTIVE,
271 SLIM_CH_SUSPENDED,
272 SLIM_CH_PENDING_REMOVAL,
273};
274
275/*
276 * enum slim_ch_proto: Channel protocol used by the channel.
277 * Hard Isochronous channel is not scheduled if current frequency doesn't allow
278 * the channel to be run without flow-control.
279 * Auto isochronous channel will be scheduled as hard-isochronous or push-pull
280 * depending on current bus frequency.
281 * Currently, Push-pull or async or extended channels are not supported.
282 * For more details, refer to slimbus spec
283 */
284enum slim_ch_proto {
285 SLIM_HARD_ISO,
286 SLIM_AUTO_ISO,
287 SLIM_PUSH,
288 SLIM_PULL,
289 SLIM_ASYNC_SMPLX,
290 SLIM_ASYNC_HALF_DUP,
291 SLIM_EXT_SMPLX,
292 SLIM_EXT_HALF_DUP,
293};
294
295/*
296 * enum slim_ch_rate: Most commonly used frequency rate families.
297 * Use 1HZ for push-pull transport.
298 * 4KHz and 11.025KHz are most commonly used in audio applications.
299 * Typically, slimbus runs at frequencies to support channels running at 4KHz
300 * and/or 11.025KHz isochronously.
301 */
302enum slim_ch_rate {
303 SLIM_RATE_1HZ,
304 SLIM_RATE_4000HZ,
305 SLIM_RATE_11025HZ,
306};
307
308/*
309 * enum slim_ch_coeff: Coefficient of a channel used internally by framework.
310 * Coefficient is applicable to channels running isochronously.
311 * Coefficient is calculated based on channel rate multiplier.
312 * (If rate multiplier is power of 2, it's coeff.1 channel. Otherwise it's
313 * coeff.3 channel.
314 */
315enum slim_ch_coeff {
316 SLIM_COEFF_1,
317 SLIM_COEFF_3,
318};
319
320/*
321 * enum slim_ch_control: Channel control.
322 * Activate will schedule channel and/or group of channels in the TDM frame.
323 * Suspend will keep the schedule but data-transfer won't happen.
324 * Remove will remove the channel/group from the TDM frame.
325 */
326enum slim_ch_control {
327 SLIM_CH_ACTIVATE,
328 SLIM_CH_SUSPEND,
329 SLIM_CH_REMOVE,
330};
331
332/* enum slim_ch_dataf: Data format per table 60 from slimbus spec 1.01.01 */
333enum slim_ch_dataf {
334 SLIM_CH_DATAF_NOT_DEFINED = 0,
335 SLIM_CH_DATAF_LPCM_AUDIO = 1,
336 SLIM_CH_DATAF_IEC61937_COMP_AUDIO = 2,
337 SLIM_CH_DATAF_PACKED_PDM_AUDIO = 3,
338};
339
340/* enum slim_ch_auxf: Auxiliary field format per table 59 from slimbus spec */
341enum slim_ch_auxf {
342 SLIM_CH_AUXF_NOT_APPLICABLE = 0,
343 SLIM_CH_AUXF_ZCUV_TUNNEL_IEC60958 = 1,
344 SLIM_CH_USER_DEFINED = 0xF,
345};
346
347/*
348 * struct slim_ch: Channel structure used externally by users of channel APIs.
349 * @prot: Desired slimbus protocol.
350 * @baser: Desired base rate. (Typical isochronous rates are: 4KHz, or 11.025KHz
351 * @dataf: Data format.
352 * @auxf: Auxiliary format.
353 * @ratem: Channel rate multiplier. (e.g. 48KHz channel will have 4KHz base rate
354 * and 12 as rate multiplier.
355 * @sampleszbits: Sample size in bits.
356 */
357struct slim_ch {
358 enum slim_ch_proto prot;
359 enum slim_ch_rate baser;
360 enum slim_ch_dataf dataf;
361 enum slim_ch_auxf auxf;
362 u32 ratem;
363 u32 sampleszbits;
364};
365
366/*
367 * struct slim_ich: Internal channel structure used by slimbus framework.
368 * @prop: structure passed by the client.
369 * @coeff: Coefficient of this channel.
370 * @state: Current state of the channel.
371 * @nextgrp: If this channel is part of group, next channel in this group.
372 * @prrate: Presence rate of this channel (per table 62 of the spec)
373 * @offset: Offset of this channel in the superframe.
374 * @newoff: Used during scheduling to hold temporary new offset until the offset
375 * is accepted/rejected by slimbus reconfiguration.
376 * @interval: Interval of this channel per superframe.
377 * @newintr: Used during scheduling to new interval temporarily.
378 * @seglen: Segment length of this channel.
379 * @rootexp: root exponent of this channel. Rate can be found using rootexp and
380 * coefficient. Used during scheduling.
Sagar Dharia29f35f02011-10-01 20:37:50 -0600381 * @srch: Source port used by this channel.
382 * @sinkh: Sink ports used by this channel.
383 * @nsink: number of sink ports used by this channel.
Sagar Dharia4ec2ff42011-09-26 10:20:17 -0600384 * @chan: Channel number sent on hardware lines for this channel. May not be
385 * equal to array-index into chans if client requested to use number beyond
386 * channel-array for the controller.
387 * @ref: Reference number to keep track of how many clients (upto 2) are using
388 * this channel.
389 * @def: Used to keep track of how many times the channel definition is sent
390 * to hardware and this will decide if channel-remove can be sent for the
391 * channel. Channel definition may be sent upto twice (once per producer
392 * and once per consumer). Channel removal should be sent only once to
393 * avoid clients getting underflow/overflow errors.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700394 */
395struct slim_ich {
396 struct slim_ch prop;
397 enum slim_ch_coeff coeff;
398 enum slim_ch_state state;
399 u16 nextgrp;
400 u32 prrate;
401 u32 offset;
402 u32 newoff;
403 u32 interval;
404 u32 newintr;
405 u32 seglen;
406 u8 rootexp;
Sagar Dharia29f35f02011-10-01 20:37:50 -0600407 u32 srch;
408 u32 *sinkh;
409 int nsink;
Sagar Dharia4ec2ff42011-09-26 10:20:17 -0600410 u8 chan;
411 int ref;
412 int def;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700413};
414
415/*
416 * struct slim_sched: Framework uses this structure internally for scheduling.
417 * @chc3: Array of all active coeffient 3 channels.
418 * @num_cc3: Number of active coeffient 3 channels.
419 * @chc1: Array of all active coeffient 1 channels.
420 * @num_cc1: Number of active coeffient 1 channels.
421 * @subfrmcode: Current subframe-code used by TDM. This is decided based on
422 * requested message bandwidth and current channels scheduled.
423 * @usedslots: Slots used by all active channels.
424 * @msgsl: Slots used by message-bandwidth.
425 * @pending_msgsl: Used to store pending request of message bandwidth (in slots)
426 * until the scheduling is accepted by reconfiguration.
427 * @m_reconf: This mutex is held until current reconfiguration (data channel
428 * scheduling, message bandwidth reservation) is done. Message APIs can
429 * use the bus concurrently when this mutex is held since elemental access
430 * messages can be sent on the bus when reconfiguration is in progress.
431 * @slots: Used for debugging purposes to debug/verify current schedule in TDM.
432 */
433struct slim_sched {
434 struct slim_ich **chc3;
435 int num_cc3;
436 struct slim_ich **chc1;
437 int num_cc1;
438 u32 subfrmcode;
439 u32 usedslots;
440 u32 msgsl;
441 u32 pending_msgsl;
442 struct mutex m_reconf;
443 u8 *slots;
444};
445
446/*
Sagar Dharia33f34442011-08-08 16:22:03 -0600447 * enum slim_clk_state: Slimbus controller's clock state used internally for
448 * maintaining current clock state.
449 * @SLIM_CLK_ACTIVE: Slimbus clock is active
450 * @SLIM_CLK_PAUSE_FAILED: Slimbus controlled failed to go in clock pause.
451 * Hardware-wise, this state is same as active but controller will wait on
452 * completion before making transition to SLIM_CLK_ACTIVE in framework
453 * @SLIM_CLK_ENTERING_PAUSE: Slimbus clock pause sequence is being sent on the
454 * bus. If this succeeds, state changes to SLIM_CLK_PAUSED. If the
455 * transition fails, state changes to SLIM_CLK_PAUSE_FAILED
456 * @SLIM_CLK_PAUSED: Slimbus controller clock has paused.
457 */
458enum slim_clk_state {
459 SLIM_CLK_ACTIVE,
460 SLIM_CLK_ENTERING_PAUSE,
461 SLIM_CLK_PAUSE_FAILED,
462 SLIM_CLK_PAUSED,
463};
464/*
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700465 * struct slim_controller: Represents manager for a SlimBUS
466 * (similar to 'master' on I2C)
467 * @dev: Device interface to this driver
468 * @nr: Board-specific number identifier for this controller/bus
469 * @list: Link with other slimbus controllers
470 * @name: Name for this controller
471 * @clkgear: Current clock gear in which this bus is running
Sagar Dharia98a7ecb2011-07-25 15:25:35 -0600472 * @min_cg: Minimum clock gear supported by this controller (default value: 1)
473 * @max_cg: Maximum clock gear supported by this controller (default value: 10)
Sagar Dharia33f34442011-08-08 16:22:03 -0600474 * @clk_state: Controller's clock state from enum slim_clk_state
475 * @pause_comp: Signals completion of clock pause sequence. This is useful when
476 * client tries to call slimbus transaction when controller may be entering
477 * clock pause.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700478 * @a_framer: Active framer which is clocking the bus managed by this controller
479 * @m_ctrl: Mutex protecting controller data structures (ports, channels etc)
480 * @addrt: Logical address table
481 * @num_dev: Number of active slimbus slaves on this bus
Sagar Dharia9c706fb2012-07-23 19:38:57 -0600482 * @devs: List of devices on this controller
483 * @wq: Workqueue per controller used to notify devices when they report present
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700484 * @txnt: Table of transactions having transaction ID
485 * @last_tid: size of the table txnt (can't grow beyond 256 since TID is 8-bits)
486 * @ports: Ports associated with this controller
487 * @nports: Number of ports supported by the controller
488 * @chans: Channels associated with this controller
489 * @nchans: Number of channels supported
Sagar Dharia4ec2ff42011-09-26 10:20:17 -0600490 * @reserved: Reserved channels that controller wants to use internally
491 * Clients will be assigned channel numbers after this number
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700492 * @sched: scheduler structure used by the controller
493 * @dev_released: completion used to signal when sysfs has released this
494 * controller so that it can be deleted during shutdown
495 * @xfer_msg: Transfer a message on this controller (this can be a broadcast
496 * control/status message like data channel setup, or a unicast message
497 * like value element read/write.
498 * @set_laddr: Setup logical address at laddr for the slave with elemental
499 * address e_addr. Drivers implementing controller will be expected to
500 * send unicast message to this device with its logical address.
Sagar Dharia33f34442011-08-08 16:22:03 -0600501 * @wakeup: This function pointer implements controller-specific procedure
502 * to wake it up from clock-pause. Framework will call this to bring
503 * the controller out of clock pause.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700504 * @config_port: Configure a port and make it ready for data transfer. This is
505 * called by framework after connect_port message is sent successfully.
506 * @framer_handover: If this controller has multiple framers, this API will
507 * be called to switch between framers if controller desires to change
508 * the active framer.
509 * @port_xfer: Called to schedule a transfer on port pn. iobuf is physical
510 * address and the buffer may have to be DMA friendly since data channels
511 * will be using data from this buffers without SW intervention.
512 * @port_xfer_status: Called by framework when client calls get_xfer_status
513 * API. Returns how much buffer is actually processed and the port
514 * errors (e.g. overflow/underflow) if any.
515 */
516struct slim_controller {
517 struct device dev;
518 unsigned int nr;
519 struct list_head list;
520 char name[SLIMBUS_NAME_SIZE];
521 int clkgear;
Sagar Dharia98a7ecb2011-07-25 15:25:35 -0600522 int min_cg;
523 int max_cg;
Sagar Dharia33f34442011-08-08 16:22:03 -0600524 enum slim_clk_state clk_state;
525 struct completion pause_comp;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700526 struct slim_framer *a_framer;
527 struct mutex m_ctrl;
528 struct slim_addrt *addrt;
529 u8 num_dev;
Sagar Dharia9c706fb2012-07-23 19:38:57 -0600530 struct list_head devs;
531 struct workqueue_struct *wq;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700532 struct slim_msg_txn **txnt;
533 u8 last_tid;
534 struct slim_port *ports;
535 int nports;
536 struct slim_ich *chans;
537 int nchans;
Sagar Dharia4ec2ff42011-09-26 10:20:17 -0600538 u8 reserved;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700539 struct slim_sched sched;
540 struct completion dev_released;
541 int (*xfer_msg)(struct slim_controller *ctrl,
542 struct slim_msg_txn *txn);
543 int (*set_laddr)(struct slim_controller *ctrl,
544 const u8 *ea, u8 elen, u8 laddr);
Sagar Dharia33f34442011-08-08 16:22:03 -0600545 int (*wakeup)(struct slim_controller *ctrl);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700546 int (*config_port)(struct slim_controller *ctrl,
547 u8 port);
548 int (*framer_handover)(struct slim_controller *ctrl,
549 struct slim_framer *new_framer);
550 int (*port_xfer)(struct slim_controller *ctrl,
551 u8 pn, u8 *iobuf, u32 len,
552 struct completion *comp);
553 enum slim_port_err (*port_xfer_status)(struct slim_controller *ctr,
554 u8 pn, u8 **done_buf, u32 *done_len);
555};
556#define to_slim_controller(d) container_of(d, struct slim_controller, dev)
557
558/*
559 * struct slim_driver: Manage Slimbus generic/slave device driver
560 * @probe: Binds this driver to a slimbus device.
561 * @remove: Unbinds this driver from the slimbus device.
562 * @shutdown: Standard shutdown callback used during powerdown/halt.
563 * @suspend: Standard suspend callback used during system suspend
564 * @resume: Standard resume callback used during system resume
565 * @driver: Slimbus device drivers should initialize name and owner field of
566 * this structure
567 * @id_table: List of slimbus devices supported by this driver
568 */
569struct slim_driver {
570 int (*probe)(struct slim_device *sldev);
571 int (*remove)(struct slim_device *sldev);
572 void (*shutdown)(struct slim_device *sldev);
573 int (*suspend)(struct slim_device *sldev,
574 pm_message_t pmesg);
575 int (*resume)(struct slim_device *sldev);
Sagar Dharia9c706fb2012-07-23 19:38:57 -0600576 int (*device_up)(struct slim_device *sldev);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700577
578 struct device_driver driver;
579 const struct slim_device_id *id_table;
580};
581#define to_slim_driver(d) container_of(d, struct slim_driver, driver)
582
583/*
584 * struct slim_pending_ch: List of pending channels used by framework.
585 * @chan: Channel number
586 * @pending: list of channels
587 */
588struct slim_pending_ch {
589 u8 chan;
590 struct list_head pending;
591};
592
593/*
594 * Client/device handle (struct slim_device):
595 * ------------------------------------------
596 * This is the client/device handle returned when a slimbus
597 * device is registered with a controller. This structure can be provided
598 * during register_board_info, or can be allocated using slim_add_device API.
599 * Pointer to this structure is used by client-driver as a handle.
600 * @dev: Driver model representation of the device.
601 * @name: Name of driver to use with this device.
602 * @e_addr: 6-byte elemental address of this device.
603 * @driver: Device's driver. Pointer to access routines.
604 * @ctrl: Slimbus controller managing the bus hosting this device.
605 * @laddr: 1-byte Logical address of this device.
606 * @mark_define: List of channels pending definition/activation.
607 * @mark_suspend: List of channels pending suspend.
608 * @mark_removal: List of channels pending removal.
Sagar Dharia9c706fb2012-07-23 19:38:57 -0600609 * @notified: Flag to indicate whether this device has been notified. The
610 * device may report present multiple times, but should be notified only
611 * first time it has reported present.
612 * @dev_list: List of devices on a controller
613 * @wd: Work structure associated with workqueue for presence notification
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700614 * @sldev_reconf: Mutex to protect the pending data-channel lists.
615 * @pending_msgsl: Message bandwidth reservation request by this client in
616 * slots that's pending reconfiguration.
617 * @cur_msgsl: Message bandwidth reserved by this client in slots.
618 * These 3 lists are managed by framework. Lists are populated when client
619 * calls channel control API without reconfig-flag set and the lists are
620 * emptied when the reconfiguration is done by this client.
621 */
622struct slim_device {
623 struct device dev;
624 const char *name;
625 u8 e_addr[6];
626 struct slim_driver *driver;
627 struct slim_controller *ctrl;
628 u8 laddr;
629 struct list_head mark_define;
630 struct list_head mark_suspend;
631 struct list_head mark_removal;
Sagar Dharia9c706fb2012-07-23 19:38:57 -0600632 bool notified;
633 struct list_head dev_list;
634 struct work_struct wd;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700635 struct mutex sldev_reconf;
636 u32 pending_msgsl;
637 u32 cur_msgsl;
638};
639#define to_slim_device(d) container_of(d, struct slim_device, dev)
640
641/*
642 * struct slim_boardinfo: Declare board info for Slimbus device bringup.
643 * @bus_num: Controller number (bus) on which this device will sit.
644 * @slim_slave: Device to be registered with slimbus.
645 */
646struct slim_boardinfo {
647 int bus_num;
648 struct slim_device *slim_slave;
649};
650
651/*
652 * slim_get_logical_addr: Return the logical address of a slimbus device.
653 * @sb: client handle requesting the adddress.
654 * @e_addr: Elemental address of the device.
655 * @e_len: Length of e_addr
656 * @laddr: output buffer to store the address
657 * context: can sleep
658 * -EINVAL is returned in case of invalid parameters, and -ENXIO is returned if
659 * the device with this elemental address is not found.
660 */
661
662extern int slim_get_logical_addr(struct slim_device *sb, const u8 *e_addr,
663 u8 e_len, u8 *laddr);
664
665
666/* Message APIs Unicast message APIs used by slimbus slave drivers */
667
668/*
669 * Message API access routines.
670 * @sb: client handle requesting elemental message reads, writes.
671 * @msg: Input structure for start-offset, number of bytes to read.
672 * @rbuf: data buffer to be filled with values read.
673 * @len: data buffer size
674 * @wbuf: data buffer containing value/information to be written
675 * context: can sleep
676 * Returns:
677 * -EINVAL: Invalid parameters
678 * -ETIMEDOUT: If controller could not complete the request. This may happen if
679 * the bus lines are not clocked, controller is not powered-on, slave with
680 * given address is not enumerated/responding.
681 */
682extern int slim_request_val_element(struct slim_device *sb,
683 struct slim_ele_access *msg, u8 *buf,
684 u8 len);
685extern int slim_request_inf_element(struct slim_device *sb,
686 struct slim_ele_access *msg, u8 *buf,
687 u8 len);
688extern int slim_change_val_element(struct slim_device *sb,
689 struct slim_ele_access *msg,
690 const u8 *buf, u8 len);
691extern int slim_clear_inf_element(struct slim_device *sb,
692 struct slim_ele_access *msg, u8 *buf,
693 u8 len);
694extern int slim_request_change_val_element(struct slim_device *sb,
695 struct slim_ele_access *msg, u8 *rbuf,
696 const u8 *wbuf, u8 len);
697extern int slim_request_clear_inf_element(struct slim_device *sb,
698 struct slim_ele_access *msg, u8 *rbuf,
699 const u8 *wbuf, u8 len);
700
701/*
702 * Broadcast message API:
703 * call this API directly with sbdev = NULL.
704 * For broadcast reads, make sure that buffers are big-enough to incorporate
705 * replies from all logical addresses.
706 * All controllers may not support broadcast
707 */
708extern int slim_xfer_msg(struct slim_controller *ctrl,
709 struct slim_device *sbdev, struct slim_ele_access *msg,
Sagar Dharia45ee38a2011-08-03 17:01:31 -0600710 u16 mc, u8 *rbuf, const u8 *wbuf, u8 len);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700711/* end of message apis */
712
713/* Port management for manager device APIs */
714
715/*
716 * slim_alloc_mgrports: Allocate port on manager side.
717 * @sb: device/client handle.
718 * @req: Port request type.
719 * @nports: Number of ports requested
720 * @rh: output buffer to store the port handles
721 * @hsz: size of buffer storing handles
722 * context: can sleep
723 * This port will be typically used by SW. e.g. client driver wants to receive
724 * some data from audio codec HW using a data channel.
725 * Port allocated using this API will be used to receive the data.
726 * If half-duplex ports are requested, two adjacent ports are allocated for
727 * 1 half-duplex port. So the handle-buffer size should be twice the number
728 * of half-duplex ports to be allocated.
729 * -EDQUOT is returned if all ports are in use.
730 */
731extern int slim_alloc_mgrports(struct slim_device *sb, enum slim_port_req req,
732 int nports, u32 *rh, int hsz);
733
734/* Deallocate the port(s) allocated using the API above */
735extern int slim_dealloc_mgrports(struct slim_device *sb, u32 *hdl, int hsz);
736
737/*
738 * slim_port_xfer: Schedule buffer to be transferred/received using port-handle.
739 * @sb: client handle
740 * @ph: port-handle
741 * @iobuf: buffer to be transferred or populated
742 * @len: buffer size.
743 * @comp: completion signal to indicate transfer done or error.
744 * context: can sleep
745 * Returns number of bytes transferred/received if used synchronously.
746 * Will return 0 if used asynchronously.
747 * Client will call slim_port_get_xfer_status to get error and/or number of
748 * bytes transferred if used asynchronously.
749 */
750extern int slim_port_xfer(struct slim_device *sb, u32 ph, u8 *iobuf, u32 len,
751 struct completion *comp);
752
753/*
754 * slim_port_get_xfer_status: Poll for port transfers, or get transfer status
755 * after completion is done.
756 * @sb: client handle
757 * @ph: port-handle
758 * @done_buf: return pointer (iobuf from slim_port_xfer) which is processed.
759 * @done_len: Number of bytes transferred.
760 * This can be called when port_xfer complition is signalled.
761 * The API will return port transfer error (underflow/overflow/disconnect)
762 * and/or done_len will reflect number of bytes transferred. Note that
763 * done_len may be valid even if port error (overflow/underflow) has happened.
764 * e.g. If the transfer was scheduled with a few bytes to be transferred and
765 * client has not supplied more data to be transferred, done_len will indicate
766 * number of bytes transferred with underflow error. To avoid frequent underflow
767 * errors, multiple transfers can be queued (e.g. ping-pong buffers) so that
768 * channel has data to be transferred even if client is not ready to transfer
769 * data all the time. done_buf will indicate address of the last buffer
770 * processed from the multiple transfers.
771 */
772extern enum slim_port_err slim_port_get_xfer_status(struct slim_device *sb,
773 u32 ph, u8 **done_buf, u32 *done_len);
774
775/*
Sagar Dharia29f35f02011-10-01 20:37:50 -0600776 * slim_connect_src: Connect source port to channel.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700777 * @sb: client handle
Sagar Dharia29f35f02011-10-01 20:37:50 -0600778 * @srch: source handle to be connected to this channel
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700779 * @chanh: Channel with which the ports need to be associated with.
Sagar Dharia29f35f02011-10-01 20:37:50 -0600780 * Per slimbus specification, a channel may have 1 source port.
781 * Channel specified in chanh needs to be allocated first.
782 * Returns -EALREADY if source is already configured for this channel.
783 * Returns -ENOTCONN if channel is not allocated
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700784 */
Sagar Dharia29f35f02011-10-01 20:37:50 -0600785extern int slim_connect_src(struct slim_device *sb, u32 srch, u16 chanh);
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700786
787/*
Sagar Dharia29f35f02011-10-01 20:37:50 -0600788 * slim_connect_sink: Connect sink port(s) to channel.
789 * @sb: client handle
790 * @sinkh: sink handle(s) to be connected to this channel
791 * @nsink: number of sinks
792 * @chanh: Channel with which the ports need to be associated with.
793 * Per slimbus specification, a channel may have multiple sink-ports.
794 * Channel specified in chanh needs to be allocated first.
795 * Returns -EALREADY if sink is already configured for this channel.
796 * Returns -ENOTCONN if channel is not allocated
797 */
798extern int slim_connect_sink(struct slim_device *sb, u32 *sinkh, int nsink,
799 u16 chanh);
800/*
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700801 * slim_disconnect_ports: Disconnect port(s) from channel
802 * @sb: client handle
803 * @ph: ports to be disconnected
804 * @nph: number of ports.
805 * Disconnects ports from a channel.
806 */
807extern int slim_disconnect_ports(struct slim_device *sb, u32 *ph, int nph);
808
809/*
810 * slim_get_slaveport: Get slave port handle
811 * @la: slave device logical address.
812 * @idx: port index at slave
813 * @rh: return handle
814 * @flw: Flow type (source or destination)
815 * This API only returns a slave port's representation as expected by slimbus
816 * driver. This port is not managed by the slimbus driver. Caller is expected
817 * to have visibility of this port since it's a device-port.
818 */
819extern int slim_get_slaveport(u8 la, int idx, u32 *rh, enum slim_port_flow flw);
820
821
822/* Channel functions. */
823
824/*
825 * slim_alloc_ch: Allocate a slimbus channel and return its handle.
826 * @sb: client handle.
827 * @chanh: return channel handle
Sagar Dharia4ec2ff42011-09-26 10:20:17 -0600828 * Slimbus channels are limited to 256 per specification.
829 * -EXFULL is returned if all channels are in use.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700830 * Although slimbus specification supports 256 channels, a controller may not
831 * support that many channels.
832 */
833extern int slim_alloc_ch(struct slim_device *sb, u16 *chanh);
834
835/*
Sagar Dharia4ec2ff42011-09-26 10:20:17 -0600836 * slim_query_ch: Get reference-counted handle for a channel number. Every
837 * channel is reference counted by one as producer and the others as
838 * consumer)
839 * @sb: client handle
840 * @chan: slimbus channel number
841 * @chanh: return channel handle
842 * If request channel number is not in use, it is allocated, and reference
843 * count is set to one. If the channel was was already allocated, this API
844 * will return handle to that channel and reference count is incremented.
845 * -EXFULL is returned if all channels are in use
846 */
847extern int slim_query_ch(struct slim_device *sb, u8 chan, u16 *chanh);
848/*
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700849 * slim_dealloc_ch: Deallocate channel allocated using the API above
850 * -EISCONN is returned if the channel is tried to be deallocated without
851 * being removed first.
Sagar Dharia4ec2ff42011-09-26 10:20:17 -0600852 * -ENOTCONN is returned if deallocation is tried on a channel that's not
853 * allocated.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700854 */
855extern int slim_dealloc_ch(struct slim_device *sb, u16 chanh);
856
857
858/*
859 * slim_define_ch: Define a channel.This API defines channel parameters for a
860 * given channel.
861 * @sb: client handle.
862 * @prop: slim_ch structure with channel parameters desired to be used.
863 * @chanh: list of channels to be defined.
864 * @nchan: number of channels in a group (1 if grp is false)
865 * @grp: Are the channels grouped
866 * @grph: return group handle if grouping of channels is desired.
867 * Channels can be grouped if multiple channels use same parameters
868 * (e.g. 5.1 audio has 6 channels with same parameters. They will all be
869 * grouped and given 1 handle for simplicity and avoid repeatedly calling
870 * the API)
Sagar Dharia4ec2ff42011-09-26 10:20:17 -0600871 * -EISCONN is returned if channel is already used with different parameters.
872 * -ENXIO is returned if the channel is not yet allocated.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700873 */
874extern int slim_define_ch(struct slim_device *sb, struct slim_ch *prop,
875 u16 *chanh, u8 nchan, bool grp, u16 *grph);
876
877/*
878 * slim_control_ch: Channel control API.
879 * @sb: client handle
880 * @grpchanh: group or channel handle to be controlled
881 * @chctrl: Control command (activate/suspend/remove)
882 * @commit: flag to indicate whether the control should take effect right-away.
883 * This API activates, removes or suspends a channel (or group of channels)
884 * grpchanh indicates the channel or group handle (returned by the define_ch
885 * API). Reconfiguration may be time-consuming since it can change all other
886 * active channel allocations on the bus, change in clock gear used by the
887 * slimbus, and change in the control space width used for messaging.
888 * commit makes sure that multiple channels can be activated/deactivated before
889 * reconfiguration is started.
890 * -EXFULL is returned if there is no space in TDM to reserve the bandwidth.
891 * -EISCONN/-ENOTCONN is returned if the channel is already connected or not
892 * yet defined.
Sagar Dharia2e7026a2012-02-21 17:48:14 -0700893 * -EINVAL is returned if individual control of a grouped-channel is attempted.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700894 */
895extern int slim_control_ch(struct slim_device *sb, u16 grpchanh,
896 enum slim_ch_control chctrl, bool commit);
897
898/*
899 * slim_get_ch_state: Channel state.
900 * This API returns the channel's state (active, suspended, inactive etc)
901 */
902extern enum slim_ch_state slim_get_ch_state(struct slim_device *sb,
903 u16 chanh);
904
905/*
906 * slim_reservemsg_bw: Request to reserve bandwidth for messages.
907 * @sb: client handle
908 * @bw_bps: message bandwidth in bits per second to be requested
909 * @commit: indicates whether the reconfiguration needs to be acted upon.
910 * This API call can be grouped with slim_control_ch API call with only one of
911 * the APIs specifying the commit flag to avoid reconfiguration being called too
912 * frequently. -EXFULL is returned if there is no space in TDM to reserve the
913 * bandwidth. -EBUSY is returned if reconfiguration is requested, but a request
914 * is already in progress.
915 */
916extern int slim_reservemsg_bw(struct slim_device *sb, u32 bw_bps, bool commit);
917
918/*
919 * slim_reconfigure_now: Request reconfiguration now.
920 * @sb: client handle
921 * This API does what commit flag in other scheduling APIs do.
922 * -EXFULL is returned if there is no space in TDM to reserve the
923 * bandwidth. -EBUSY is returned if reconfiguration request is already in
924 * progress.
925 */
926extern int slim_reconfigure_now(struct slim_device *sb);
927
928/*
Sagar Dharia33f34442011-08-08 16:22:03 -0600929 * slim_ctrl_clk_pause: Called by slimbus controller to request clock to be
930 * paused or woken up out of clock pause
931 * @ctrl: controller requesting bus to be paused or woken up
932 * @wakeup: Wakeup this controller from clock pause.
933 * @restart: Restart time value per spec used for clock pause. This value
934 * isn't used when controller is to be woken up.
935 * This API executes clock pause reconfiguration sequence if wakeup is false.
936 * If wakeup is true, controller's wakeup is called
937 * Slimbus clock is idle and can be disabled by the controller later.
938 */
939extern int slim_ctrl_clk_pause(struct slim_controller *ctrl, bool wakeup,
940 u8 restart);
941
942/*
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700943 * slim_driver_register: Client driver registration with slimbus
944 * @drv:Client driver to be associated with client-device.
945 * This API will register the client driver with the slimbus
946 * It is called from the driver's module-init function.
947 */
948extern int slim_driver_register(struct slim_driver *drv);
949
950/*
951 * slim_add_numbered_controller: Controller bring-up.
952 * @ctrl: Controller to be registered.
953 * A controller is registered with the framework using this API. ctrl->nr is the
954 * desired number with which slimbus framework registers the controller.
955 * Function will return -EBUSY if the number is in use.
956 */
957extern int slim_add_numbered_controller(struct slim_controller *ctrl);
958
959/*
960 * slim_del_controller: Controller tear-down.
961 * Controller added with the above API is teared down using this API.
962 */
963extern int slim_del_controller(struct slim_controller *ctrl);
964
965/*
966 * slim_add_device: Add a new device without register board info.
967 * @ctrl: Controller to which this device is to be added to.
968 * Called when device doesn't have an explicit client-driver to be probed, or
969 * the client-driver is a module installed dynamically.
970 */
971extern int slim_add_device(struct slim_controller *ctrl,
972 struct slim_device *sbdev);
973
974/* slim_remove_device: Remove the effect of slim_add_device() */
975extern void slim_remove_device(struct slim_device *sbdev);
976
977/*
978 * slim_assign_laddr: Assign logical address to a device enumerated.
979 * @ctrl: Controller with which device is enumerated.
980 * @e_addr: 6-byte elemental address of the device.
981 * @e_len: buffer length for e_addr
982 * @laddr: Return logical address.
983 * Called by controller in response to REPORT_PRESENT. Framework will assign
984 * a logical address to this enumeration address.
985 * Function returns -EXFULL to indicate that all logical addresses are already
986 * taken.
987 */
988extern int slim_assign_laddr(struct slim_controller *ctrl, const u8 *e_addr,
989 u8 e_len, u8 *laddr);
990
991/*
992 * slim_msg_response: Deliver Message response received from a device to the
993 * framework.
994 * @ctrl: Controller handle
995 * @reply: Reply received from the device
996 * @len: Length of the reply
997 * @tid: Transaction ID received with which framework can associate reply.
998 * Called by controller to inform framework about the response received.
999 * This helps in making the API asynchronous, and controller-driver doesn't need
1000 * to manage 1 more table other than the one managed by framework mapping TID
1001 * with buffers
1002 */
1003extern void slim_msg_response(struct slim_controller *ctrl, u8 *reply, u8 tid,
1004 u8 len);
1005
1006/*
1007 * slim_busnum_to_ctrl: Map bus number to controller
1008 * @busnum: Bus number
1009 * Returns controller representing this bus number
1010 */
1011extern struct slim_controller *slim_busnum_to_ctrl(u32 busnum);
1012
1013/*
1014 * slim_register_board_info: Board-initialization routine.
1015 * @info: List of all devices on all controllers present on the board.
1016 * @n: number of entries.
1017 * API enumerates respective devices on corresponding controller.
1018 * Called from board-init function.
1019 */
1020#ifdef CONFIG_SLIMBUS
1021extern int slim_register_board_info(struct slim_boardinfo const *info,
1022 unsigned n);
1023#else
1024int slim_register_board_info(struct slim_boardinfo const *info,
1025 unsigned n)
1026{
1027 return 0;
1028}
1029#endif
1030
1031static inline void *slim_get_ctrldata(const struct slim_controller *dev)
1032{
1033 return dev_get_drvdata(&dev->dev);
1034}
1035
1036static inline void slim_set_ctrldata(struct slim_controller *dev, void *data)
1037{
1038 dev_set_drvdata(&dev->dev, data);
1039}
1040
1041static inline void *slim_get_devicedata(const struct slim_device *dev)
1042{
1043 return dev_get_drvdata(&dev->dev);
1044}
1045
1046static inline void slim_set_clientdata(struct slim_device *dev, void *data)
1047{
1048 dev_set_drvdata(&dev->dev, data);
1049}
1050#endif /* _LINUX_SLIMBUS_H */