/linux/drivers/gpu/drm/amd/display/dc/basics/ |
H A D | dce_calcs.c | 36 * This file is gcc-parseable HW gospel, coming straight from HW engineers. 40 * remain as-is as it provides us with a guarantee from HW that it is correct. 78 struct bw_calcs_data *data) in calculate_bandwidth() argument 139 yclk[low] = vbios->low_yclk; in calculate_bandwidth() 140 yclk[mid] = vbios->mid_yclk; in calculate_bandwidth() 141 yclk[high] = vbios->high_yclk; in calculate_bandwidth() 142 sclk[s_low] = vbios->low_sclk; in calculate_bandwidth() 143 sclk[s_mid1] = vbios->mid1_sclk; in calculate_bandwidth() 144 sclk[s_mid2] = vbios->mid2_sclk; in calculate_bandwidth() 145 sclk[s_mid3] = vbios->mid3_sclk; in calculate_bandwidth() [all …]
|
/linux/drivers/iio/common/ssp_sensors/ |
H A D | ssp_dev.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 55 .name = "ssp-accelerometer", 58 .name = "ssp-gyroscope", 62 static void ssp_toggle_mcu_reset_gpio(struct ssp_data *data) in ssp_toggle_mcu_reset_gpio() argument 64 gpiod_set_value(data->mcu_reset_gpiod, 0); in ssp_toggle_mcu_reset_gpio() 66 gpiod_set_value(data->mcu_reset_gpiod, 1); in ssp_toggle_mcu_reset_gpio() 70 static void ssp_sync_available_sensors(struct ssp_data *data) in ssp_sync_available_sensors() argument 75 if (data->available_sensors & BIT(i)) { in ssp_sync_available_sensors() 76 ret = ssp_enable_sensor(data, i, data->delay_buf[i]); in ssp_sync_available_sensors() 78 dev_err(&data->spi->dev, in ssp_sync_available_sensors() [all …]
|
/linux/drivers/hwmon/ |
H A D | nct6775-core.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * nct6775 - Driver for the hardware monitoring functionality of 4 * Nuvoton NCT677x Super-I/O chips 6 * Copyright (C) 2012 Guenter Roeck <linux@roeck-us.net> 9 * Copyright (C) 2005-2012 Jean Delvare <jdelvare@suse.de> 14 * Copyright (C) 2010 Sheng-Yuan Huang (Nuvoton) (PS00) 36 * nct6796d-s 18 7 7 6+2 0xd801 0xc1 0x5ca3 37 * nct6799d-r 18 7 7 6+2 0xd802 0xc1 0x5ca3 50 #include <linux/hwmon-sysfs.h> 64 /* used to set data->name = nct6775_device_names[data->sio_kind] */ [all …]
|
H A D | ibmaem.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 15 #include <linux/hwmon-sysfs.h> 139 void (*update)(struct aem_data *data); 173 /* Data structures returned by the AEM firmware */ 225 /* Data structures to talk to the IPMI layer */ 236 static void aem_remove_sensors(struct aem_data *data); 237 static int aem1_find_sensors(struct aem_data *data); 238 static int aem2_find_sensors(struct aem_data *data); 239 static void update_aem1_sensors(struct aem_data *data); 240 static void update_aem2_sensors(struct aem_data *data); [all …]
|
H A D | w83627ehf.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * w83627ehf - Driver for the hardware monitoring functionality of 4 * the Winbond W83627EHF Super-I/O chip 5 * Copyright (C) 2005-2012 Jean Delvare <jdelvare@suse.de> 10 * Copyright (C) 2010 Sheng-Yuan Huang (Nuvoton) (PS00) 18 * This driver also supports the W83627EHG, which is the lead-free 27 * w83627dhg-p 9 5 4 3 0xb070 0xc1 0x5ca3 30 * w83667hg-b 9 5 3 4 0xb350 0xc1 0x5ca3 41 #include <linux/hwmon-sysfs.h> 42 #include <linux/hwmon-vid.h> [all …]
|
/linux/drivers/gnss/ |
H A D | sirf.c | 1 // SPDX-License-Identifier: GPL-2.0 29 * If no data arrives for this time, we assume that the chip is off. 32 * low value. Also power saving settings (like send data only on movement) 58 static int sirf_serdev_open(struct sirf_data *data) in sirf_serdev_open() argument 62 mutex_lock(&data->serdev_mutex); in sirf_serdev_open() 63 if (++data->serdev_count == 1) { in sirf_serdev_open() 64 ret = serdev_device_open(data->serdev); in sirf_serdev_open() 66 data->serdev_count--; in sirf_serdev_open() 70 serdev_device_set_baudrate(data->serdev, data->speed); in sirf_serdev_open() 71 serdev_device_set_flow_control(data->serdev, false); in sirf_serdev_open() [all …]
|
/linux/drivers/iio/pressure/ |
H A D | bmp280-core.c | 1 // SPDX-License-Identifier: GPL-2.0-only 12 * https://cdn-shop.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf 13 * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp280-ds001.pdf 14 * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme280-ds002.pdf 15 * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp388-ds001.pdf 16 * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp390-ds002.pdf 17 * https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bmp581-ds004.pdf 26 * - Changed document referral from ANP015 to BST-MPS-AN004-00 on page 26 27 * - Updated equation for B3 param on section 3.5 to ((((long)AC1 * 4 + X3) << oss) + 2) / 4 28 * - Updated RoHS directive to 2011/65/EU effective 8 June 2011 on page 26 [all …]
|
/linux/arch/powerpc/platforms/powernv/ |
H A D | pci.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 21 #include <asm/pci-bridge.h> 24 #include <asm/ppc-pci.h> 25 #include <asm/pnv-pci.h> 47 return -ENXIO; in pnv_pci_get_slot_id() 56 if (!of_device_is_compatible(node, "ibm,ioda2-phb") && in pnv_pci_get_slot_id() 57 !of_device_is_compatible(node, "ibm,ioda3-phb") && in pnv_pci_get_slot_id() 58 !of_device_is_compatible(node, "ibm,ioda2-npu2-opencapi-phb")) { in pnv_pci_get_slot_id() 63 ret = of_property_read_u64(node, "ibm,opal-phbid", &phbid); in pnv_pci_get_slot_id() 66 return -ENXIO; in pnv_pci_get_slot_id() [all …]
|
/linux/drivers/power/supply/ |
H A D | sc27xx_fuel_gauge.c | 1 // SPDX-License-Identifier: GPL-2.0 10 #include <linux/nvmem-consumer.h> 124 static int sc27xx_fgu_cap_to_clbcnt(struct sc27xx_fgu_data *data, int capacity); 125 static void sc27xx_fgu_capacity_calibration(struct sc27xx_fgu_data *data, 127 static void sc27xx_fgu_adjust_cap(struct sc27xx_fgu_data *data, int cap); 128 static int sc27xx_fgu_get_temp(struct sc27xx_fgu_data *data, int *temp); 137 static int sc27xx_fgu_adc_to_current(struct sc27xx_fgu_data *data, s64 adc) in sc27xx_fgu_adc_to_current() argument 139 return DIV_S64_ROUND_CLOSEST(adc * 1000, data->cur_1000ma_adc); in sc27xx_fgu_adc_to_current() 142 static int sc27xx_fgu_adc_to_voltage(struct sc27xx_fgu_data *data, s64 adc) in sc27xx_fgu_adc_to_voltage() argument 144 return DIV_S64_ROUND_CLOSEST(adc * 1000, data->vol_1000mv_adc); in sc27xx_fgu_adc_to_voltage() [all …]
|
H A D | max8903_charger.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * max8903_charger.c - Maxim 8903 USB/Adapter Charger Driver 32 struct gpio_desc *dcm; /* Current-Limit Mode input (1: DC, 2: USB) */ 49 struct max8903_data *data = power_supply_get_drvdata(psy); in max8903_get_property() local 53 val->intval = POWER_SUPPLY_STATUS_UNKNOWN; in max8903_get_property() 54 if (data->chg) { in max8903_get_property() 55 if (gpiod_get_value(data->chg)) in max8903_get_property() 57 val->intval = POWER_SUPPLY_STATUS_CHARGING; in max8903_get_property() 58 else if (data->usb_in || data->ta_in) in max8903_get_property() 59 val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING; in max8903_get_property() [all …]
|
/linux/drivers/usb/chipidea/ |
H A D | ci_hdrc_imx.c | 1 // SPDX-License-Identifier: GPL-2.0+ 81 { .compatible = "fsl,imx23-usb", .data = &imx23_usb_data}, 82 { .compatible = "fsl,imx28-usb", .data = &imx28_usb_data}, 83 { .compatible = "fsl,imx27-usb", .data = &imx27_usb_data}, 84 { .compatible = "fsl,imx6q-usb", .data = &imx6q_usb_data}, 85 { .compatible = "fsl,imx6sl-usb", .data = &imx6sl_usb_data}, 86 { .compatible = "fsl,imx6sx-usb", .data = &imx6sx_usb_data}, 87 { .compatible = "fsl,imx6ul-usb", .data = &imx6ul_usb_data}, 88 { .compatible = "fsl,imx7d-usb", .data = &imx7d_usb_data}, 89 { .compatible = "fsl,imx7ulp-usb", .data = &imx7ulp_usb_data}, [all …]
|
/linux/drivers/bluetooth/ |
H A D | btintel_pcie.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 65 bt_dev_dbg(hdev, "IA: %s: tr-h:%02u tr-t:%02u cr-h:%02u cr-t:%02u", in ipc_print_ia_ring() 67 ia->tr_hia[queue_num], ia->tr_tia[queue_num], in ipc_print_ia_ring() 68 ia->cr_hia[queue_num], ia->cr_tia[queue_num]); in ipc_print_ia_ring() 75 index, urbd1->frbd_tag, urbd1->status, urbd1->fixed); in ipc_print_urbd1() 80 u8 queue = entry->entry; in btintel_pcie_get_data() 81 struct msix_entry *entries = entry - queue; in btintel_pcie_get_data() 86 /* Set the doorbell for TXQ to notify the device that @index (actually index-1) 89 static void btintel_pcie_set_tx_db(struct btintel_pcie_data *data, u16 index) in btintel_pcie_set_tx_db() argument 96 btintel_pcie_wr_reg32(data, BTINTEL_PCIE_CSR_HBUS_TARG_WRPTR, val); in btintel_pcie_set_tx_db() [all …]
|
H A D | bfusb.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 6 * Copyright (C) 2003-2006 Marcel Holtmann <marcel@holtmann.org> 78 static struct urb *bfusb_get_completed(struct bfusb_data *data) in bfusb_get_completed() argument 83 BT_DBG("bfusb %p", data); in bfusb_get_completed() 85 skb = skb_dequeue(&data->completed_q); in bfusb_get_completed() 87 urb = ((struct bfusb_data_scb *) skb->cb)->urb; in bfusb_get_completed() 94 static void bfusb_unlink_urbs(struct bfusb_data *data) in bfusb_unlink_urbs() argument 99 BT_DBG("bfusb %p", data); in bfusb_unlink_urbs() 101 while ((skb = skb_dequeue(&data->pending_q))) { in bfusb_unlink_urbs() 102 urb = ((struct bfusb_data_scb *) skb->cb)->urb; in bfusb_unlink_urbs() [all …]
|
/linux/drivers/iio/proximity/ |
H A D | sx_common.c | 1 // SPDX-License-Identifier: GPL-2.0 61 struct sx_common_data *data = iio_priv(indio_dev); in sx_common_irq_handler() local 63 if (data->trigger_enabled) in sx_common_irq_handler() 64 iio_trigger_poll(data->trig); in sx_common_irq_handler() 78 struct sx_common_data *data = iio_priv(indio_dev); in sx_common_push_events() local 83 ret = regmap_read(data->regmap, data->chip_info->reg_stat, &val); in sx_common_push_events() 85 dev_err(&data->client->dev, "i2c transfer error in irq\n"); in sx_common_push_events() 89 val >>= data->chip_info->stat_offset; in sx_common_push_events() 95 prox_changed = (data->chan_prox_stat ^ val) & data->chan_event; in sx_common_push_events() 97 for_each_set_bit(chan, &prox_changed, data->chip_info->num_channels) { in sx_common_push_events() [all …]
|
/linux/lib/pldmfw/ |
H A D | pldmfw.c | 1 // SPDX-License-Identifier: GPL-2.0 2 /* Copyright (C) 2018-2019, Intel Corporation. */ 53 * pldm_check_fw_space - Verify that the firmware image has space left 54 * @data: pointer to private data 58 * Verify that the firmware data can hold a chunk of bytes with the specified 61 * Returns: zero on success, or -EFAULT if the image does not have enough 65 pldm_check_fw_space(struct pldmfw_priv *data, size_t offset, size_t length) in pldm_check_fw_space() argument 68 struct device *dev = data->context->dev; in pldm_check_fw_space() 70 if (data->fw->size < expected_size) { in pldm_check_fw_space() 72 data->fw->size, expected_size); in pldm_check_fw_space() [all …]
|
/linux/drivers/input/misc/ |
H A D | cma3000_d0x.c | 1 // SPDX-License-Identifier: GPL-2.0-only 73 #define CMA3000_READ(data, reg, msg) \ argument 74 (data->bus_ops->read(data->dev, reg, msg)) 75 #define CMA3000_SET(data, reg, val, msg) \ argument 76 ((data)->bus_ops->write(data->dev, reg, val, msg)) 95 static void decode_mg(struct cma3000_accl_data *data, int *datax, in decode_mg() argument 98 /* Data in 2's complement, convert to mg */ in decode_mg() 99 *datax = ((s8)*datax) * data->bit_to_mg; in decode_mg() 100 *datay = ((s8)*datay) * data->bit_to_mg; in decode_mg() 101 *dataz = ((s8)*dataz) * data->bit_to_mg; in decode_mg() [all …]
|
/linux/drivers/input/mouse/ |
H A D | elan_i2c_core.c | 1 // SPDX-License-Identifier: GPL-2.0-only 12 * copyright (c) 2011-2012 Cypress Semiconductor, Inc. 13 * copyright (c) 2011-2012 Google, Inc. 169 return -ENXIO; in elan_get_fwinfo() 173 (*validpage_count * ETP_FW_PAGE_SIZE) - ETP_FW_SIGNATURE_SIZE; in elan_get_fwinfo() 188 static int elan_set_power(struct elan_tp_data *data, bool on) in elan_set_power() argument 194 error = data->ops->power_control(data->client, on); in elan_set_power() 199 } while (--repeat > 0); in elan_set_power() 201 dev_err(&data->client->dev, "failed to set power %s: %d\n", in elan_set_power() 206 static int elan_sleep(struct elan_tp_data *data) in elan_sleep() argument [all …]
|
/linux/drivers/usb/typec/ |
H A D | rt1719.c | 1 // SPDX-License-Identifier: GPL-2.0 120 static int rt1719_read16(struct rt1719_data *data, unsigned int reg, u16 *val) in rt1719_read16() argument 125 ret = regmap_raw_read(data->regmap, reg, ®val, sizeof(regval)); in rt1719_read16() 133 static int rt1719_read32(struct rt1719_data *data, unsigned int reg, u32 *val) in rt1719_read32() argument 138 ret = regmap_raw_read(data->regmap, reg, ®val, sizeof(regval)); in rt1719_read32() 146 static int rt1719_write32(struct rt1719_data *data, unsigned int reg, u32 val) in rt1719_write32() argument 150 return regmap_raw_write(data->regmap, reg, ®val, sizeof(regval)); in rt1719_write32() 191 static void rt1719_set_data_role(struct rt1719_data *data, in rt1719_set_data_role() argument 204 usb_role_switch_set_role(data->role_sw, usb_role); in rt1719_set_data_role() 205 typec_set_data_role(data->port, data_role); in rt1719_set_data_role() [all …]
|
/linux/tools/perf/util/ |
H A D | data.c | 1 // SPDX-License-Identifier: GPL-2.0 16 #include "data.h" 25 while (--nr >= 0) { in close_dir() 32 void perf_data__close_dir(struct perf_data *data) in perf_data__close_dir() argument 34 close_dir(data->dir.files, data->dir.nr); in perf_data__close_dir() 37 int perf_data__create_dir(struct perf_data *data, int nr) in perf_data__create_dir() argument 43 if (WARN_ON(!data->is_dir)) in perf_data__create_dir() 44 return -EINVAL; in perf_data__create_dir() 48 return -ENOMEM; in perf_data__create_dir() 53 ret = asprintf(&file->path, "%s/data.%d", data->path, i); in perf_data__create_dir() [all …]
|
/linux/drivers/input/touchscreen/ |
H A D | atmel_mxt_ts.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 6 * Copyright (C) 2011-2014 Atmel Corporation 30 #include <media/v4l2-device.h> 31 #include <media/v4l2-ioctl.h> 32 #include <media/videobuf2-v4l2.h> 33 #include <media/videobuf2-vmalloc.h> 34 #include <dt-bindings/input/atmel-maxtouch.h> 152 u8 data[MXT_DIAGNOSTIC_SIZE]; member 283 /* Each client has this additional data */ 367 return obj->size_minus_one + 1; in mxt_obj_size() [all …]
|
/linux/drivers/media/rc/ |
H A D | winbond-cir.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * winbond-cir.c - Driver for the Consumer IR functionality of Winbond 12 * Copyright (C) 2009 - 2011 David Härdeman <david@hardeman.nu> 26 * o Wake-On-CIR functionality 44 #include <media/rc-core.h> 46 #define DRVNAME "winbond-cir" 48 /* CEIR Wake-Up Registers, relative to data->wbase */ 55 #define WBCIR_REG_WCEIR_DATA 0x09 /* CEIR Receiver Data */ 60 /* CEIR Enhanced Functionality Registers, relative to data->ebase */ 67 /* SP3 Banked Registers, relative to data->sbase */ [all …]
|
/linux/drivers/iio/imu/ |
H A D | kmx61.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * KMX61 - Kionix 6-axis Accelerometer/Magnetometer 7 * IIO driver for KMX61 (7-bit I2C slave address 0x0E or 0x0F). 33 * three 16-bit accelerometer output registers for X/Y/Z axis 46 * one 16-bit temperature output register 52 * three 16-bit magnetometer output registers for X/Y/Z axis 119 /* serialize access to non-atomic ops, e.g set_mode */ 136 /* accelerometer specific data */ 144 /* magnetometer specific data */ 280 static void kmx61_set_data(struct iio_dev *indio_dev, struct kmx61_data *data) in kmx61_set_data() argument [all …]
|
/linux/drivers/net/wireless/intel/iwlwifi/fw/ |
H A D | uefi.c | 1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 3 * Copyright(c) 2021-2024 Intel Corporation 6 #include "iwl-drv.h" 8 #include "iwl-prph.h" 9 #include "iwl-io.h" 23 const u8 data[]; member 30 void *data; in iwl_uefi_get_variable() local 33 return ERR_PTR(-EINVAL); in iwl_uefi_get_variable() 36 return ERR_PTR(-ENODEV); in iwl_uefi_get_variable() 38 /* first call with NULL data to get the exact entry size */ in iwl_uefi_get_variable() [all …]
|
/linux/drivers/platform/x86/ |
H A D | system76_acpi.c | 1 // SPDX-License-Identifier: GPL-2.0+ 14 #include <linux/hwmon-sysfs.h> 64 // Array of keyboard LED colors in 24-bit RGB format 76 static int system76_get(struct system76_data *data, char *method) in system76_get() argument 82 handle = acpi_device_handle(data->acpi_dev); in system76_get() 86 return -ENODEV; in system76_get() 90 static int system76_get_index(struct system76_data *data, char *method, int index) in system76_get_index() argument 103 handle = acpi_device_handle(data->acpi_dev); in system76_get_index() 107 return -ENODEV; in system76_get_index() 111 static int system76_get_object(struct system76_data *data, char *method, union acpi_object **obj) in system76_get_object() argument [all …]
|
/linux/sound/core/seq/ |
H A D | seq_ump_convert.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 68 return port->ump_group ? (port->ump_group - 1) : 0; in get_ump_group() 76 * UMP -> MIDI1 sequencer event 85 ev->data.note.channel = val->note.channel; in ump_midi1_to_note_ev() 86 ev->data.note.note = val->note.note; in ump_midi1_to_note_ev() 87 ev->data.note.velocity = val->note.velocity; in ump_midi1_to_note_ev() 94 ev->data.control.channel = val->caf.channel; in ump_midi1_to_ctrl_ev() 95 ev->data.control.value = val->caf.data; in ump_midi1_to_ctrl_ev() 102 ev->data.control.channel = val->pb.channel; in ump_midi1_to_pitchbend_ev() 103 ev->data.control.value = (val->pb.data_msb << 7) | val->pb.data_lsb; in ump_midi1_to_pitchbend_ev() [all …]
|