1 /***************************************************************************
2 * Copyright (c) 2005-2009, Broadcom Corporation.
4 * Name: crystalhd_cmds . h
7 * BCM70010 Linux driver user command interfaces.
11 **********************************************************************
12 * This file is part of the crystalhd device driver.
14 * This driver is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation, version 2 of the License.
18 * This driver is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this driver. If not, see <http://www.gnu.org/licenses/>.
25 **********************************************************************/
27 #ifndef _CRYSTALHD_CMDS_H_
28 #define _CRYSTALHD_CMDS_H_
31 * NOTE:: This is the main interface file between the Linux layer
32 * and the hardware layer. This file will use the definitions
33 * from _dts_glob and dts_defs etc.. which are defined for
37 #include "crystalhd.h"
39 enum crystalhd_state
{
40 BC_LINK_INVALID
= 0x00,
42 BC_LINK_CAP_EN
= 0x02,
43 BC_LINK_FMT_CHG
= 0x04,
44 BC_LINK_SUSPEND
= 0x10,
45 BC_LINK_PAUSED
= 0x20,
46 BC_LINK_READY
= (BC_LINK_INIT
| BC_LINK_CAP_EN
| BC_LINK_FMT_CHG
),
49 struct crystalhd_user
{
55 #define DTS_MODE_INV (-1)
57 struct crystalhd_cmd
{
59 struct crystalhd_adp
*adp
;
60 struct crystalhd_user user
[BC_LINK_MAX_OPENS
];
64 uint32_t cin_wait_exit
;
65 uint32_t pwr_state_change
;
66 struct crystalhd_hw hw_ctx
;
69 typedef enum BC_STATUS(*crystalhd_cmd_proc
)(struct crystalhd_cmd
*,
70 struct crystalhd_ioctl_data
*);
72 struct crystalhd_cmd_tbl
{
74 const crystalhd_cmd_proc cmd_proc
;
78 enum BC_STATUS
crystalhd_suspend(struct crystalhd_cmd
*ctx
,
79 struct crystalhd_ioctl_data
*idata
);
80 enum BC_STATUS
crystalhd_resume(struct crystalhd_cmd
*ctx
);
81 crystalhd_cmd_proc
crystalhd_get_cmd_proc(struct crystalhd_cmd
*ctx
,
82 uint32_t cmd
, struct crystalhd_user
*uc
);
83 enum BC_STATUS
crystalhd_user_open(struct crystalhd_cmd
*ctx
,
84 struct crystalhd_user
**user_ctx
);
85 enum BC_STATUS
crystalhd_user_close(struct crystalhd_cmd
*ctx
,
86 struct crystalhd_user
*uc
);
87 enum BC_STATUS
crystalhd_setup_cmd_context(struct crystalhd_cmd
*ctx
,
88 struct crystalhd_adp
*adp
);
89 enum BC_STATUS
crystalhd_delete_cmd_context(struct crystalhd_cmd
*ctx
);
90 bool crystalhd_cmd_interrupt(struct crystalhd_cmd
*ctx
);