/linux/drivers/macintosh/ |
H A D | windfarm_pid.c | 1 // SPDX-License-Identifier: GPL-2.0-only 28 st->param = *param; in wf_pid_init() 29 st->first = 1; in wf_pid_init() 37 int i, hlen = st->param.history_len; in wf_pid_run() 40 error = new_sample - st->param.itarget; in wf_pid_run() 43 if (st->first) { in wf_pid_run() 45 st->samples[i] = new_sample; in wf_pid_run() 46 st->errors[i] = error; in wf_pid_run() 48 st->first = 0; in wf_pid_run() 49 st->index = 0; in wf_pid_run() [all …]
|
/linux/drivers/ptp/ |
H A D | ptp_mock.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 5 * Mock-up PTP Hardware Clock driver for virtual network devices 15 /* Clamp scaled_ppm between -2,097,152,000 and 2,097,152,000, 16 * and thus "adj" between -68,719,476 and 68,719,476 29 * 64-bit overflow during the multiplication with cc->mult, given the max "adj" 52 s64 adj; in mock_phc_adjfine() local 54 adj = (s64)scaled_ppm << MOCK_PHC_FADJ_SHIFT; in mock_phc_adjfine() 55 adj = div_s64(adj, MOCK_PHC_FADJ_DENOMINATOR); in mock_phc_adjfine() 57 spin_lock(&phc->lock); in mock_phc_adjfine() 58 timecounter_read(&phc->tc); in mock_phc_adjfine() [all …]
|
H A D | ptp_qoriq.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 26 /* Caller must hold ptp_qoriq->lock. */ 29 struct ptp_qoriq_registers *regs = &ptp_qoriq->regs; in tmr_cnt_read() 33 lo = ptp_qoriq->read(®s->ctrl_regs->tmr_cnt_l); in tmr_cnt_read() 34 hi = ptp_qoriq->read(®s->ctrl_regs->tmr_cnt_h); in tmr_cnt_read() 40 /* Caller must hold ptp_qoriq->lock. */ 43 struct ptp_qoriq_registers *regs = &ptp_qoriq->regs; in tmr_cnt_write() 47 ptp_qoriq->write(®s->ctrl_regs->tmr_cnt_l, lo); in tmr_cnt_write() 48 ptp_qoriq->write(®s->ctrl_regs->tmr_cnt_h, hi); in tmr_cnt_write() 53 struct ptp_qoriq_registers *regs = &ptp_qoriq->regs; in tmr_offset_read() [all …]
|
/linux/drivers/net/ethernet/marvell/octeontx2/af/ |
H A D | ptp.c | 1 // SPDX-License-Identifier: GPL-2.0 67 #define is_rev_A0(ptp) (((ptp)->pdev->revision & 0x0F) == 0x0) 68 #define is_rev_A1(ptp) (((ptp)->pdev->revision & 0x0F) == 0x1) 82 return ptp->pdev->subsystem_device == PCI_SUBSYS_DEVID_CNF10K_A_PTP; in is_ptp_dev_cnf10ka() 87 return ptp->pdev->subsystem_device == PCI_SUBSYS_DEVID_CN10K_A_PTP; in is_ptp_dev_cn10ka() 101 struct ptp *ptp = rvu->ptp; in is_tstmp_atomic_update_supported() 124 delta_ns = ktime_to_ns(ktime_sub(curr_ts, ptp->last_ts)); in ptp_reset_thresh() 130 ptp_clock_hi = readq(ptp->reg_base + PTP_CLOCK_HI); in ptp_reset_thresh() 132 period_ns = ktime_set(0, (NSEC_PER_SEC + 100 - ptp_clock_hi)); in ptp_reset_thresh() 134 writeq(500000000, ptp->reg_base + PTP_PPS_THRESH_HI); in ptp_reset_thresh() [all …]
|
/linux/drivers/gpu/drm/i915/gt/ |
H A D | intel_rps.c | 1 // SPDX-License-Identifier: MIT 43 return rps_to_gt(rps)->i915; in rps_to_i915() 48 return rps_to_gt(rps)->uncore; in rps_to_uncore() 55 return >_to_guc(gt)->slpc; in rps_to_slpc() 62 return intel_uc_uses_guc_slpc(>->uc); in rps_uses_slpc() 67 return mask & ~rps->pm_intrmsk_mbz; in rps_pm_sanitize_mask() 90 last = engine->stats.rps; in rps_timer() 91 engine->stats.rps = dt; in rps_timer() 99 last = rps->pm_timestamp; in rps_timer() 100 rps->pm_timestamp = timestamp; in rps_timer() [all …]
|
/linux/drivers/net/ethernet/cadence/ |
H A D | macb_ptp.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Copyright (C) 2017 Cadence Design Systems - https://www.cadence.com 26 #define GEM_PTP_TIMER_NAME "gem-ptp-timer" 31 if (bp->hw_dma_cap == HW_DMA_CAP_PTP) in macb_ptp_desc() 34 if (bp->hw_dma_cap == HW_DMA_CAP_64B_PTP) in macb_ptp_desc() 49 spin_lock_irqsave(&bp->tsu_clk_lock, flags); in gem_tsu_get_time() 59 /* if so, use later read & re-read seconds in gem_tsu_get_time() 63 ts->tv_nsec = gem_readl(bp, TN); in gem_tsu_get_time() 68 ts->tv_nsec = first; in gem_tsu_get_time() 71 spin_unlock_irqrestore(&bp->tsu_clk_lock, flags); in gem_tsu_get_time() [all …]
|
/linux/drivers/block/drbd/ |
H A D | drbd_vli.h | 1 /* SPDX-License-Identifier: GPL-2.0-only */ 3 -*- linux-c -*- 7 Copyright (C) 2001-2008, LINBIT Information Technologies GmbH. 8 Copyright (C) 1999-2008, Philipp Reisner <philipp.reisner@linbit.com>. 9 Copyright (C) 2002-2008, Lars Ellenberg <lars.ellenberg@linbit.com>. 19 * and possibly small-bandwidth replication, 55 * * simple byte-based 79 prefix data bits max val Nº data bits 108 -+----------------------------------------------------------------------- 136 u64 adj = 1; in vli_decode_bits() local [all …]
|
/linux/arch/x86/kernel/ |
H A D | tsc_sync.c | 1 // SPDX-License-Identifier: GPL-2.0 8 * print a warning if not and turn off the TSC clock-source. 10 * The warp-check is point-to-point between two CPUs, the CPU 14 * Only two CPUs may participate - they can enter in any order. 52 struct tsc_adjust *adj = this_cpu_ptr(&tsc_adjust); in tsc_verify_tsc_adjust() local 63 if (!resume && time_before(jiffies, adj->nextcheck)) in tsc_verify_tsc_adjust() 66 adj->nextcheck = jiffies + HZ; in tsc_verify_tsc_adjust() 69 if (adj->adjusted == curval) in tsc_verify_tsc_adjust() 73 wrmsrl(MSR_IA32_TSC_ADJUST, adj->adjusted); in tsc_verify_tsc_adjust() 75 if (!adj->warned || resume) { in tsc_verify_tsc_adjust() [all …]
|
/linux/Documentation/devicetree/bindings/ptp/ |
H A D | fsl,ptp.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 10 - Frank Li <Frank.Li@nxp.com> 15 - enum: 16 - fsl,etsec-ptp 17 - fsl,fman-ptp-timer 18 - fsl,dpaa2-ptp 19 - items: 20 - const: pci1957,ee02 [all …]
|
/linux/drivers/net/ethernet/pensando/ionic/ |
H A D | ionic_phc.c | 1 // SPDX-License-Identifier: GPL-2.0 2 /* Copyright(c) 2017 - 2021 Pensando Systems, Inc */ 24 return -ERANGE; in ionic_hwstamp_tx_mode() 70 struct ionic *ionic = lif->ionic; in ionic_lif_hwstamp_set_ts_config() 79 if (!lif->phc || !lif->phc->ptp) in ionic_lif_hwstamp_set_ts_config() 80 return -EOPNOTSUPP; in ionic_lif_hwstamp_set_ts_config() 82 mutex_lock(&lif->phc->config_lock); in ionic_lif_hwstamp_set_ts_config() 94 memcpy(config, &lif->phc->ts_config, sizeof(*config)); in ionic_lif_hwstamp_set_ts_config() 95 memset(&lif->phc->ts_config, 0, sizeof(lif->phc->ts_config)); in ionic_lif_hwstamp_set_ts_config() 96 lif->phc->ts_config_tx_mode = 0; in ionic_lif_hwstamp_set_ts_config() [all …]
|
/linux/fs/xfs/libxfs/ |
H A D | xfs_rmap_btree.c | 1 // SPDX-License-Identifier: GPL-2.0 33 * This is a per-ag tree used to track the owner(s) of a given extent. With 59 return xfs_rmapbt_init_cursor(cur->bc_mp, cur->bc_tp, in xfs_rmapbt_dup_cursor() 60 cur->bc_ag.agbp, to_perag(cur->bc_group)); in xfs_rmapbt_dup_cursor() 69 struct xfs_buf *agbp = cur->bc_ag.agbp; in xfs_rmapbt_set_root() 70 struct xfs_agf *agf = agbp->b_addr; in xfs_rmapbt_set_root() 71 struct xfs_perag *pag = to_perag(cur->bc_group); in xfs_rmapbt_set_root() 73 ASSERT(ptr->s != 0); in xfs_rmapbt_set_root() 75 agf->agf_rmap_root = ptr->s; in xfs_rmapbt_set_root() 76 be32_add_cpu(&agf->agf_rmap_level, inc); in xfs_rmapbt_set_root() [all …]
|
H A D | xfs_refcount.c | 1 // SPDX-License-Identifier: GPL-2.0+ 37 XFS_REFCOUNT_ADJUST_DECREASE = -1, 39 XFS_REFCOUNT_ADJUST_COW_FREE = -1, 61 cur->bc_rec.rc.rc_startblock = bno; in xfs_refcount_lookup_le() 62 cur->bc_rec.rc.rc_blockcount = 0; in xfs_refcount_lookup_le() 63 cur->bc_rec.rc.rc_domain = domain; in xfs_refcount_lookup_le() 81 cur->bc_rec.rc.rc_startblock = bno; in xfs_refcount_lookup_ge() 82 cur->bc_rec.rc.rc_blockcount = 0; in xfs_refcount_lookup_ge() 83 cur->bc_rec.rc.rc_domain = domain; in xfs_refcount_lookup_ge() 101 cur->bc_rec.rc.rc_startblock = bno; in xfs_refcount_lookup_eq() [all …]
|
H A D | xfs_trans_resv.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc. 59 * Per-extent log reservation for the btree changes involved in freeing or 64 * num trees * ((2 blocks/level * max depth) - 1) 66 * Keep in mind that max depth is calculated separately for each type of tree. 75 blocks = num_ops * 2 * (2 * mp->m_alloc_maxlevels - 1); in xfs_allocfree_block_count() 77 blocks += num_ops * (2 * mp->m_rmap_maxlevels - 1); in xfs_allocfree_block_count() 83 * Per-extent log reservation for refcount btree changes. These are never done 92 return num_ops * (2 * mp->m_refc_maxlevels - 1); in xfs_refcountbt_block_count() 100 return num_ops * (2 * mp->m_rtrefc_maxlevels - 1); in xfs_rtrefcountbt_block_count() [all …]
|
H A D | xfs_rtrmap_btree.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Copyright (c) 2018-2024 Oracle. All Rights Reserved. 50 return xfs_rtrmapbt_init_cursor(cur->bc_tp, to_rtg(cur->bc_group)); in xfs_rtrmapbt_dup_cursor() 58 if (level == cur->bc_nlevels - 1) { in xfs_rtrmapbt_get_minrecs() 61 return xfs_rtrmapbt_maxrecs(cur->bc_mp, ifp->if_broot_bytes, in xfs_rtrmapbt_get_minrecs() 65 return cur->bc_mp->m_rtrmap_mnr[level != 0]; in xfs_rtrmapbt_get_minrecs() 73 if (level == cur->bc_nlevels - 1) { in xfs_rtrmapbt_get_maxrecs() 76 return xfs_rtrmapbt_maxrecs(cur->bc_mp, ifp->if_broot_bytes, in xfs_rtrmapbt_get_maxrecs() 80 return cur->bc_mp->m_rtrmap_mxr[level != 0]; in xfs_rtrmapbt_get_maxrecs() 89 blocklen -= sizeof(struct xfs_rtrmap_root); in xfs_rtrmapbt_droot_maxrecs() [all …]
|
/linux/arch/powerpc/boot/dts/fsl/ |
H A D | bsc9131rdb.dtsi | 2 * BSC9131 RDB Device Tree Source stub (no addresses or top-level ranges) 4 * Copyright 2011-2012 Freescale Semiconductor Inc. 38 #address-cells = <1>; 39 #size-cells = <1>; 40 compatible = "fsl,ifc-nand"; 54 #address-cells = <1>; 55 #size-cells = <1>; 56 compatible = "spansion,s25sl12801", "jedec,spi-nor"; 58 spi-max-frequency = <50000000>; 68 phy0: ethernet-phy@0 { [all …]
|
H A D | bsc9132qds.dtsi | 2 * BSC9132 QDS Device Tree Source stub (no addresses or top-level ranges) 37 #address-cells = <1>; 38 #size-cells = <1>; 39 compatible = "cfi-flash"; 41 bank-width = <2>; 42 device-width = <1>; 46 #address-cells = <1>; 47 #size-cells = <1>; 48 compatible = "fsl,ifc-nand"; 56 #address-cells = <1>; [all …]
|
H A D | p1022ds.dtsi | 2 * P1022 DS Device Tree Source stub (no addresses or top-level ranges) 37 #address-cells = <1>; 38 #size-cells = <1>; 39 compatible = "cfi-flash"; 41 bank-width = <2>; 42 device-width = <1>; 46 label = "ramdisk-nor"; 47 read-only; 52 label = "diagnostic-nor"; 53 read-only; [all …]
|
H A D | p1010rdb.dtsi | 2 * P1010 RDB Device Tree Source stub (no addresses or top-level ranges) 37 #address-cells = <1>; 38 #size-cells = <1>; 39 compatible = "cfi-flash"; 41 bank-width = <2>; 42 device-width = <1>; 64 /* 512KB for u-boot Bootloader Image */ 65 /* 512KB for u-boot Environment Variables */ 67 label = "NOR U-Boot Image"; 68 read-only; [all …]
|
H A D | p1020rdb-pd.dts | 2 * P1020 RDB-PD Device Tree Source (32-bit address map) 35 /include/ "p1020si-pre.dtsi" 37 model = "fsl,P1020RDB-PD"; 38 compatible = "fsl,P1020RDB-PD"; 54 #address-cells = <1>; 55 #size-cells = <1>; 56 compatible = "cfi-flash"; 58 bank-width = <2>; 59 device-width = <1>; 83 label = "NOR Vitesse-7385 Firmware"; [all …]
|
H A D | p2020rdb-pc.dtsi | 2 * P2020 RDB-PC Device Tree Source stub (no addresses or top-level ranges) 37 #address-cells = <1>; 38 #size-cells = <1>; 39 compatible = "cfi-flash"; 41 bank-width = <2>; 42 device-width = <1>; 48 label = "NOR Vitesse-7385 Firmware"; 49 read-only; 72 /* 512KB for u-boot Bootloader Image */ 73 /* 512KB for u-boot Environment Variables */ [all …]
|
H A D | p2020rdb.dts | 1 // SPDX-License-Identifier: GPL-2.0-or-later 5 * Copyright 2009-2012 Freescale Semiconductor Inc. 8 /include/ "p2020si-pre.dtsi" 37 #address-cells = <1>; 38 #size-cells = <1>; 39 compatible = "cfi-flash"; 41 bank-width = <2>; 42 device-width = <1>; 48 label = "NOR (RO) Vitesse-7385 Firmware"; 49 read-only; [all …]
|
H A D | p1021rdb-pc.dtsi | 2 * P1021 RDB Device Tree Source stub (no addresses or top-level ranges) 37 #address-cells = <1>; 38 #size-cells = <1>; 39 compatible = "cfi-flash"; 41 bank-width = <2>; 42 device-width = <1>; 48 label = "NOR Vitesse-7385 Firmware"; 49 read-only; 75 read-only; 80 /* 512KB for u-boot Bootloader Image */ [all …]
|
/linux/drivers/net/wireless/mediatek/mt76/mt7603/ |
H A D | mac.c | 1 // SPDX-License-Identifier: ISC 42 memset(dev->mphy.aggr_stats, 0, sizeof(dev->mphy.aggr_stats)); in mt7603_mac_reset_counters() 51 int offset = 3 * dev->coverage_class; in mt7603_mac_set_timing() 54 bool is_5ghz = dev->mphy.chandef.chan->band == NL80211_BAND_5GHZ; in mt7603_mac_set_timing() 73 FIELD_PREP(MT_IFS_SLOT, dev->slottime)); in mt7603_mac_set_timing() 75 if (dev->slottime < 20 || is_5ghz) in mt7603_mac_set_timing() 229 u32 addr = mt7603_wtbl1_addr(sta->wcid.idx); in mt7603_wtbl_set_smps() 231 if (sta->smps == enabled) in mt7603_wtbl_set_smps() 235 sta->smps = enabled; in mt7603_wtbl_set_smps() 241 int idx = sta->wcid.idx; in mt7603_wtbl_set_ps() [all …]
|
/linux/drivers/gpu/drm/bridge/analogix/ |
H A D | anx7625.c | 1 // SPDX-License-Identifier: GPL-2.0-only 35 #include <media/v4l2-fwnode.h> 36 #include <sound/hdmi-codec.h> 50 struct device *dev = &client->dev; in i2c_access_workaround() 53 if (client == ctx->last_client) in i2c_access_workaround() 56 ctx->last_client = client; in i2c_access_workaround() 58 if (client == ctx->i2c.tcpc_client) in i2c_access_workaround() 60 else if (client == ctx->i2c.tx_p0_client) in i2c_access_workaround() 62 else if (client == ctx->i2c.tx_p1_client) in i2c_access_workaround() 64 else if (client == ctx->i2c.rx_p0_client) in i2c_access_workaround() [all …]
|
/linux/sound/usb/ |
H A D | pcm.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 11 #include <linux/usb/audio-v2.h> 40 if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK) { in snd_usb_pcm_delay() 41 queued = bytes_to_frames(runtime, subs->inflight_bytes); in snd_usb_pcm_delay() 44 } else if (!subs->running) { in snd_usb_pcm_delay() 48 current_frame_number = usb_get_current_frame_number(subs->dev); in snd_usb_pcm_delay() 54 frame_diff = (current_frame_number - subs->last_frame_number) & 0xff; in snd_usb_pcm_delay() 58 est_delay = frame_diff * runtime->rate / 1000; in snd_usb_pcm_delay() 60 if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK) { in snd_usb_pcm_delay() 61 est_delay = queued - est_delay; in snd_usb_pcm_delay() [all …]
|