/linux/tools/testing/selftests/gpio/ |
H A D | gpio-sim.sh | 2 # SPDX-License-Identifier: GPL-2.0 6 CONFIGFS_DIR="/sys/kernel/config/gpio-sim" 7 MODULE="gpio-sim" 22 local CHIP=$1 24 for FILE in $CONFIGFS_DIR/$CHIP/*; do 26 if [ "$BANK" = "live" -o "$BANK" = "dev_name" ]; then 30 LINES=`ls $CONFIGFS_DIR/$CHIP/$BANK/ | grep -E ^line` 33 if [ -e $CONFIGFS_DIR/$CHIP/$BANK/$LINE/hog ]; then 34 rmdir $CONFIGFS_DIR/$CHIP/$BANK/$LINE/hog || \ 35 fail "Unable to remove the hog" [all …]
|
/linux/drivers/char/tpm/ |
H A D | tpm-chip.c | 1 // SPDX-License-Identifier: GPL-2.0-only 13 * Maintained by: <tpmdd-devel@lists.sourceforge.net> 15 * TPM chip management routines. 40 static int tpm_request_locality(struct tpm_chip *chip) in tpm_request_locality() argument 44 if (!chip->ops->request_locality) in tpm_request_locality() 47 rc = chip->ops->request_locality(chip, 0); in tpm_request_locality() 51 chip->locality = rc; in tpm_request_locality() 55 static void tpm_relinquish_locality(struct tpm_chip *chip) in tpm_relinquish_locality() argument 59 if (!chip->ops->relinquish_locality) in tpm_relinquish_locality() 62 rc = chip->ops->relinquish_locality(chip, chip->locality); in tpm_relinquish_locality() [all …]
|
H A D | tpm-interface.c | 1 // SPDX-License-Identifier: GPL-2.0-only 12 * Maintained by: <tpmdd-devel@lists.sourceforge.net> 17 * Note, the TPM chip is not interrupt driven (only polling) 19 * calls to msleep. 33 * Bug workaround - some TPM's don't flush the most 35 * with an extend to the selected _unused_ non-volatile pcr. 40 "PCR to use for dummy writes to facilitate flush on suspend."); 43 * tpm_calc_ordinal_duration() - calculate the maximum command duration 44 * @chip: TPM chip to use. 47 * The function returns the maximum amount of time the chip could take [all …]
|
H A D | tpm_tis_i2c_cr50.c | 1 // SPDX-License-Identifier: GPL-2.0 10 * - Use an interrupt for transaction status instead of hardcoded delays. 11 * - Must use write+wait+read read protocol. 12 * - All 4 bytes of status register must be read/written at once. 13 * - Burst count max is 63 bytes, and burst count behaves slightly differently 15 * - When reading from FIFO the full burstcnt must be read instead of just 35 #define TPM_CR50_I2C_MAX_RETRIES 3 /* Max retries due to I2C errors */ 45 * struct tpm_i2c_cr50_priv_data - Driver private data. 46 * @irq: Irq number used for this chip. 48 * @tpm_ready: Struct used by irq handler to signal R/W readiness. [all …]
|
/linux/drivers/mtd/nand/raw/ |
H A D | nand_legacy.c | 1 // SPDX-License-Identifier: GPL-2.0 4 * 2002-2006 Thomas Gleixner (tglx@linutronix.de) 23 * nand_read_byte - [DEFAULT] read one byte from the chip 24 * @chip: NAND chip object 28 static uint8_t nand_read_byte(struct nand_chip *chip) in nand_read_byte() argument 30 return readb(chip->legacy.IO_ADDR_R); in nand_read_byte() 34 * nand_read_byte16 - [DEFAULT] read one byte endianness aware from the chip 35 * @chip: NAND chip object 40 static uint8_t nand_read_byte16(struct nand_chip *chip) in nand_read_byte16() argument 42 return (uint8_t) cpu_to_le16(readw(chip->legacy.IO_ADDR_R)); in nand_read_byte16() [all …]
|
H A D | nand_base.c | 1 // SPDX-License-Identifier: GPL-2.0-only 8 * http://www.linux-mtd.infradead.org/doc/nand.html 11 * 2002-2006 Thomas Gleixner (tglx@linutronix.de) 21 * Check, if mtd->ecctype should be set to MTD_ECC_HW 23 * BBT table is not serialized, has to be fixed 38 #include <linux/mtd/nand-ecc-sw-hamming.h> 39 #include <linux/mtd/nand-ecc-sw-bch.h> 52 int lastpage = (mtd->erasesize / mtd->writesize) - 1; in nand_pairing_dist3_get_info() 59 info->group = 0; in nand_pairing_dist3_get_info() 60 info->pair = (page + 1) / 2; in nand_pairing_dist3_get_info() [all …]
|
/linux/sound/pci/echoaudio/ |
H A D | echoaudio_dsp.c | 3 Copyright Echo Digital Audio Corporation (c) 1998 - 2004 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, 22 MA 02111-1307, USA. 26 Translation from C++ and adaptation for use in ALSA-Driver 35 static int restore_dsp_rettings(struct echoaudio *chip); 38 /* Some vector commands involve the DSP reading or writing data to and from the 39 comm page; if you send one of these commands to the DSP, it will complete the 40 command and then write a non-zero value to the Handshake field in the 41 comm page. This function waits for the handshake to show up. */ [all …]
|
H A D | echoaudio_3g.c | 3 Copyright Echo Digital Audio Corporation (c) 1998 - 2004 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, 22 MA 02111-1307, USA. 26 Translation from C++ and adaptation for use in ALSA-Driver 36 static int check_asic_status(struct echoaudio *chip) in check_asic_status() argument 40 if (wait_handshake(chip)) in check_asic_status() 41 return -EIO; in check_asic_status() 43 chip->comm_page->ext_box_status = cpu_to_le32(E3G_ASIC_NOT_LOADED); in check_asic_status() 44 chip->asic_loaded = false; in check_asic_status() [all …]
|
H A D | layla24_dsp.c | 3 Copyright Echo Digital Audio Corporation (c) 1998 - 2004 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, 21 MA 02111-1307, USA. 25 Translation from C++ and adaptation for use in ALSA-Driver 31 static int write_control_reg(struct echoaudio *chip, u32 value, char force); 32 static int set_input_clock(struct echoaudio *chip, u16 clock); 33 static int set_professional_spdif(struct echoaudio *chip, char prof); 34 static int set_digital_mode(struct echoaudio *chip, u8 mode); 35 static int load_asic_generic(struct echoaudio *chip, u32 cmd, short asic); [all …]
|
/linux/sound/pci/cs46xx/ |
H A D | cs46xx_lib.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 4 * Abramo Bagnara <abramo@alsa-project.org> 9 * - Sometimes the SPDIF input DSP tasks get's unsynchronized 11 * are swapped. To get around this problem when it happens, mute and unmute 13 * - On the Hercules Game Theater XP the amplifier are sometimes turned 17 * - Secondary CODEC on some soundcards 18 * - SPDIF input support for other sample rates then 48khz 19 * - Posibility to mix the SPDIF output with analog sources. 20 * - PCM channels for Center and LFE on secondary codec 24 * multi channel PCM. But known to work. [all …]
|
/linux/sound/ppc/ |
H A D | pmac.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 17 #include <linux/dma-mapping.h> 37 * we will allocate a single 'emergency' dbdma cmd block to use if the 39 * clones, either owing to a bug in dbdma or some interaction between 50 static int snd_pmac_dbdma_alloc(struct snd_pmac *chip, struct pmac_dbdma *rec, int size) in snd_pmac_dbdma_alloc() argument 54 rec->space = dma_alloc_coherent(&chip->pdev->dev, rsize, in snd_pmac_dbdma_alloc() 55 &rec->dma_base, GFP_KERNEL); in snd_pmac_dbdma_alloc() 56 if (rec->space == NULL) in snd_pmac_dbdma_alloc() 57 return -ENOMEM; in snd_pmac_dbdma_alloc() 58 rec->size = size; in snd_pmac_dbdma_alloc() [all …]
|
/linux/drivers/gpio/ |
H A D | gpio-xilinx.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Copyright 2008 - 2013 Xilinx, Inc. 35 /* Read/Write access to the GPIO registers */ 45 * struct xgpio_instance - Stores information about GPIO device 46 * @gc: GPIO chip 76 static inline int xgpio_from_bit(struct xgpio_instance *chip, int bit) in xgpio_from_bit() argument 78 return bitmap_bitremap(bit, chip->hw_map, chip->sw_map, 64); in xgpio_from_bit() 81 static inline int xgpio_to_bit(struct xgpio_instance *chip, int gpio) in xgpio_to_bit() argument 83 return bitmap_bitremap(gpio, chip->sw_map, chip->hw_map, 64); in xgpio_to_bit() 103 static inline int xgpio_regoffset(struct xgpio_instance *chip, int ch) in xgpio_regoffset() argument [all …]
|
H A D | gpio-pch.c | 1 // SPDX-License-Identifier: GPL-2.0 47 OKISEMI_ML7223m_IOH, /* LAPIS Semiconductor ML7223 IOH PCIe Bus-m */ 48 OKISEMI_ML7223n_IOH /* LAPIS Semiconductor ML7223 IOH PCIe Bus-n */ 59 * struct pch_gpio_reg_data - The register store data. 60 * @ien_reg: To store contents of IEN register. 61 * @imask_reg: To store contents of IMASK register. 62 * @po_reg: To store contents of PO register. 63 * @pm_reg: To store contents of PM register. 64 * @im0_reg: To store contents of IM0 register. 65 * @im1_reg: To store contents of IM1 register. [all …]
|
/linux/drivers/net/dsa/mv88e6xxx/ |
H A D | global1.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 7 * Copyright (c) 2016-2017 Savoir-faire Linux Inc. 13 #include "chip.h" 16 int mv88e6xxx_g1_read(struct mv88e6xxx_chip *chip, int reg, u16 *val) in mv88e6xxx_g1_read() argument 18 int addr = chip->info->global1_addr; in mv88e6xxx_g1_read() 20 return mv88e6xxx_read(chip, addr, reg, val); in mv88e6xxx_g1_read() 23 int mv88e6xxx_g1_write(struct mv88e6xxx_chip *chip, int reg, u16 val) in mv88e6xxx_g1_write() argument 25 int addr = chip->info->global1_addr; in mv88e6xxx_g1_write() 27 return mv88e6xxx_write(chip, addr, reg, val); in mv88e6xxx_g1_write() 30 int mv88e6xxx_g1_wait_bit(struct mv88e6xxx_chip *chip, int reg, int in mv88e6xxx_g1_wait_bit() argument [all …]
|
H A D | chip.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 3 * Marvell 88E6xxx Ethernet switch single-chip definition 28 /* PVT limits for 4-bit port and 5-bit switch */ 110 * enum mv88e6xxx_edsa_support - Ethertype DSA tag support level 149 * ports 2-4 are not routet to pins. 152 /* Multi-chip Addressing Mode. 153 * Some chips respond to only 2 registers of its own SMI device address 154 * when it is non-zero, and use indirect access to internal registers. 157 /* Dual-chip Addressing Mode 158 * Some chips respond to only half of the 32 SMI addresses, [all …]
|
/linux/drivers/staging/rts5208/ |
H A D | rtsx.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * Driver for Realtek PCI-Express card reader 5 * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved. 22 MODULE_DESCRIPTION("Realtek PCI-Express card reader rts5208/rts5288 driver"); 27 MODULE_PARM_DESC(delay_use, "seconds to delay before using a new device"); 35 MODULE_PARM_DESC(ss_interval, "Interval to enter ss state in seconds"); 57 return "SCSI emulation for PCI-Express Mass Storage devices"; in host_info() 63 * Set the INQUIRY transfer length to 36. We don't use any of in slave_alloc() 67 sdev->inquiry_len = 36; in slave_alloc() 73 /* Set the SCSI level to at least 2. We'll leave it at 3 if that's in slave_configure() [all …]
|
H A D | rtsx_card.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * Driver for Realtek PCI-Express card reader 5 * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved. 23 void do_remaining_work(struct rtsx_chip *chip) in do_remaining_work() argument 25 struct sd_info *sd_card = &chip->sd_card; in do_remaining_work() 27 struct xd_info *xd_card = &chip->xd_card; in do_remaining_work() 29 struct ms_info *ms_card = &chip->ms_card; in do_remaining_work() 31 if (chip->card_ready & SD_CARD) { in do_remaining_work() 32 if (sd_card->seq_mode) { in do_remaining_work() 33 rtsx_set_stat(chip, RTSX_STAT_RUN); in do_remaining_work() [all …]
|
/linux/sound/pcmcia/vx/ |
H A D | vxp_ops.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 40 struct snd_vxpocket *chip = to_vxpocket(_chip); in vxp_reg_addr() local 41 return chip->port + vxp_reg_offset[reg]; in vxp_reg_addr() 45 * snd_vx_inb - read a byte from the register 48 static unsigned char vxp_inb(struct vx_core *chip, int offset) in vxp_inb() argument 50 return inb(vxp_reg_addr(chip, offset)); in vxp_inb() 54 * snd_vx_outb - write a byte on the register 56 * @val: the value to write 58 static void vxp_outb(struct vx_core *chip, int offset, unsigned char val) in vxp_outb() argument 60 outb(val, vxp_reg_addr(chip, offset)); in vxp_outb() [all …]
|
/linux/drivers/input/misc/ |
H A D | max8997_haptic.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * MAX8997-haptic controller driver 17 #include <linux/mfd/max8997-private.h> 56 static int max8997_haptic_set_duty_cycle(struct max8997_haptic *chip) in max8997_haptic_set_duty_cycle() argument 60 if (chip->mode == MAX8997_EXTERNAL_MODE) { in max8997_haptic_set_duty_cycle() 61 unsigned int duty = chip->pwm_period * chip->level / 100; in max8997_haptic_set_duty_cycle() 62 ret = pwm_config(chip->pwm, duty, chip->pwm_period); in max8997_haptic_set_duty_cycle() 66 duty_index = DIV_ROUND_UP(chip->level * 64, 100); in max8997_haptic_set_duty_cycle() 68 switch (chip->internal_mode_pattern) { in max8997_haptic_set_duty_cycle() 70 max8997_write_reg(chip->client, in max8997_haptic_set_duty_cycle() [all …]
|
/linux/sound/pci/nm256/ |
H A D | nm256.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 7 * The original author of OSS nm256 driver wishes to remain anonymous, 8 * so I just put my acknoledgment to him/her here. 60 MODULE_PARM_DESC(force_ac97, "Force to use AC97 codec for " CARD_NAME " soundcard."); 104 #define NM_ACK_INT(chip, X) snd_nm256_writew(chip, NM_INT_REG, (X) << 1) argument 121 #define NM2_ACK_INT(chip, X) snd_nm256_writel(chip, NM_INT_REG, (X)) argument 173 struct nm256 *chip; member 178 u32 buf; /* offset from chip->buffer */ 210 unsigned int reset_workaround: 1; /* Workaround for some laptops to avoid freeze */ 211 …unsigned int reset_workaround_2: 1; /* Extended workaround for some other laptops to avoid freeze … [all …]
|
/linux/sound/drivers/vx/ |
H A D | vx_core.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 31 * vx_check_reg_bit - wait for the specified bit is set/reset on a register 32 * @reg: register to check 34 * @bit: resultant bit to be checked 35 * @time: time-out of loop in msec 39 int snd_vx_check_reg_bit(struct vx_core *chip, int reg, int mask, int bit, int time) in snd_vx_check_reg_bit() argument 51 if ((snd_vx_inb(chip, reg) & mask) == bit) in snd_vx_check_reg_bit() 55 dev_dbg(chip->card->dev, in snd_vx_check_reg_bit() 57 reg_names[reg], mask, snd_vx_inb(chip, reg)); in snd_vx_check_reg_bit() 58 return -EIO; in snd_vx_check_reg_bit() [all …]
|
H A D | vx_pcm.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 11 * IBL size, typically 126 samples. at each end of chunk, the end-of-buffer 15 * pipe->transferred is the counter of data which has been already transferred. 16 * if this counter reaches to the period size, snd_pcm_period_elapsed() will 20 * to get a low latency response, we'll check the capture streams at each 22 * data is accumulated to the period size, snd_pcm_period_elapsed() is 25 * the current point of read buffer is kept in pipe->hw_ptr. note that 29 * - linked trigger for full-duplex mode. 30 * - scheduled action on the stream. 45 static void vx_pcm_read_per_bytes(struct vx_core *chip, struct snd_pcm_runtime *runtime, in vx_pcm_read_per_bytes() argument [all …]
|
/linux/drivers/power/supply/ |
H A D | ug3105_battery.c | 1 // SPDX-License-Identifier: GPL-2.0+ 5 * Note the uG3105 is not a full-featured autonomous fuel-gauge. Instead it is 6 * expected to be use in combination with some always on microcontroller reading 7 * its coulomb-counter before it can wrap (must be read every 400 seconds!). 9 * Since Linux does not monitor coulomb-counter changes while the device 14 * 2. Reset total_coulomb_count val to 0 when the battery is as good as empty 17 * to when the battery was empty is set. If so we now know the capacity, 19 * 4. Add some mechanism (needs userspace help, or maybe use efivar?) to remember 23 * and then use total_coulomb_count to report energy_now over time, resetting 24 * things to adjust for drift when empty/full. This should give more accurate [all …]
|
/linux/drivers/iio/light/ |
H A D | tsl2583.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 7 * Copyright (c) 2016-2017 Brian Masney <masneyb@onstation.org> 61 /* Per-device data */ 91 * This structure is intentionally large to accommodate updates via 92 * sysfs. Sized to 11 = max 10 segments + 1 termination segment. 113 /* Index = (0 - 3) Used to validate the gain selection index */ 125 static void tsl2583_defaults(struct tsl2583_chip *chip) in tsl2583_defaults() argument 131 chip->als_settings.als_time = 100; in tsl2583_defaults() 137 chip->als_settings.als_gain = 0; in tsl2583_defaults() 139 /* Default gain trim to account for aperture effects */ in tsl2583_defaults() [all …]
|
/linux/sound/pci/oxygen/ |
H A D | oxygen_io.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * C-Media CMI8788 driver - helper functions 16 u8 oxygen_read8(struct oxygen *chip, unsigned int reg) in oxygen_read8() argument 18 return inb(chip->addr + reg); in oxygen_read8() 22 u16 oxygen_read16(struct oxygen *chip, unsigned int reg) in oxygen_read16() argument 24 return inw(chip->addr + reg); in oxygen_read16() 28 u32 oxygen_read32(struct oxygen *chip, unsigned int reg) in oxygen_read32() argument 30 return inl(chip->addr + reg); in oxygen_read32() 34 void oxygen_write8(struct oxygen *chip, unsigned int reg, u8 value) in oxygen_write8() argument 36 outb(value, chip->addr + reg); in oxygen_write8() [all …]
|