18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
38c2ecf20Sopenharmony_ci */
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#ifndef UFSHCD_PLTFRM_H_
68c2ecf20Sopenharmony_ci#define UFSHCD_PLTFRM_H_
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#include "ufshcd.h"
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#define UFS_PWM_MODE 1
118c2ecf20Sopenharmony_ci#define UFS_HS_MODE  2
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_cistruct ufs_dev_params {
148c2ecf20Sopenharmony_ci	u32 pwm_rx_gear;        /* pwm rx gear to work in */
158c2ecf20Sopenharmony_ci	u32 pwm_tx_gear;        /* pwm tx gear to work in */
168c2ecf20Sopenharmony_ci	u32 hs_rx_gear;         /* hs rx gear to work in */
178c2ecf20Sopenharmony_ci	u32 hs_tx_gear;         /* hs tx gear to work in */
188c2ecf20Sopenharmony_ci	u32 rx_lanes;           /* number of rx lanes */
198c2ecf20Sopenharmony_ci	u32 tx_lanes;           /* number of tx lanes */
208c2ecf20Sopenharmony_ci	u32 rx_pwr_pwm;         /* rx pwm working pwr */
218c2ecf20Sopenharmony_ci	u32 tx_pwr_pwm;         /* tx pwm working pwr */
228c2ecf20Sopenharmony_ci	u32 rx_pwr_hs;          /* rx hs working pwr */
238c2ecf20Sopenharmony_ci	u32 tx_pwr_hs;          /* tx hs working pwr */
248c2ecf20Sopenharmony_ci	u32 hs_rate;            /* rate A/B to work in HS */
258c2ecf20Sopenharmony_ci	u32 desired_working_mode;
268c2ecf20Sopenharmony_ci};
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ciint ufshcd_get_pwr_dev_param(struct ufs_dev_params *dev_param,
298c2ecf20Sopenharmony_ci			     struct ufs_pa_layer_attr *dev_max,
308c2ecf20Sopenharmony_ci			     struct ufs_pa_layer_attr *agreed_pwr);
318c2ecf20Sopenharmony_ciint ufshcd_pltfrm_init(struct platform_device *pdev,
328c2ecf20Sopenharmony_ci		       const struct ufs_hba_variant_ops *vops);
338c2ecf20Sopenharmony_civoid ufshcd_pltfrm_shutdown(struct platform_device *pdev);
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#ifdef CONFIG_PM
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ciint ufshcd_pltfrm_suspend(struct device *dev);
388c2ecf20Sopenharmony_ciint ufshcd_pltfrm_resume(struct device *dev);
398c2ecf20Sopenharmony_ciint ufshcd_pltfrm_runtime_suspend(struct device *dev);
408c2ecf20Sopenharmony_ciint ufshcd_pltfrm_runtime_resume(struct device *dev);
418c2ecf20Sopenharmony_ciint ufshcd_pltfrm_runtime_idle(struct device *dev);
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci#else /* !CONFIG_PM */
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci#define ufshcd_pltfrm_suspend	NULL
468c2ecf20Sopenharmony_ci#define ufshcd_pltfrm_resume	NULL
478c2ecf20Sopenharmony_ci#define ufshcd_pltfrm_runtime_suspend	NULL
488c2ecf20Sopenharmony_ci#define ufshcd_pltfrm_runtime_resume	NULL
498c2ecf20Sopenharmony_ci#define ufshcd_pltfrm_runtime_idle	NULL
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci#endif /* CONFIG_PM */
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci#endif /* UFSHCD_PLTFRM_H_ */
54