2 * HiSilicon Hixxxx UFS Driver
4 * Copyright (c) 2016-2017 Linaro Ltd.
5 * Copyright (c) 2016-2017 HiSilicon Technologies Co., Ltd.
7 * Released under the GPLv2 only.
8 * SPDX-License-Identifier: GPL-2.0
11 #include <linux/time.h>
13 #include <linux/of_address.h>
14 #include <linux/dma-mapping.h>
15 #include <linux/platform_device.h>
16 #include <linux/reset.h>
19 #include "ufshcd-pltfrm.h"
24 static int ufs_hisi_check_hibern8(struct ufs_hba *hba)
29 unsigned long timeout = jiffies + msecs_to_jiffies(HBRN8_POLL_TOUT_MS);
32 err = ufshcd_dme_get(hba, UIC_ARG_MIB_SEL(MPHY_TX_FSM_STATE, 0),
34 err |= ufshcd_dme_get(hba,
35 UIC_ARG_MIB_SEL(MPHY_TX_FSM_STATE, 1), &tx_fsm_val_1);
36 if (err || (tx_fsm_val_0 == TX_FSM_HIBERN8 &&
37 tx_fsm_val_1 == TX_FSM_HIBERN8))
40 /* sleep for max. 200us */
41 usleep_range(100, 200);
42 } while (time_before(jiffies, timeout));
45 * we might have scheduled out for long during polling so
46 * check the state again.
48 if (time_after(jiffies, timeout)) {
49 err = ufshcd_dme_get(hba, UIC_ARG_MIB_SEL(MPHY_TX_FSM_STATE, 0),
51 err |= ufshcd_dme_get(hba,
52 UIC_ARG_MIB_SEL(MPHY_TX_FSM_STATE, 1), &tx_fsm_val_1);
56 dev_err(hba->dev, "%s: unable to get TX_FSM_STATE, err %d\n",
58 } else if (tx_fsm_val_0 != TX_FSM_HIBERN8 ||
59 tx_fsm_val_1 != TX_FSM_HIBERN8) {
61 dev_err(hba->dev, "%s: invalid TX_FSM_STATE, lane0 = %d, lane1 = %d\n",
62 __func__, tx_fsm_val_0, tx_fsm_val_1);
68 static void ufs_hi3660_clk_init(struct ufs_hba *hba)
70 struct ufs_hisi_host *host = ufshcd_get_variant(hba);
72 ufs_sys_ctrl_clr_bits(host, BIT_SYSCTRL_REF_CLOCK_EN, PHY_CLK_CTRL);
73 if (ufs_sys_ctrl_readl(host, PHY_CLK_CTRL) & BIT_SYSCTRL_REF_CLOCK_EN)
76 ufs_sys_ctrl_clr_bits(host, BIT_UFS_REFCLK_SRC_SEl, UFS_SYSCTRL);
77 ufs_sys_ctrl_clr_bits(host, BIT_UFS_REFCLK_ISO_EN, PHY_ISO_EN);
78 /* open mphy ref clk */
79 ufs_sys_ctrl_set_bits(host, BIT_SYSCTRL_REF_CLOCK_EN, PHY_CLK_CTRL);
82 static void ufs_hi3660_soc_init(struct ufs_hba *hba)
84 struct ufs_hisi_host *host = ufshcd_get_variant(hba);
87 if (!IS_ERR(host->rst))
88 reset_control_assert(host->rst);
91 ufs_sys_ctrl_set_bits(host, BIT_UFS_PSW_MTCMOS_EN, PSW_POWER_CTRL);
93 /* notify PWR ready */
94 ufs_sys_ctrl_set_bits(host, BIT_SYSCTRL_PWR_READY, HC_LP_CTRL);
95 ufs_sys_ctrl_writel(host, MASK_UFS_DEVICE_RESET | 0,
96 UFS_DEVICE_RESET_CTRL);
98 reg = ufs_sys_ctrl_readl(host, PHY_CLK_CTRL);
99 reg = (reg & ~MASK_SYSCTRL_CFG_CLOCK_FREQ) | UFS_FREQ_CFG_CLK;
100 /* set cfg clk freq */
101 ufs_sys_ctrl_writel(host, reg, PHY_CLK_CTRL);
102 /* set ref clk freq */
103 ufs_sys_ctrl_clr_bits(host, MASK_SYSCTRL_REF_CLOCK_SEL, PHY_CLK_CTRL);
104 /* bypass ufs clk gate */
105 ufs_sys_ctrl_set_bits(host, MASK_UFS_CLK_GATE_BYPASS,
107 ufs_sys_ctrl_set_bits(host, MASK_UFS_SYSCRTL_BYPASS, UFS_SYSCTRL);
110 ufs_sys_ctrl_set_bits(host, BIT_SYSCTRL_PSW_CLK_EN, PSW_CLK_CTRL);
111 /* disable ufshc iso */
112 ufs_sys_ctrl_clr_bits(host, BIT_UFS_PSW_ISO_CTRL, PSW_POWER_CTRL);
113 /* disable phy iso */
114 ufs_sys_ctrl_clr_bits(host, BIT_UFS_PHY_ISO_CTRL, PHY_ISO_EN);
115 /* notice iso disable */
116 ufs_sys_ctrl_clr_bits(host, BIT_SYSCTRL_LP_ISOL_EN, HC_LP_CTRL);
118 /* disable lp_reset_n */
119 ufs_sys_ctrl_set_bits(host, BIT_SYSCTRL_LP_RESET_N, RESET_CTRL_EN);
122 ufs_sys_ctrl_writel(host, MASK_UFS_DEVICE_RESET | BIT_UFS_DEVICE_RESET,
123 UFS_DEVICE_RESET_CTRL);
128 * enable the fix of linereset recovery,
129 * and enable rx_reset/tx_rest beat
130 * enable ref_clk_en override(bit5) &
131 * override value = 1(bit4), with mask
133 ufs_sys_ctrl_writel(host, 0x03300330, UFS_DEVICE_RESET_CTRL);
135 if (!IS_ERR(host->rst))
136 reset_control_deassert(host->rst);
139 static int ufs_hisi_link_startup_pre_change(struct ufs_hba *hba)
145 /* Unipro VS_mphy_disable */
146 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0xD0C1, 0x0), 0x1);
148 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x156A, 0x0), 0x2);
150 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x8114, 0x0), 0x1);
151 /* MPHY CBOVRCTRL2 */
152 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x8121, 0x0), 0x2D);
153 /* MPHY CBOVRCTRL3 */
154 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x8122, 0x0), 0x1);
155 /* Unipro VS_MphyCfgUpdt */
156 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0xD085, 0x0), 0x1);
157 /* MPHY RXOVRCTRL4 rx0 */
158 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x800D, 0x4), 0x58);
159 /* MPHY RXOVRCTRL4 rx1 */
160 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x800D, 0x5), 0x58);
161 /* MPHY RXOVRCTRL5 rx0 */
162 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x800E, 0x4), 0xB);
163 /* MPHY RXOVRCTRL5 rx1 */
164 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x800E, 0x5), 0xB);
165 /* MPHY RXSQCONTROL rx0 */
166 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x8009, 0x4), 0x1);
167 /* MPHY RXSQCONTROL rx1 */
168 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x8009, 0x5), 0x1);
169 /* Unipro VS_MphyCfgUpdt */
170 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0xD085, 0x0), 0x1);
172 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x8113, 0x0), 0x1);
173 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0xD085, 0x0), 0x1);
176 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x008F, 0x4), 0x7);
178 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x008F, 0x5), 0x7);
180 /* Gear3 Synclength */
181 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x0095, 0x4), 0x4F);
182 /* Gear3 Synclength */
183 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x0095, 0x5), 0x4F);
184 /* Gear2 Synclength */
185 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x0094, 0x4), 0x4F);
186 /* Gear2 Synclength */
187 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x0094, 0x5), 0x4F);
188 /* Gear1 Synclength */
189 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x008B, 0x4), 0x4F);
190 /* Gear1 Synclength */
191 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x008B, 0x5), 0x4F);
193 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x000F, 0x0), 0x5);
195 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x000F, 0x1), 0x5);
197 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0xD085, 0x0), 0x1);
198 /* Unipro VS_mphy_disable */
199 ufshcd_dme_get(hba, UIC_ARG_MIB_SEL(0xD0C1, 0x0), &value);
202 "Warring!!! Unipro VS_mphy_disable is 0x%x\n", value);
204 /* Unipro VS_mphy_disable */
205 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0xD0C1, 0x0), 0x0);
206 err = ufs_hisi_check_hibern8(hba);
208 dev_err(hba->dev, "ufs_hisi_check_hibern8 error\n");
210 ufshcd_writel(hba, UFS_HCLKDIV_NORMAL_VALUE, UFS_REG_HCLKDIV);
212 /* disable auto H8 */
213 reg = ufshcd_readl(hba, REG_AUTO_HIBERNATE_IDLE_TIMER);
214 reg = reg & (~UFS_AHIT_AH8ITV_MASK);
215 ufshcd_writel(hba, reg, REG_AUTO_HIBERNATE_IDLE_TIMER);
217 /* Unipro PA_Local_TX_LCC_Enable */
218 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0x155E, 0x0), 0x0);
219 /* close Unipro VS_Mk2ExtnSupport */
220 ufshcd_dme_set(hba, UIC_ARG_MIB_SEL(0xD0AB, 0x0), 0x0);
221 ufshcd_dme_get(hba, UIC_ARG_MIB_SEL(0xD0AB, 0x0), &value);
223 /* Ensure close success */
224 dev_info(hba->dev, "WARN: close VS_Mk2ExtnSupport failed\n");
230 static int ufs_hisi_link_startup_post_change(struct ufs_hba *hba)
232 struct ufs_hisi_host *host = ufshcd_get_variant(hba);
234 /* Unipro DL_AFC0CreditThreshold */
235 ufshcd_dme_set(hba, UIC_ARG_MIB(0x2044), 0x0);
236 /* Unipro DL_TC0OutAckThreshold */
237 ufshcd_dme_set(hba, UIC_ARG_MIB(0x2045), 0x0);
238 /* Unipro DL_TC0TXFCThreshold */
239 ufshcd_dme_set(hba, UIC_ARG_MIB(0x2040), 0x9);
241 /* not bypass ufs clk gate */
242 ufs_sys_ctrl_clr_bits(host, MASK_UFS_CLK_GATE_BYPASS,
244 ufs_sys_ctrl_clr_bits(host, MASK_UFS_SYSCRTL_BYPASS,
247 /* select received symbol cnt */
248 ufshcd_dme_set(hba, UIC_ARG_MIB(0xd09a), 0x80000000);
249 /* reset counter0 and enable */
250 ufshcd_dme_set(hba, UIC_ARG_MIB(0xd09c), 0x00000005);
255 static int ufs_hi3660_link_startup_notify(struct ufs_hba *hba,
256 enum ufs_notify_change_status status)
262 err = ufs_hisi_link_startup_pre_change(hba);
265 err = ufs_hisi_link_startup_post_change(hba);
274 struct ufs_hisi_dev_params {
275 u32 pwm_rx_gear; /* pwm rx gear to work in */
276 u32 pwm_tx_gear; /* pwm tx gear to work in */
277 u32 hs_rx_gear; /* hs rx gear to work in */
278 u32 hs_tx_gear; /* hs tx gear to work in */
279 u32 rx_lanes; /* number of rx lanes */
280 u32 tx_lanes; /* number of tx lanes */
281 u32 rx_pwr_pwm; /* rx pwm working pwr */
282 u32 tx_pwr_pwm; /* tx pwm working pwr */
283 u32 rx_pwr_hs; /* rx hs working pwr */
284 u32 tx_pwr_hs; /* tx hs working pwr */
285 u32 hs_rate; /* rate A/B to work in HS */
286 u32 desired_working_mode;
289 static int ufs_hisi_get_pwr_dev_param(
290 struct ufs_hisi_dev_params *hisi_param,
291 struct ufs_pa_layer_attr *dev_max,
292 struct ufs_pa_layer_attr *agreed_pwr)
296 bool is_dev_sup_hs = false;
297 bool is_hisi_max_hs = false;
299 if (dev_max->pwr_rx == FASTAUTO_MODE || dev_max->pwr_rx == FAST_MODE)
300 is_dev_sup_hs = true;
302 if (hisi_param->desired_working_mode == FAST) {
303 is_hisi_max_hs = true;
304 min_hisi_gear = min_t(u32, hisi_param->hs_rx_gear,
305 hisi_param->hs_tx_gear);
307 min_hisi_gear = min_t(u32, hisi_param->pwm_rx_gear,
308 hisi_param->pwm_tx_gear);
312 * device doesn't support HS but
313 * hisi_param->desired_working_mode is HS,
314 * thus device and hisi_param don't agree
316 if (!is_dev_sup_hs && is_hisi_max_hs) {
317 pr_err("%s: device not support HS\n", __func__);
319 } else if (is_dev_sup_hs && is_hisi_max_hs) {
321 * since device supports HS, it supports FAST_MODE.
322 * since hisi_param->desired_working_mode is also HS
323 * then final decision (FAST/FASTAUTO) is done according
324 * to hisi_params as it is the restricting factor
326 agreed_pwr->pwr_rx = agreed_pwr->pwr_tx =
327 hisi_param->rx_pwr_hs;
330 * here hisi_param->desired_working_mode is PWM.
331 * it doesn't matter whether device supports HS or PWM,
332 * in both cases hisi_param->desired_working_mode will
335 agreed_pwr->pwr_rx = agreed_pwr->pwr_tx =
336 hisi_param->rx_pwr_pwm;
340 * we would like tx to work in the minimum number of lanes
341 * between device capability and vendor preferences.
342 * the same decision will be made for rx
344 agreed_pwr->lane_tx =
345 min_t(u32, dev_max->lane_tx, hisi_param->tx_lanes);
346 agreed_pwr->lane_rx =
347 min_t(u32, dev_max->lane_rx, hisi_param->rx_lanes);
349 /* device maximum gear is the minimum between device rx and tx gears */
350 min_dev_gear = min_t(u32, dev_max->gear_rx, dev_max->gear_tx);
353 * if both device capabilities and vendor pre-defined preferences are
354 * both HS or both PWM then set the minimum gear to be the chosen
356 * if one is PWM and one is HS then the one that is PWM get to decide
357 * what is the gear, as it is the one that also decided previously what
358 * pwr the device will be configured to.
360 if ((is_dev_sup_hs && is_hisi_max_hs) ||
361 (!is_dev_sup_hs && !is_hisi_max_hs))
362 agreed_pwr->gear_rx = agreed_pwr->gear_tx =
363 min_t(u32, min_dev_gear, min_hisi_gear);
365 agreed_pwr->gear_rx = agreed_pwr->gear_tx = min_hisi_gear;
367 agreed_pwr->hs_rate = hisi_param->hs_rate;
369 pr_info("ufs final power mode: gear = %d, lane = %d, pwr = %d, rate = %d\n",
370 agreed_pwr->gear_rx, agreed_pwr->lane_rx, agreed_pwr->pwr_rx,
371 agreed_pwr->hs_rate);
375 static void ufs_hisi_set_dev_cap(struct ufs_hisi_dev_params *hisi_param)
377 hisi_param->rx_lanes = UFS_HISI_LIMIT_NUM_LANES_RX;
378 hisi_param->tx_lanes = UFS_HISI_LIMIT_NUM_LANES_TX;
379 hisi_param->hs_rx_gear = UFS_HISI_LIMIT_HSGEAR_RX;
380 hisi_param->hs_tx_gear = UFS_HISI_LIMIT_HSGEAR_TX;
381 hisi_param->pwm_rx_gear = UFS_HISI_LIMIT_PWMGEAR_RX;
382 hisi_param->pwm_tx_gear = UFS_HISI_LIMIT_PWMGEAR_TX;
383 hisi_param->rx_pwr_pwm = UFS_HISI_LIMIT_RX_PWR_PWM;
384 hisi_param->tx_pwr_pwm = UFS_HISI_LIMIT_TX_PWR_PWM;
385 hisi_param->rx_pwr_hs = UFS_HISI_LIMIT_RX_PWR_HS;
386 hisi_param->tx_pwr_hs = UFS_HISI_LIMIT_TX_PWR_HS;
387 hisi_param->hs_rate = UFS_HISI_LIMIT_HS_RATE;
388 hisi_param->desired_working_mode = UFS_HISI_LIMIT_DESIRED_MODE;
391 static void ufs_hisi_pwr_change_pre_change(struct ufs_hba *hba)
394 ufshcd_dme_set(hba, UIC_ARG_MIB(0x15A8), 0x1);
396 ufshcd_dme_set(hba, UIC_ARG_MIB(0x155c), 0x0);
397 /*PA_PWRModeUserData0 = 8191, default is 0*/
398 ufshcd_dme_set(hba, UIC_ARG_MIB(0x15b0), 8191);
399 /*PA_PWRModeUserData1 = 65535, default is 0*/
400 ufshcd_dme_set(hba, UIC_ARG_MIB(0x15b1), 65535);
401 /*PA_PWRModeUserData2 = 32767, default is 0*/
402 ufshcd_dme_set(hba, UIC_ARG_MIB(0x15b2), 32767);
403 /*DME_FC0ProtectionTimeOutVal = 8191, default is 0*/
404 ufshcd_dme_set(hba, UIC_ARG_MIB(0xd041), 8191);
405 /*DME_TC0ReplayTimeOutVal = 65535, default is 0*/
406 ufshcd_dme_set(hba, UIC_ARG_MIB(0xd042), 65535);
407 /*DME_AFC0ReqTimeOutVal = 32767, default is 0*/
408 ufshcd_dme_set(hba, UIC_ARG_MIB(0xd043), 32767);
409 /*PA_PWRModeUserData3 = 8191, default is 0*/
410 ufshcd_dme_set(hba, UIC_ARG_MIB(0x15b3), 8191);
411 /*PA_PWRModeUserData4 = 65535, default is 0*/
412 ufshcd_dme_set(hba, UIC_ARG_MIB(0x15b4), 65535);
413 /*PA_PWRModeUserData5 = 32767, default is 0*/
414 ufshcd_dme_set(hba, UIC_ARG_MIB(0x15b5), 32767);
415 /*DME_FC1ProtectionTimeOutVal = 8191, default is 0*/
416 ufshcd_dme_set(hba, UIC_ARG_MIB(0xd044), 8191);
417 /*DME_TC1ReplayTimeOutVal = 65535, default is 0*/
418 ufshcd_dme_set(hba, UIC_ARG_MIB(0xd045), 65535);
419 /*DME_AFC1ReqTimeOutVal = 32767, default is 0*/
420 ufshcd_dme_set(hba, UIC_ARG_MIB(0xd046), 32767);
423 static int ufs_hi3660_pwr_change_notify(struct ufs_hba *hba,
424 enum ufs_notify_change_status status,
425 struct ufs_pa_layer_attr *dev_max_params,
426 struct ufs_pa_layer_attr *dev_req_params)
428 struct ufs_hisi_dev_params ufs_hisi_cap;
431 if (!dev_req_params) {
433 "%s: incoming dev_req_params is NULL\n", __func__);
440 ufs_hisi_set_dev_cap(&ufs_hisi_cap);
441 ret = ufs_hisi_get_pwr_dev_param(
442 &ufs_hisi_cap, dev_max_params, dev_req_params);
445 "%s: failed to determine capabilities\n", __func__);
449 ufs_hisi_pwr_change_pre_change(hba);
461 static int ufs_hisi_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
463 struct ufs_hisi_host *host = ufshcd_get_variant(hba);
465 if (ufshcd_is_runtime_pm(pm_op))
468 if (host->in_suspend) {
473 ufs_sys_ctrl_clr_bits(host, BIT_SYSCTRL_REF_CLOCK_EN, PHY_CLK_CTRL);
475 /* set ref_dig_clk override of PHY PCS to 0 */
476 ufs_sys_ctrl_writel(host, 0x00100000, UFS_DEVICE_RESET_CTRL);
478 host->in_suspend = true;
483 static int ufs_hisi_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
485 struct ufs_hisi_host *host = ufshcd_get_variant(hba);
487 if (!host->in_suspend)
490 /* set ref_dig_clk override of PHY PCS to 1 */
491 ufs_sys_ctrl_writel(host, 0x00100010, UFS_DEVICE_RESET_CTRL);
493 ufs_sys_ctrl_set_bits(host, BIT_SYSCTRL_REF_CLOCK_EN, PHY_CLK_CTRL);
495 host->in_suspend = false;
499 static int ufs_hisi_get_resource(struct ufs_hisi_host *host)
501 struct resource *mem_res;
502 struct device *dev = host->hba->dev;
503 struct platform_device *pdev = to_platform_device(dev);
505 /* get resource of ufs sys ctrl */
506 mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
507 host->ufs_sys_ctrl = devm_ioremap_resource(dev, mem_res);
508 if (IS_ERR(host->ufs_sys_ctrl))
509 return PTR_ERR(host->ufs_sys_ctrl);
514 static void ufs_hisi_set_pm_lvl(struct ufs_hba *hba)
516 hba->rpm_lvl = UFS_PM_LVL_1;
517 hba->spm_lvl = UFS_PM_LVL_3;
521 * ufs_hisi_init_common
522 * @hba: host controller instance
524 static int ufs_hisi_init_common(struct ufs_hba *hba)
527 struct device *dev = hba->dev;
528 struct ufs_hisi_host *host;
530 host = devm_kzalloc(dev, sizeof(*host), GFP_KERNEL);
535 ufshcd_set_variant(hba, host);
537 host->rst = devm_reset_control_get(dev, "rst");
539 ufs_hisi_set_pm_lvl(hba);
541 err = ufs_hisi_get_resource(host);
543 ufshcd_set_variant(hba, NULL);
550 static int ufs_hi3660_init(struct ufs_hba *hba)
553 struct device *dev = hba->dev;
555 ret = ufs_hisi_init_common(hba);
557 dev_err(dev, "%s: ufs common init fail\n", __func__);
561 ufs_hi3660_clk_init(hba);
563 ufs_hi3660_soc_init(hba);
568 static struct ufs_hba_variant_ops ufs_hba_hisi_vops = {
570 .init = ufs_hi3660_init,
571 .link_startup_notify = ufs_hi3660_link_startup_notify,
572 .pwr_change_notify = ufs_hi3660_pwr_change_notify,
573 .suspend = ufs_hisi_suspend,
574 .resume = ufs_hisi_resume,
577 static int ufs_hisi_probe(struct platform_device *pdev)
579 return ufshcd_pltfrm_init(pdev, &ufs_hba_hisi_vops);
582 static int ufs_hisi_remove(struct platform_device *pdev)
584 struct ufs_hba *hba = platform_get_drvdata(pdev);
590 static const struct of_device_id ufs_hisi_of_match[] = {
591 { .compatible = "hisilicon,hi3660-ufs" },
595 MODULE_DEVICE_TABLE(of, ufs_hisi_of_match);
597 static const struct dev_pm_ops ufs_hisi_pm_ops = {
598 .suspend = ufshcd_pltfrm_suspend,
599 .resume = ufshcd_pltfrm_resume,
600 .runtime_suspend = ufshcd_pltfrm_runtime_suspend,
601 .runtime_resume = ufshcd_pltfrm_runtime_resume,
602 .runtime_idle = ufshcd_pltfrm_runtime_idle,
605 static struct platform_driver ufs_hisi_pltform = {
606 .probe = ufs_hisi_probe,
607 .remove = ufs_hisi_remove,
608 .shutdown = ufshcd_pltfrm_shutdown,
610 .name = "ufshcd-hisi",
611 .pm = &ufs_hisi_pm_ops,
612 .of_match_table = of_match_ptr(ufs_hisi_of_match),
615 module_platform_driver(ufs_hisi_pltform);
617 MODULE_LICENSE("GPL");
618 MODULE_ALIAS("platform:ufshcd-hisi");
619 MODULE_DESCRIPTION("HiSilicon Hixxxx UFS Driver");