/drivers/media/platform/ti-vpe/ |
D | cal.c | 267 void cal_quickdump_regs(struct cal_dev *cal) in cal_quickdump_regs() argument 271 cal_info(cal, "CAL Registers @ 0x%pa:\n", &cal->res->start); in cal_quickdump_regs() 273 (__force const void *)cal->base, in cal_quickdump_regs() 274 resource_size(cal->res), false); in cal_quickdump_regs() 276 for (i = 0; i < cal->data->num_csi2_phy; ++i) { in cal_quickdump_regs() 277 struct cal_camerarx *phy = cal->phy[i]; in cal_quickdump_regs() 279 cal_info(cal, "CSI2 Core %u Registers @ %pa:\n", i, in cal_quickdump_regs() 295 static int cal_reserve_pix_proc(struct cal_dev *cal) in cal_reserve_pix_proc() argument 299 spin_lock(&cal->v4l2_dev.lock); in cal_reserve_pix_proc() 301 ret = find_first_zero_bit(&cal->reserved_pix_proc_mask, CAL_MAX_PIX_PROC); in cal_reserve_pix_proc() [all …]
|
D | cal.h | 170 struct cal_dev *cal; member 228 struct cal_dev *cal; member 261 #define cal_dbg(level, cal, fmt, arg...) \ argument 264 dev_printk(KERN_DEBUG, (cal)->dev, fmt, ##arg); \ 266 #define cal_info(cal, fmt, arg...) \ argument 267 dev_info((cal)->dev, fmt, ##arg) 268 #define cal_err(cal, fmt, arg...) \ argument 269 dev_err((cal)->dev, fmt, ##arg) 272 cal_dbg(level, (ctx)->cal, "ctx%u: " fmt, (ctx)->dma_ctx, ##arg) 274 cal_info((ctx)->cal, "ctx%u: " fmt, (ctx)->dma_ctx, ##arg) [all …]
|
D | cal-camerarx.c | 76 u32 val = cal_read(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance)); in cal_camerarx_lane_config() 97 cal_write(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance), val); in cal_camerarx_lane_config() 104 u32 num_lanes = phy->cal->data->camerarx[phy->instance].num_lanes; in cal_camerarx_enable() 170 cal_write_field(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance), in cal_camerarx_power() 176 current_state = cal_read_field(phy->cal, in cal_camerarx_power() 197 if (cal_read_field(phy->cal, in cal_camerarx_wait_reset() 205 if (cal_read_field(phy->cal, CAL_CSI2_COMPLEXIO_CFG(phy->instance), in cal_camerarx_wait_reset() 217 if (cal_read_field(phy->cal, in cal_camerarx_wait_stop_state() 224 if (cal_read_field(phy->cal, CAL_CSI2_TIMING(phy->instance), in cal_camerarx_wait_stop_state() 247 cal_write(phy->cal, CAL_HL_IRQENABLE_SET(0), in cal_camerarx_enable_irqs() [all …]
|
D | Makefile | 14 obj-$(CONFIG_VIDEO_TI_CAL) += ti-cal.o 16 ti-cal-y := cal.o cal-camerarx.o cal-video.o
|
D | cal-video.c | 56 "platform:%s", dev_name(ctx->cal->dev)); in cal_querycap() 745 ret = pm_runtime_resume_and_get(ctx->cal->dev); in cal_start_streaming() 757 cal_quickdump_regs(ctx->cal); in cal_start_streaming() 763 pm_runtime_put_sync(ctx->cal->dev); in cal_start_streaming() 782 pm_runtime_put_sync(ctx->cal->dev); in cal_stop_streaming() 823 ctx->active_fmt = devm_kcalloc(ctx->cal->dev, cal_num_formats, in cal_ctx_v4l2_init_formats() 1000 q->dev = ctx->cal->dev; in cal_ctx_v4l2_init() 1010 vfd->v4l2_dev = &ctx->cal->v4l2_dev; in cal_ctx_v4l2_init()
|
/drivers/net/wireless/mediatek/mt76/mt76x2/ |
D | phy.c | 35 s8 *gain_adj = dev->cal.rx.high_gain; in mt76x2_apply_gain_adj() 209 if (!dev->cal.tssi_cal_done) in mt76x2_phy_tssi_compensate() 212 if (!dev->cal.tssi_comp_pending) { in mt76x2_phy_tssi_compensate() 216 dev->cal.tssi_comp_pending = true; in mt76x2_phy_tssi_compensate() 221 dev->cal.tssi_comp_pending = false; in mt76x2_phy_tssi_compensate() 234 if (t.pa_mode || dev->cal.dpd_cal_done || dev->ed_tx_blocked) in mt76x2_phy_tssi_compensate() 239 dev->cal.dpd_cal_done = true; in mt76x2_phy_tssi_compensate() 250 gain_val[0] = dev->cal.agc_gain_cur[0] - dev->cal.agc_gain_adjust; in mt76x2_phy_set_gain_val() 251 gain_val[1] = dev->cal.agc_gain_cur[1] - dev->cal.agc_gain_adjust; in mt76x2_phy_set_gain_val() 276 u8 *gain = dev->cal.agc_gain_init; in mt76x2_phy_update_channel_gain() [all …]
|
D | usb_phy.c | 16 if (dev->cal.channel_cal_done) in mt76x2u_phy_channel_calibrate() 39 dev->cal.channel_cal_done = true; in mt76x2u_phy_channel_calibrate() 90 dev->cal.channel_cal_done = false; in mt76x2u_phy_set_channel() 141 mt76x2_mcu_init_gain(dev, channel, dev->cal.rx.mcu_gain, true); in mt76x2u_phy_set_channel() 147 if (!dev->cal.init_cal_done) { in mt76x2u_phy_set_channel() 157 if (!dev->cal.init_cal_done) in mt76x2u_phy_set_channel() 159 dev->cal.init_cal_done = true; in mt76x2u_phy_set_channel() 194 dev->cal.tssi_cal_done = true; in mt76x2u_phy_set_channel()
|
D | pci_phy.c | 31 dev->cal.tssi_cal_done = true; in mt76x2_phy_tssi_init_cal() 41 if (dev->cal.channel_cal_done) in mt76x2_phy_channel_calibrate() 47 if (!dev->cal.tssi_cal_done) in mt76x2_phy_channel_calibrate() 68 dev->cal.channel_cal_done = true; in mt76x2_phy_channel_calibrate() 152 dev->cal.channel_cal_done = false; in mt76x2_phy_set_channel() 204 mt76x2_mcu_init_gain(dev, channel, dev->cal.rx.mcu_gain, true); in mt76x2_phy_set_channel() 212 if (!dev->cal.init_cal_done) { in mt76x2_phy_set_channel() 222 if (!dev->cal.init_cal_done) in mt76x2_phy_set_channel() 225 dev->cal.init_cal_done = true; in mt76x2_phy_set_channel() 265 dev->cal.temp = temp; in mt76x2_phy_temp_compensate()
|
D | eeprom.c | 185 s8 *dest = dev->cal.rx.high_gain; in mt76x2_set_rx_gain_group() 200 s8 *dest = dev->cal.rx.rssi_offset; in mt76x2_set_rssi_offset() 274 dev->cal.rx.mcu_gain = (lna_2g & 0xff); in mt76x2_read_rx_gain() 275 dev->cal.rx.mcu_gain |= (lna_5g[0] & 0xff) << 8; in mt76x2_read_rx_gain() 276 dev->cal.rx.mcu_gain |= (lna_5g[1] & 0xff) << 16; in mt76x2_read_rx_gain() 277 dev->cal.rx.mcu_gain |= (lna_5g[2] & 0xff) << 24; in mt76x2_read_rx_gain() 288 dev->cal.rx.lna_gain = mt76x02_sign_extend(lna, 8); in mt76x2_read_rx_gain()
|
/drivers/net/wireless/mediatek/mt76/ |
D | mt76x02_phy.c | 171 u8 limit = dev->cal.low_gain > 0 ? 16 : 4; in mt76x02_phy_adjust_vga_gain() 177 dev->cal.false_cca = false_cca; in mt76x02_phy_adjust_vga_gain() 178 if (false_cca > 800 && dev->cal.agc_gain_adjust < limit) { in mt76x02_phy_adjust_vga_gain() 179 dev->cal.agc_gain_adjust += 2; in mt76x02_phy_adjust_vga_gain() 181 } else if ((false_cca < 10 && dev->cal.agc_gain_adjust > 0) || in mt76x02_phy_adjust_vga_gain() 182 (dev->cal.agc_gain_adjust >= limit && false_cca < 500)) { in mt76x02_phy_adjust_vga_gain() 183 dev->cal.agc_gain_adjust -= 2; in mt76x02_phy_adjust_vga_gain() 187 dev->cal.agc_lowest_gain = dev->cal.agc_gain_adjust >= limit; in mt76x02_phy_adjust_vga_gain() 195 dev->cal.agc_gain_init[0] = mt76_get_field(dev, MT_BBP(AGC, 8), in mt76x02_init_agc_gain() 197 dev->cal.agc_gain_init[1] = mt76_get_field(dev, MT_BBP(AGC, 9), in mt76x02_init_agc_gain() [all …]
|
D | mt76x02_debugfs.c | 79 seq_printf(file, "avg_rssi: %d\n", dev->cal.avg_rssi_all); in read_agc() 80 seq_printf(file, "low_gain: %d\n", dev->cal.low_gain); in read_agc() 81 seq_printf(file, "false_cca: %d\n", dev->cal.false_cca); in read_agc() 82 seq_printf(file, "agc_gain_adjust: %d\n", dev->cal.agc_gain_adjust); in read_agc() 127 debugfs_create_u8("temperature", 0400, dir, &dev->cal.temp); in mt76x02_init_debugfs()
|
/drivers/net/wireless/broadcom/b43/ |
D | lo.c | 731 struct b43_lo_calib *cal; in b43_calibrate_lo_setting() local 769 cal = kmalloc(sizeof(*cal), GFP_KERNEL); in b43_calibrate_lo_setting() 770 if (!cal) { in b43_calibrate_lo_setting() 774 memcpy(&cal->bbatt, bbatt, sizeof(*bbatt)); in b43_calibrate_lo_setting() 775 memcpy(&cal->rfatt, rfatt, sizeof(*rfatt)); in b43_calibrate_lo_setting() 776 memcpy(&cal->ctl, &loctl, sizeof(loctl)); in b43_calibrate_lo_setting() 777 cal->calib_time = jiffies; in b43_calibrate_lo_setting() 778 INIT_LIST_HEAD(&cal->list); in b43_calibrate_lo_setting() 780 return cal; in b43_calibrate_lo_setting() 830 struct b43_lo_calib *cal; in b43_gphy_dc_lt_init() local [all …]
|
D | debugfs.c | 431 struct b43_lo_calib *cal; in loctls_read_file() local 455 list_for_each_entry(cal, &lo->calib_list, list) { in loctls_read_file() 458 active = (b43_compare_bbatt(&cal->bbatt, &phy->g->bbatt) && in loctls_read_file() 459 b43_compare_rfatt(&cal->rfatt, &phy->g->rfatt)); in loctls_read_file() 462 cal->bbatt.att, in loctls_read_file() 463 cal->rfatt.att, cal->rfatt.with_padmix, in loctls_read_file() 464 cal->ctl.i, cal->ctl.q, in loctls_read_file() 465 calc_expire_secs(now, cal->calib_time, in loctls_read_file()
|
/drivers/input/gameport/ |
D | lightning.c | 107 static int l4_getcal(int port, int *cal) in l4_getcal() argument 130 cal[i] = inb(L4_PORT); in l4_getcal() 143 static int l4_setcal(int port, int *cal) in l4_setcal() argument 166 outb(cal[i], L4_PORT); in l4_setcal() 183 int cal[4]; in l4_calibrate() local 186 if (l4_getcal(l4->port, cal)) in l4_calibrate() 190 t = (max[i] * cal[i]) / 200; in l4_calibrate() 192 axes[i] = (axes[i] < 0) ? -1 : (axes[i] * cal[i]) / t; in l4_calibrate() 194 cal[i] = t; in l4_calibrate() 197 if (l4_setcal(l4->port, cal)) in l4_calibrate() [all …]
|
/drivers/net/wireless/mediatek/mt76/mt76x0/ |
D | phy.c | 416 gain -= dev->cal.rx.lna_gain * 2; in mt76x0_phy_set_chan_bbp_params() 527 dev->cal.tssi_dc = mt76_rr(dev, MT_BBP(CORE, 35)) & 0xff; in mt76x0_phy_tssi_dc_calibrate() 774 tssi_db = mt76x0_phy_lin2db(ltssi - dev->cal.tssi_dc) * tssi_slope; in mt76x0_phy_get_delta_power() 787 ((ltssi - dev->cal.tssi_dc) < 1 && tssi_target < 0)) { in mt76x0_phy_get_delta_power() 792 if ((dev->cal.tssi_target ^ tssi_target) < 0 && in mt76x0_phy_get_delta_power() 793 dev->cal.tssi_target > -4096 && dev->cal.tssi_target < 4096 && in mt76x0_phy_get_delta_power() 796 tssi_target + dev->cal.tssi_target > 0) || in mt76x0_phy_get_delta_power() 798 tssi_target + dev->cal.tssi_target <= 0)) in mt76x0_phy_get_delta_power() 801 dev->cal.tssi_target = tssi_target; in mt76x0_phy_get_delta_power() 803 dev->cal.tssi_target = tssi_target; in mt76x0_phy_get_delta_power() [all …]
|
D | eeprom.c | 88 dev->cal.rx.temp_offset = mt76x02_sign_extend(val, 8); in mt76x0_set_temp_offset() 90 dev->cal.rx.temp_offset = -10; in mt76x0_set_temp_offset() 95 struct mt76x02_rx_freq_cal *caldata = &dev->cal.rx; in mt76x0_set_freq_offset() 113 struct mt76x02_rx_freq_cal *caldata = &dev->cal.rx; in mt76x0_read_rx_gain()
|
/drivers/net/wireless/ath/ath9k/ |
D | calib.c | 64 s16 calib_nf = ath9k_hw_get_nf_limits(ah, chan)->cal[chain]; in ath9k_hw_get_default_nf() 88 struct ath9k_hw_cal_data *cal, in ath9k_hw_update_nfcal_hist_buffer() argument 98 h = cal->nfCalHist; in ath9k_hw_update_nfcal_hist_buffer() 128 (test_bit(NFCAL_INTF, &cal->cal_flags) ? in ath9k_hw_update_nfcal_hist_buffer() 139 if (!test_bit(NFCAL_INTF, &cal->cal_flags)) in ath9k_hw_update_nfcal_hist_buffer() 150 clear_bit(NFCAL_INTF, &cal->cal_flags); in ath9k_hw_update_nfcal_hist_buffer() 274 ath9k_hw_get_nf_limits(ah, chan)->cal[i]; in ath9k_hw_loadnf()
|
/drivers/net/ethernet/microchip/sparx5/ |
D | sparx5_calendar.c | 162 u32 cal[7], value, idx, portno; in sparx5_config_auto_calendar() local 168 memset(cal, 0, sizeof(cal)); in sparx5_config_auto_calendar() 193 cal[reg] |= spd << (offset * SPX5_CALBITS_PER_PORT); in sparx5_config_auto_calendar() 216 for (idx = 0; idx < ARRAY_SIZE(cal); idx++) in sparx5_config_auto_calendar() 217 spx5_wr(cal[idx], sparx5, QSYS_CAL_AUTO(idx)); in sparx5_config_auto_calendar() 254 static u32 sparx5_dsm_cal_len(u32 *cal) in sparx5_dsm_cal_len() argument 259 if (cal[idx] != SPX5_DSM_CAL_EMPTY) in sparx5_dsm_cal_len()
|
/drivers/iio/pressure/ |
D | icp10100.c | 44 int16_t cal[4]; member 214 st->cal[i] = be16_to_cpu(val); in icp10100_read_cal_otp() 215 dev_dbg(&st->client->dev, "cal[%d] = %d\n", i, st->cal[i]); in icp10100_read_cal_otp() 294 val1 = (int64_t)st->cal[0] * (int64_t)t_square; in icp10100_get_pressure() 296 val1 = (int64_t)st->cal[1] * (int64_t)t_square; in icp10100_get_pressure() 297 p_lut[1] = offset_factor * st->cal[3] + in icp10100_get_pressure() 299 val1 = (int64_t)st->cal[2] * (int64_t)t_square; in icp10100_get_pressure()
|
/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/ |
D | phy.c | 3725 u32 tx_fail, rx_fail, delay_count, iqk_ready, cal_retry, cal = 0, temp_reg65; in _rtl8821ae_iqk_tx() local 3741 while (cal < cal_num) { in _rtl8821ae_iqk_tx() 3859 tx_dt[cal] = (vdf_y[1]>>20)-(vdf_y[0]>>20); in _rtl8821ae_iqk_tx() 3860 tx_dt[cal] = ((16*tx_dt[cal])*10000/15708); in _rtl8821ae_iqk_tx() 3861 tx_dt[cal] = (tx_dt[cal] >> 1)+(tx_dt[cal] & BIT(0)); in _rtl8821ae_iqk_tx() 3865 rtl_set_bbreg(hw, 0xce8, 0x3fff0000, tx_dt[cal] & 0x00003fff); in _rtl8821ae_iqk_tx() 3918 tx_x0[cal] = vdf_x[k-1]; in _rtl8821ae_iqk_tx() 3919 tx_y0[cal] = vdf_y[k-1]; in _rtl8821ae_iqk_tx() 3950 tx_x0[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx() 3952 tx_y0[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx() [all …]
|
/drivers/rtc/ |
D | rtc-stk17ta8.c | 259 unsigned int cal; in stk17ta8_rtc_probe() local 284 cal = readb(ioaddr + RTC_CALIBRATION); in stk17ta8_rtc_probe() 285 if (cal & RTC_STOP) { in stk17ta8_rtc_probe() 286 cal &= RTC_CAL_MASK; in stk17ta8_rtc_probe() 289 writeb(cal, ioaddr + RTC_CALIBRATION); in stk17ta8_rtc_probe()
|
/drivers/net/wireless/mediatek/mt76/mt7915/ |
D | eeprom.c | 17 dev->cal = devm_kzalloc(mdev->dev, val, GFP_KERNEL); in mt7915_eeprom_load_precal() 18 if (!dev->cal) in mt7915_eeprom_load_precal() 21 return mt76_get_of_eeprom(mdev, dev->cal, MT_EE_PRECAL, val); in mt7915_eeprom_load_precal()
|
/drivers/iio/adc/ |
D | stm32-adc.c | 218 struct stm32_adc_calib cal; member 777 adc->cal.lincalfact[i] = (val & STM32H7_LINCALFACT_MASK); in stm32h7_adc_read_selfcalib() 778 adc->cal.lincalfact[i] >>= STM32H7_LINCALFACT_SHIFT; in stm32h7_adc_read_selfcalib() 785 adc->cal.calfact_s = (val & STM32H7_CALFACT_S_MASK); in stm32h7_adc_read_selfcalib() 786 adc->cal.calfact_s >>= STM32H7_CALFACT_S_SHIFT; in stm32h7_adc_read_selfcalib() 787 adc->cal.calfact_d = (val & STM32H7_CALFACT_D_MASK); in stm32h7_adc_read_selfcalib() 788 adc->cal.calfact_d >>= STM32H7_CALFACT_D_SHIFT; in stm32h7_adc_read_selfcalib() 789 adc->cal.calibrated = true; in stm32h7_adc_read_selfcalib() 805 val = (adc->cal.calfact_s << STM32H7_CALFACT_S_SHIFT) | in stm32h7_adc_restore_selfcalib() 806 (adc->cal.calfact_d << STM32H7_CALFACT_D_SHIFT); in stm32h7_adc_restore_selfcalib() [all …]
|
/drivers/net/wireless/intersil/p54/ |
D | eeprom.c | 562 struct pda_rssi_cal_ext_entry *cal = (void *) &data[offset]; in p54_parse_rssical() local 565 entry[i].freq = le16_to_cpu(cal[i].freq); in p54_parse_rssical() 566 entry[i].mul = (s16) le16_to_cpu(cal[i].mul); in p54_parse_rssical() 567 entry[i].add = (s16) le16_to_cpu(cal[i].add); in p54_parse_rssical() 570 struct pda_rssi_cal_entry *cal = (void *) &data[offset]; in p54_parse_rssical() local 584 entry[i].mul = (s16) le16_to_cpu(cal[i].mul); in p54_parse_rssical() 585 entry[i].add = (s16) le16_to_cpu(cal[i].add); in p54_parse_rssical()
|
/drivers/thermal/tegra/ |
D | tegra30-tsensor.c | 431 u32 i, ate_ver = 0, cal = 0, t1_25C = 0, t2_90C = 0; in tegra_tsensor_nvmem_setup() local 456 err = tegra_fuse_readl(TEGRA30_FUSE_TSENSOR_CALIB, &cal); in tegra_tsensor_nvmem_setup() 463 c1_25C = FIELD_GET(TEGRA30_FUSE_TSENSOR_CALIB_LOW, cal); in tegra_tsensor_nvmem_setup() 464 c2_90C = FIELD_GET(TEGRA30_FUSE_TSENSOR_CALIB_HIGH, cal); in tegra_tsensor_nvmem_setup()
|