aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ufs/ufshcd.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/ufs/ufshcd.h')
-rw-r--r--drivers/scsi/ufs/ufshcd.h34
1 files changed, 32 insertions, 2 deletions
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index acf318e338ed..8c6bec05283e 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -68,6 +68,8 @@
68#define UFSHCD "ufshcd" 68#define UFSHCD "ufshcd"
69#define UFSHCD_DRIVER_VERSION "0.2" 69#define UFSHCD_DRIVER_VERSION "0.2"
70 70
71struct ufs_hba;
72
71enum dev_cmd_type { 73enum dev_cmd_type {
72 DEV_CMD_TYPE_NOP = 0x0, 74 DEV_CMD_TYPE_NOP = 0x0,
73 DEV_CMD_TYPE_QUERY = 0x1, 75 DEV_CMD_TYPE_QUERY = 0x1,
@@ -152,6 +154,30 @@ struct ufs_dev_cmd {
152 struct ufs_query query; 154 struct ufs_query query;
153}; 155};
154 156
157#define PRE_CHANGE 0
158#define POST_CHANGE 1
159/**
160 * struct ufs_hba_variant_ops - variant specific callbacks
161 * @name: variant name
162 * @init: called when the driver is initialized
163 * @exit: called to cleanup everything done in init
164 * @setup_clocks: called before touching any of the controller registers
165 * @setup_regulators: called before accessing the host controller
166 * @hce_enable_notify: called before and after HCE enable bit is set to allow
167 * variant specific Uni-Pro initialization.
168 * @link_startup_notify: called before and after Link startup is carried out
169 * to allow variant specific Uni-Pro initialization.
170 */
171struct ufs_hba_variant_ops {
172 const char *name;
173 int (*init)(struct ufs_hba *);
174 void (*exit)(struct ufs_hba *);
175 int (*setup_clocks)(struct ufs_hba *, bool);
176 int (*setup_regulators)(struct ufs_hba *, bool);
177 int (*hce_enable_notify)(struct ufs_hba *, bool);
178 int (*link_startup_notify)(struct ufs_hba *, bool);
179};
180
155/** 181/**
156 * struct ufs_hba - per adapter private structure 182 * struct ufs_hba - per adapter private structure
157 * @mmio_base: UFSHCI base register address 183 * @mmio_base: UFSHCI base register address
@@ -171,6 +197,8 @@ struct ufs_dev_cmd {
171 * @nutrs: Transfer Request Queue depth supported by controller 197 * @nutrs: Transfer Request Queue depth supported by controller
172 * @nutmrs: Task Management Queue depth supported by controller 198 * @nutmrs: Task Management Queue depth supported by controller
173 * @ufs_version: UFS Version to which controller complies 199 * @ufs_version: UFS Version to which controller complies
200 * @vops: pointer to variant specific operations
201 * @priv: pointer to variant specific private data
174 * @irq: Irq number of the controller 202 * @irq: Irq number of the controller
175 * @active_uic_cmd: handle of active UIC command 203 * @active_uic_cmd: handle of active UIC command
176 * @uic_cmd_mutex: mutex for uic command 204 * @uic_cmd_mutex: mutex for uic command
@@ -218,6 +246,8 @@ struct ufs_hba {
218 int nutrs; 246 int nutrs;
219 int nutmrs; 247 int nutmrs;
220 u32 ufs_version; 248 u32 ufs_version;
249 struct ufs_hba_variant_ops *vops;
250 void *priv;
221 unsigned int irq; 251 unsigned int irq;
222 252
223 struct uic_command *active_uic_cmd; 253 struct uic_command *active_uic_cmd;
@@ -256,8 +286,8 @@ struct ufs_hba {
256#define ufshcd_readl(hba, reg) \ 286#define ufshcd_readl(hba, reg) \
257 readl((hba)->mmio_base + (reg)) 287 readl((hba)->mmio_base + (reg))
258 288
259int ufshcd_init(struct device *, struct ufs_hba ** , void __iomem * , 289int ufshcd_alloc_host(struct device *, struct ufs_hba **);
260 unsigned int); 290int ufshcd_init(struct ufs_hba * , void __iomem * , unsigned int);
261void ufshcd_remove(struct ufs_hba *); 291void ufshcd_remove(struct ufs_hba *);
262 292
263/** 293/**