| /kernel/linux/linux-4.19/drivers/gpu/drm/msm/dsi/phy/ |
| D | dsi_phy.c | 18 #define S_DIV_ROUND_UP(n, d) \ argument 19 (((n) >= 0) ? (((n) + (d) - 1) / (d)) : (((n) - (d) + 1) / (d))) 26 v = (tmax - tmin) * percent; in linear_inter() 29 return max_t(s32, min_result, v - 1); in linear_inter() 41 temp = 300 * coeff - ((timing->clk_prepare >> 1) + 1) * 2 * ui; in dsi_dphy_timing_calc_clk_zero() 42 tmin = S_DIV_ROUND_UP(temp, ui) - 2; in dsi_dphy_timing_calc_clk_zero() 52 temp = (timing->hs_rqst + timing->clk_prepare + clk_z) & 0x7; in dsi_dphy_timing_calc_clk_zero() 53 timing->clk_zero = clk_z + 8 - temp; in dsi_dphy_timing_calc_clk_zero() 59 const unsigned long bit_rate = clk_req->bitclk_rate; in msm_dsi_dphy_timing_calc() 60 const unsigned long esc_rate = clk_req->escclk_rate; in msm_dsi_dphy_timing_calc() [all …]
|
| /kernel/linux/linux-5.10/drivers/gpu/drm/msm/dsi/phy/ |
| D | dsi_phy.c | 1 // SPDX-License-Identifier: GPL-2.0-only 10 #define S_DIV_ROUND_UP(n, d) \ argument 11 (((n) >= 0) ? (((n) + (d) - 1) / (d)) : (((n) - (d) + 1) / (d))) 18 v = (tmax - tmin) * percent; in linear_inter() 21 return max_t(s32, min_result, v - 1); in linear_inter() 33 temp = 300 * coeff - ((timing->clk_prepare >> 1) + 1) * 2 * ui; in dsi_dphy_timing_calc_clk_zero() 34 tmin = S_DIV_ROUND_UP(temp, ui) - 2; in dsi_dphy_timing_calc_clk_zero() 44 temp = (timing->hs_rqst + timing->clk_prepare + clk_z) & 0x7; in dsi_dphy_timing_calc_clk_zero() 45 timing->clk_zero = clk_z + 8 - temp; in dsi_dphy_timing_calc_clk_zero() 51 const unsigned long bit_rate = clk_req->bitclk_rate; in msm_dsi_dphy_timing_calc() [all …]
|
| /kernel/linux/linux-5.10/drivers/scsi/libsas/ |
| D | sas_init.c | 1 // SPDX-License-Identifier: GPL-2.0-only 32 spin_lock_init(&task->task_state_lock); in sas_alloc_task() 33 task->task_state_flags = SAS_TASK_STATE_PENDING; in sas_alloc_task() 52 task->slow_task = slow; in sas_alloc_slow_task() 53 slow->task = task; in sas_alloc_slow_task() 54 timer_setup(&slow->timer, NULL, 0); in sas_alloc_slow_task() 55 init_completion(&slow->completion); in sas_alloc_slow_task() 64 kfree(task->slow_task); in sas_free_task() 70 /*------------ SAS addr hash -----------*/ 80 for (b = (SAS_ADDR_SIZE - 1); b >= 0; b--) { in sas_hash_addr() [all …]
|
| /kernel/linux/linux-4.19/drivers/scsi/libsas/ |
| D | sas_init.c | 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 49 spin_lock_init(&task->task_state_lock); in sas_alloc_task() 50 task->task_state_flags = SAS_TASK_STATE_PENDING; in sas_alloc_task() 69 task->slow_task = slow; in sas_alloc_slow_task() 70 slow->task = task; in sas_alloc_slow_task() 71 timer_setup(&slow->timer, NULL, 0); in sas_alloc_slow_task() 72 init_completion(&slow->completion); in sas_alloc_slow_task() 81 kfree(task->slow_task); in sas_free_task() 87 /*------------ SAS addr hash -----------*/ 96 for (b = 7; b >= 0; b--) { in sas_hash_addr() [all …]
|
| /kernel/linux/linux-4.19/drivers/scsi/aic94xx/ |
| D | aic94xx_scb.c | 23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 37 /* ---------- EMPTY SCB ---------- */ 54 static void get_lrate_mode(struct asd_phy *phy, u8 oob_mode) in get_lrate_mode() argument 56 struct sas_phy *sas_phy = phy->sas_phy.phy; in get_lrate_mode() 61 phy->sas_phy.linkrate = SAS_LINK_RATE_6_0_GBPS; in get_lrate_mode() 62 phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_6_0_GBPS; in get_lrate_mode() 65 phy->sas_phy.linkrate = SAS_LINK_RATE_3_0_GBPS; in get_lrate_mode() 66 phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_3_0_GBPS; in get_lrate_mode() 69 phy->sas_phy.linkrate = SAS_LINK_RATE_1_5_GBPS; in get_lrate_mode() 70 phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_1_5_GBPS; in get_lrate_mode() [all …]
|
| /kernel/linux/linux-5.10/drivers/nfc/ |
| D | mei_phy.c | 1 // SPDX-License-Identifier: GPL-2.0 74 16, 1, (skb)->data, (skb)->len, false); \ 81 16, 1, (skb)->data, (skb)->len, false); \ 87 pr_debug("cmd=%02d status=%d req_id=%d rsvd=%d size=%d\n", \ 88 (_hdr)->cmd, (_hdr)->status, (_hdr)->req_id, \ 89 (_hdr)->reserved, (_hdr)->data_size); \ 92 static int mei_nfc_if_version(struct nfc_mei_phy *phy) in mei_nfc_if_version() argument 109 r = mei_cldev_send(phy->cldev, (u8 *)&cmd, sizeof(struct mei_nfc_cmd)); in mei_nfc_if_version() 121 return -ENOMEM; in mei_nfc_if_version() 123 bytes_recv = mei_cldev_recv(phy->cldev, (u8 *)reply, if_version_length); in mei_nfc_if_version() [all …]
|
| /kernel/linux/linux-5.10/drivers/scsi/aic94xx/ |
| D | aic94xx_scb.c | 1 // SPDX-License-Identifier: GPL-2.0-only 19 /* ---------- EMPTY SCB ---------- */ 36 static void get_lrate_mode(struct asd_phy *phy, u8 oob_mode) in get_lrate_mode() argument 38 struct sas_phy *sas_phy = phy->sas_phy.phy; in get_lrate_mode() 43 phy->sas_phy.linkrate = SAS_LINK_RATE_6_0_GBPS; in get_lrate_mode() 44 phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_6_0_GBPS; in get_lrate_mode() 47 phy->sas_phy.linkrate = SAS_LINK_RATE_3_0_GBPS; in get_lrate_mode() 48 phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_3_0_GBPS; in get_lrate_mode() 51 phy->sas_phy.linkrate = SAS_LINK_RATE_1_5_GBPS; in get_lrate_mode() 52 phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_1_5_GBPS; in get_lrate_mode() [all …]
|
| /kernel/linux/linux-4.19/drivers/nfc/ |
| D | mei_phy.c | 86 16, 1, (skb)->data, (skb)->len, false); \ 93 16, 1, (skb)->data, (skb)->len, false); \ 99 pr_debug("cmd=%02d status=%d req_id=%d rsvd=%d size=%d\n", \ 100 (_hdr)->cmd, (_hdr)->status, (_hdr)->req_id, \ 101 (_hdr)->reserved, (_hdr)->data_size); \ 104 static int mei_nfc_if_version(struct nfc_mei_phy *phy) in mei_nfc_if_version() argument 121 r = mei_cldev_send(phy->cldev, (u8 *)&cmd, sizeof(struct mei_nfc_cmd)); in mei_nfc_if_version() 133 return -ENOMEM; in mei_nfc_if_version() 135 bytes_recv = mei_cldev_recv(phy->cldev, (u8 *)reply, if_version_length); in mei_nfc_if_version() 138 r = -EIO; in mei_nfc_if_version() [all …]
|
| /kernel/linux/linux-4.19/drivers/phy/qualcomm/ |
| D | phy-qcom-ufs.c | 2 * Copyright (c) 2013-2015, Linux Foundation. All rights reserved. 15 #include "phy-qcom-ufs-i.h" 35 dev_err(ufs_qcom_phy->dev, "%s: tbl_A is NULL", __func__); in ufs_qcom_phy_calibrate() 42 ufs_qcom_phy->mmio + tbl_A[i].reg_offset); in ufs_qcom_phy_calibrate() 52 dev_err(ufs_qcom_phy->dev, "%s: tbl_B is NULL", in ufs_qcom_phy_calibrate() 60 ufs_qcom_phy->mmio + tbl_B[i].reg_offset); in ufs_qcom_phy_calibrate() 72 * This assumes the embedded phy structure inside generic_phy is of type 77 struct ufs_qcom_phy *get_ufs_qcom_phy(struct phy *generic_phy) in get_ufs_qcom_phy() 87 struct device *dev = &pdev->dev; in ufs_qcom_phy_base_init() 92 phy_common->mmio = devm_ioremap_resource(dev, res); in ufs_qcom_phy_base_init() [all …]
|
| /kernel/linux/linux-5.10/drivers/net/wireless/broadcom/b43/ |
| D | lo.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 6 G PHY LO (LocalOscillator) Measuring and Control routines 8 Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>, 10 Copyright (c) 2005-2007 Michael Buesch <m@bues.ch> 33 list_for_each_entry(c, &lo->calib_list, list) { in b43_find_lo_calib() 34 if (!b43_compare_bbatt(&c->bbatt, bbatt)) in b43_find_lo_calib() 36 if (!b43_compare_rfatt(&c->rfatt, rfatt)) in b43_find_lo_calib() 44 /* Write the LocalOscillator Control (adjust) value-pair. */ 47 struct b43_phy *phy = &dev->phy; in b43_lo_write() local 51 if (unlikely(abs(control->i) > 16 || abs(control->q) > 16)) { in b43_lo_write() [all …]
|
| /kernel/linux/linux-4.19/drivers/net/wireless/broadcom/b43/ |
| D | lo.c | 5 G PHY LO (LocalOscillator) Measuring and Control routines 7 Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>, 9 Copyright (c) 2005-2007 Michael Buesch <m@bues.ch> 26 Boston, MA 02110-1301, USA. 46 list_for_each_entry(c, &lo->calib_list, list) { in b43_find_lo_calib() 47 if (!b43_compare_bbatt(&c->bbatt, bbatt)) in b43_find_lo_calib() 49 if (!b43_compare_rfatt(&c->rfatt, rfatt)) in b43_find_lo_calib() 57 /* Write the LocalOscillator Control (adjust) value-pair. */ 60 struct b43_phy *phy = &dev->phy; in b43_lo_write() local 64 if (unlikely(abs(control->i) > 16 || abs(control->q) > 16)) { in b43_lo_write() [all …]
|
| /kernel/linux/linux-4.19/drivers/dma/ |
| D | zx_dma.c | 11 #include <linux/dma-mapping.h> 25 #include "virt-dma.h" 27 #define DRIVER_NAME "zx-dma" 29 #define DMA_MAX_SIZE (0x10000 - 512) 102 int id; /* Request phy chan id */ 106 struct zx_dma_phy *phy; member 123 spinlock_t lock; /* lock for ch and phy */ 125 struct zx_dma_phy *phy; member 141 static void zx_dma_terminate_chan(struct zx_dma_phy *phy, struct zx_dma_dev *d) in zx_dma_terminate_chan() argument 145 val = readl_relaxed(phy->base + REG_ZX_CTRL); in zx_dma_terminate_chan() [all …]
|
| D | k3dma.c | 2 * Copyright (c) 2013 - 2015 Linaro Ltd. 11 #include <linux/dma-mapping.h> 26 #include "virt-dma.h" 28 #define DRIVER_NAME "k3-dma" 88 struct k3_dma_phy *phy; member 110 struct k3_dma_phy *phy; member 126 static void k3_dma_pause_dma(struct k3_dma_phy *phy, bool on) in k3_dma_pause_dma() argument 131 val = readl_relaxed(phy->base + CX_CFG); in k3_dma_pause_dma() 133 writel_relaxed(val, phy->base + CX_CFG); in k3_dma_pause_dma() 135 val = readl_relaxed(phy->base + CX_CFG); in k3_dma_pause_dma() [all …]
|
| /kernel/linux/linux-5.10/drivers/dma/ |
| D | zx_dma.c | 1 // SPDX-License-Identifier: GPL-2.0-only 8 #include <linux/dma-mapping.h> 22 #include "virt-dma.h" 24 #define DRIVER_NAME "zx-dma" 26 #define DMA_MAX_SIZE (0x10000 - 512) 99 int id; /* Request phy chan id */ 103 struct zx_dma_phy *phy; member 120 spinlock_t lock; /* lock for ch and phy */ 122 struct zx_dma_phy *phy; member 138 static void zx_dma_terminate_chan(struct zx_dma_phy *phy, struct zx_dma_dev *d) in zx_dma_terminate_chan() argument [all …]
|
| D | k3dma.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (c) 2013 - 2015 Linaro Ltd. 8 #include <linux/dma-mapping.h> 23 #include "virt-dma.h" 25 #define DRIVER_NAME "k3-dma" 83 struct k3_dma_phy *phy; member 105 struct k3_dma_phy *phy; member 134 static void k3_dma_pause_dma(struct k3_dma_phy *phy, bool on) in k3_dma_pause_dma() argument 139 val = readl_relaxed(phy->base + CX_CFG); in k3_dma_pause_dma() 141 writel_relaxed(val, phy->base + CX_CFG); in k3_dma_pause_dma() [all …]
|
| /kernel/linux/linux-5.10/drivers/phy/freescale/ |
| D | phy-fsl-imx8-mipi-dphy.c | 1 // SPDX-License-Identifier: GPL-2.0+ 8 #include <linux/clk-provider.h> 15 #include <linux/phy/phy.h> 47 ((x) < 32) ? 0xe0 | ((x) - 16) : \ 48 ((x) < 64) ? 0xc0 | ((x) - 32) : \ 49 ((x) < 128) ? 0x80 | ((x) - 64) : \ 50 ((x) - 128)) 51 #define CN(x) (((x) == 1) ? 0x1f : (((CN_BUF) >> ((x) - 1)) & 0x1f)) 52 #define CO(x) ((CO_BUF) >> (8 - (x)) & 0x03) 54 /* PHY power on is active low */ [all …]
|
| /kernel/linux/linux-5.10/drivers/phy/intel/ |
| D | phy-intel-keembay-emmc.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Intel Keem Bay eMMC PHY driver 14 #include <linux/phy/phy.h> 18 /* eMMC/SD/SDIO core/phy configuration registers */ 53 static int keembay_emmc_phy_power(struct phy *phy, bool on_off) in keembay_emmc_phy_power() argument 55 struct keembay_emmc_phy *priv = phy_get_drvdata(phy); in keembay_emmc_phy_power() 66 ret = regmap_update_bits(priv->syscfg, PHY_CFG_0, PWR_DOWN_MASK, in keembay_emmc_phy_power() 69 dev_err(&phy->dev, "CALIO power down bar failed: %d\n", ret); in keembay_emmc_phy_power() 73 ret = regmap_update_bits(priv->syscfg, PHY_CFG_0, DLL_EN_MASK, in keembay_emmc_phy_power() 76 dev_err(&phy->dev, "turn off the dll failed: %d\n", ret); in keembay_emmc_phy_power() [all …]
|
| D | phy-intel-lgm-emmc.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Intel eMMC PHY driver 14 #include <linux/phy/phy.h> 18 /* eMMC phy register definitions */ 51 static int intel_emmc_phy_power(struct phy *phy, bool on_off) in intel_emmc_phy_power() argument 53 struct intel_emmc_phy *priv = phy_get_drvdata(phy); in intel_emmc_phy_power() 64 ret = regmap_update_bits(priv->syscfg, EMMC_PHYCTRL1_REG, PDB_MASK, in intel_emmc_phy_power() 67 dev_err(&phy->dev, "CALIO power down bar failed: %d\n", ret); in intel_emmc_phy_power() 75 rate = clk_get_rate(priv->emmcclk); in intel_emmc_phy_power() 78 dev_warn(&phy->dev, "Unsupported rate: %lu\n", rate); in intel_emmc_phy_power() [all …]
|
| /kernel/linux/linux-5.10/drivers/scsi/mpt3sas/ |
| D | mpt3sas_transport.c | 5 * Copyright (C) 2012-2014 LSI Corporation 6 * Copyright (C) 2013-2014 Avago Technologies 7 * (mailto: MPT-FusionLinux.pdl@avagotech.com) 22 * LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, 41 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 64 * _transport_sas_node_find_by_sas_address - sas node search 67 * Context: Calling function should acquire ioc->sas_node_lock. 76 if (ioc->sas_hba.sas_address == sas_address) in _transport_sas_node_find_by_sas_address() 77 return &ioc->sas_hba; in _transport_sas_node_find_by_sas_address() 84 * _transport_convert_phy_link_rate - [all …]
|
| /kernel/linux/linux-4.19/drivers/usb/phy/ |
| D | phy-tegra-usb.c | 1 // SPDX-License-Identifier: GPL-2.0 197 static void set_pts(struct tegra_usb_phy *phy, u8 pts_val) in set_pts() argument 199 void __iomem *base = phy->regs; in set_pts() 202 if (phy->soc_config->has_hostpc) { in set_pts() 215 static void set_phcd(struct tegra_usb_phy *phy, bool enable) in set_phcd() argument 217 void __iomem *base = phy->regs; in set_phcd() 220 if (phy->soc_config->has_hostpc) { in set_phcd() 237 static int utmip_pad_open(struct tegra_usb_phy *phy) in utmip_pad_open() argument 241 phy->pad_clk = devm_clk_get(phy->u_phy.dev, "utmi-pads"); in utmip_pad_open() 242 if (IS_ERR(phy->pad_clk)) { in utmip_pad_open() [all …]
|
| /kernel/linux/linux-4.19/drivers/scsi/mpt3sas/ |
| D | mpt3sas_transport.c | 5 * Copyright (C) 2012-2014 LSI Corporation 6 * Copyright (C) 2013-2014 Avago Technologies 7 * (mailto: MPT-FusionLinux.pdl@avagotech.com) 22 * LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, 41 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 64 * _transport_sas_node_find_by_sas_address - sas node search 67 * Context: Calling function should acquire ioc->sas_node_lock. 76 if (ioc->sas_hba.sas_address == sas_address) in _transport_sas_node_find_by_sas_address() 77 return &ioc->sas_hba; in _transport_sas_node_find_by_sas_address() 84 * _transport_convert_phy_link_rate - [all …]
|
| /kernel/linux/linux-5.10/drivers/phy/mediatek/ |
| D | phy-mtk-xsphy.c | 1 // SPDX-License-Identifier: GPL-2.0 10 #include <dt-bindings/phy/phy.h> 17 #include <linux/phy/phy.h> 20 /* u2 phy banks */ 25 /* u3 phy shared banks */ 29 /* u3 phy banks */ 92 struct phy *phy; member 94 struct clk *ref_clk; /* reference clock of anolog phy */ 119 void __iomem *pbase = inst->port_base; in u2_phy_slew_rate_calibrate() 125 if (inst->eye_src) in u2_phy_slew_rate_calibrate() [all …]
|
| /kernel/linux/linux-4.19/drivers/phy/mediatek/ |
| D | phy-mtk-xsphy.c | 1 // SPDX-License-Identifier: GPL-2.0 10 #include <dt-bindings/phy/phy.h> 17 #include <linux/phy/phy.h> 20 /* u2 phy banks */ 25 /* u3 phy shared banks */ 29 /* u3 phy banks */ 92 struct phy *phy; member 94 struct clk *ref_clk; /* reference clock of anolog phy */ 119 void __iomem *pbase = inst->port_base; in u2_phy_slew_rate_calibrate() 125 if (inst->eye_src) in u2_phy_slew_rate_calibrate() [all …]
|
| /kernel/linux/linux-4.19/drivers/net/ethernet/chelsio/cxgb3/ |
| D | aq100x.c | 2 * Copyright (c) 2005-2008 Chelsio, Inc. All rights reserved. 14 * - Redistributions of source code must retain the above 18 * - Redistributions in binary form must reproduce the above 65 static int aq100x_reset(struct cphy *phy, int wait) in aq100x_reset() argument 71 int err = t3_phy_reset(phy, MDIO_MMD_VEND1, 3000); in aq100x_reset() 74 CH_WARN(phy->adapter, "PHY%d: reset failed (0x%x).\n", in aq100x_reset() 75 phy->mdio.prtad, err); in aq100x_reset() 80 static int aq100x_intr_enable(struct cphy *phy) in aq100x_intr_enable() argument 82 int err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, AQ_IMASK_PMA, IMASK_PMA); in aq100x_intr_enable() 86 err = t3_mdio_write(phy, MDIO_MMD_VEND1, AQ_IMASK_GLOBAL, IMASK_GLOBAL); in aq100x_intr_enable() [all …]
|
| /kernel/linux/linux-5.10/drivers/net/ethernet/chelsio/cxgb3/ |
| D | aq100x.c | 2 * Copyright (c) 2005-2008 Chelsio, Inc. All rights reserved. 14 * - Redistributions of source code must retain the above 18 * - Redistributions in binary form must reproduce the above 65 static int aq100x_reset(struct cphy *phy, int wait) in aq100x_reset() argument 71 int err = t3_phy_reset(phy, MDIO_MMD_VEND1, 3000); in aq100x_reset() 74 CH_WARN(phy->adapter, "PHY%d: reset failed (0x%x).\n", in aq100x_reset() 75 phy->mdio.prtad, err); in aq100x_reset() 80 static int aq100x_intr_enable(struct cphy *phy) in aq100x_intr_enable() argument 82 int err = t3_mdio_write(phy, MDIO_MMD_PMAPMD, AQ_IMASK_PMA, IMASK_PMA); in aq100x_intr_enable() 86 err = t3_mdio_write(phy, MDIO_MMD_VEND1, AQ_IMASK_GLOBAL, IMASK_GLOBAL); in aq100x_intr_enable() [all …]
|