// SPDX-License-Identifier: GPL-2.0 /* * Platform UFS Host driver for Cadence controller * * Copyright (C) 2018 Cadence Design Systems, Inc. * * Authors: * Jan Kotas <[email protected]> * */ #include <linux/clk.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/time.h> #include "ufshcd-pltfrm.h" #define CDNS_UFS_REG_HCLKDIV … #define CDNS_UFS_REG_PHY_XCFGD1 … #define CDNS_UFS_MAX_L4_ATTRS … struct cdns_ufs_host { … }; /** * cdns_ufs_get_l4_attr - get L4 attributes on local side * @hba: per adapter instance * */ static void cdns_ufs_get_l4_attr(struct ufs_hba *hba) { … } /** * cdns_ufs_set_l4_attr - set L4 attributes on local side * @hba: per adapter instance * */ static void cdns_ufs_set_l4_attr(struct ufs_hba *hba) { … } /** * cdns_ufs_set_hclkdiv() - set HCLKDIV register value based on the core_clk. * @hba: host controller instance * * Return: zero for success and non-zero for failure. */ static int cdns_ufs_set_hclkdiv(struct ufs_hba *hba) { … } /** * cdns_ufs_hce_enable_notify() - set HCLKDIV register * @hba: host controller instance * @status: notify stage (pre, post change) * * Return: zero for success and non-zero for failure. */ static int cdns_ufs_hce_enable_notify(struct ufs_hba *hba, enum ufs_notify_change_status status) { … } /** * cdns_ufs_hibern8_notify() - save and restore L4 attributes. * @hba: host controller instance * @cmd: UIC Command * @status: notify stage (pre, post change) */ static void cdns_ufs_hibern8_notify(struct ufs_hba *hba, enum uic_cmd_dme cmd, enum ufs_notify_change_status status) { … } /** * cdns_ufs_link_startup_notify() - handle link startup. * @hba: host controller instance * @status: notify stage (pre, post change) * * Return: zero for success and non-zero for failure. */ static int cdns_ufs_link_startup_notify(struct ufs_hba *hba, enum ufs_notify_change_status status) { … } /** * cdns_ufs_init - performs additional ufs initialization * @hba: host controller instance * * Return: status of initialization. */ static int cdns_ufs_init(struct ufs_hba *hba) { … } /** * cdns_ufs_m31_16nm_phy_initialization - performs m31 phy initialization * @hba: host controller instance * * Return: 0 (success). */ static int cdns_ufs_m31_16nm_phy_initialization(struct ufs_hba *hba) { … } static const struct ufs_hba_variant_ops cdns_ufs_pltfm_hba_vops = …; static const struct ufs_hba_variant_ops cdns_ufs_m31_16nm_pltfm_hba_vops = …; static const struct of_device_id cdns_ufs_of_match[] = …; MODULE_DEVICE_TABLE(of, cdns_ufs_of_match); /** * cdns_ufs_pltfrm_probe - probe routine of the driver * @pdev: pointer to platform device handle * * Return: zero for success and non-zero for failure. */ static int cdns_ufs_pltfrm_probe(struct platform_device *pdev) { … } /** * cdns_ufs_pltfrm_remove - removes the ufs driver * @pdev: pointer to platform device handle * * Return: 0 (success). */ static void cdns_ufs_pltfrm_remove(struct platform_device *pdev) { … } static const struct dev_pm_ops cdns_ufs_dev_pm_ops = …; static struct platform_driver cdns_ufs_pltfrm_driver = …; module_platform_driver(…) …; MODULE_AUTHOR(…) …; MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …;