| /linux/drivers/spmi/ |
| H A D | spmi.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. 16 #include <dt-bindings/spmi/spmi.h> 36 struct spmi_controller *ctrl = to_spmi_controller(dev); in spmi_ctrl_release() local 38 ida_free(&ctrl_ida, ctrl->nr); in spmi_ctrl_release() 39 kfree(ctrl); in spmi_ctrl_release() 51 if (drv->name) in spmi_device_match() 52 return strncmp(dev_name(dev), drv->name, in spmi_device_match() 59 * spmi_device_add() - add a device previously constructed via spmi_device_alloc() 64 struct spmi_controller *ctrl = sdev->ctrl; in spmi_device_add() local [all …]
|
| H A D | spmi-apple-controller.c | 1 // SPDX-License-Identifier: GPL-2.0 10 * hisi-spmi-controller.c 11 * spmi-pmic-arb.c Copyright (c) 2021, The Linux Foundation. 35 readl_poll_timeout((spmi)->regs + (reg), (val), (cond), \ 38 static inline u32 apple_spmi_pack_cmd(u8 opc, u8 sid, u16 saddr, size_t len) in apple_spmi_pack_cmd() argument 40 return opc | sid << 8 | saddr << 16 | (len - 1) | (1 << 15); in apple_spmi_pack_cmd() 44 static int apple_spmi_wait_rx_not_empty(struct spmi_controller *ctrl) in apple_spmi_wait_rx_not_empty() argument 46 struct apple_spmi *spmi = spmi_controller_get_drvdata(ctrl); in apple_spmi_wait_rx_not_empty() 52 dev_err(&ctrl->dev, in apple_spmi_wait_rx_not_empty() 60 static int spmi_read_cmd(struct spmi_controller *ctrl, u8 opc, u8 sid, in spmi_read_cmd() argument [all …]
|
| /linux/drivers/nvme/host/ |
| H A D | tcp.c | 1 // SPDX-License-Identifier: GPL-2.0 12 #include <linux/nvme-tcp.h> 13 #include <linux/nvme-keyring.h> 19 #include <linux/blk-mq.h> 31 * A non-zero value being sufficient to indicate general consideration of any 45 MODULE_PARM_DESC(wq_unbound, "Use unbound workqueue for nvme-tcp IO context (default false)"); 129 struct nvme_tcp_ctrl *ctrl; member 168 struct nvme_ctrl ctrl; member 183 * sk_lock -> mmap_lock (page fault) -> fs locks -> sk_lock 184 * because dependencies are tracked for both nvme-tcp and user contexts. Using [all …]
|
| H A D | fabrics.c | 1 // SPDX-License-Identifier: GPL-2.0 4 * Copyright (c) 2015-2016 HGST, a Western Digital Company. 15 #include <linux/nvme-keyring.h> 33 kref_init(&host->ref); in nvmf_host_alloc() 34 uuid_copy(&host->id, id); in nvmf_host_alloc() 35 strscpy(host->nqn, hostnqn, NVMF_NQN_SIZE); in nvmf_host_alloc() 53 bool same_hostnqn = !strcmp(host->nqn, hostnqn); in nvmf_host_add() 54 bool same_hostid = uuid_equal(&host->id, id); in nvmf_host_add() 57 kref_get(&host->ref); in nvmf_host_add() 63 host = ERR_PTR(-EINVAL); in nvmf_host_add() [all …]
|
| /linux/arch/arm64/kernel/ |
| H A D | hw_breakpoint.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * HW_breakpoint: a unified kernel/user-space hardware breakpoint facility, 10 #define pr_fmt(fmt) "hw-breakpoint: " fmt 23 #include <asm/debug-monitors.h> 37 /* Currently stepping a per-CPU kernel breakpoint. */ 151 return -EINVAL; in debug_exception_level() 164 struct task_struct *tsk = bp->hw.target; in is_compat_bp() 167 * tsk can be NULL for per-cpu (non-ptrace) breakpoints. in is_compat_bp() 177 * hw_breakpoint_slot_setup - Find and setup a perf slot according to 187 * -ENOSPC if no slot is available/matches [all …]
|
| /linux/drivers/scsi/arm/ |
| H A D | cumana_1.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Copyright 1995-2002, Russell King 17 #define priv(host) ((struct NCR5380_hostdata *)(host)->hostdata) 31 unsigned ctrl 39 #define CTRL 0x16fc macro 45 unsigned char *addr, int len) in cumanascsi_pwrite() argument 48 u8 __iomem *base = hostdata->io; in cumanascsi_pwrite() 49 u8 __iomem *dma = hostdata->pdma_io + 0x2000; in cumanascsi_pwrite() 51 if(!len) return 0; in cumanascsi_pwrite() 53 writeb(0x02, base + CTRL); in cumanascsi_pwrite() [all …]
|
| /linux/sound/soc/codecs/ |
| H A D | sigmadsp.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 5 * Copyright 2009-2014 Analog Devices Inc. 91 __le16 len; 97 const uint8_t data[], size_t len) in sigmadsp_write() 99 return sigmadsp->write(sigmadsp->control_dat in sigmadsp_write() 90 __le16 len; global() member 96 sigmadsp_write(struct sigmadsp * sigmadsp,unsigned int addr,const uint8_t data[],size_t len) sigmadsp_write() argument 102 sigmadsp_read(struct sigmadsp * sigmadsp,unsigned int addr,uint8_t data[],size_t len) sigmadsp_read() argument 110 struct sigmadsp_control *ctrl = (void *)kcontrol->private_value; sigmadsp_ctrl_info() local 119 sigmadsp_ctrl_write(struct sigmadsp * sigmadsp,struct sigmadsp_control * ctrl,void * data) sigmadsp_ctrl_write() argument 133 struct sigmadsp_control *ctrl = (void *)kcontrol->private_value; sigmadsp_ctrl_put() local 159 struct sigmadsp_control *ctrl = (void *)kcontrol->private_value; sigmadsp_ctrl_get() local 184 struct sigmadsp_control *ctrl = (void *)kcontrol->private_value; sigmadsp_control_free() local 189 sigma_fw_validate_control_name(const char * name,unsigned int len) sigma_fw_validate_control_name() argument 206 struct sigmadsp_control *ctrl; sigma_fw_load_control() local 403 size_t len = sigma_action_len(sa); process_sigma_action() local 467 struct sigmadsp_control *ctrl, *_ctrl; sigmadsp_firmware_release() local 642 sigmadsp_alloc_control(struct sigmadsp * sigmadsp,struct sigmadsp_control * ctrl,unsigned int samplerate_mask) sigmadsp_alloc_control() argument 669 sigmadsp_activate_ctrl(struct sigmadsp * sigmadsp,struct sigmadsp_control * ctrl,unsigned int samplerate_mask) sigmadsp_activate_ctrl() argument 701 struct sigmadsp_control *ctrl; sigmadsp_attach() local 733 struct sigmadsp_control *ctrl; sigmadsp_setup() local 777 struct sigmadsp_control *ctrl; sigmadsp_reset() local [all...] |
| /linux/drivers/nvme/target/ |
| H A D | auth.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * NVMe over Fabrics DH-HMAC-CHAP authentication. 16 #include <linux/nvme-auth.h> 17 #include <linux/nvme-keyring.h> 30 kfree(host->dhchap_ctrl_secret); in nvmet_auth_set_key() 31 host->dhchap_ctrl_secret = NULL; in nvmet_auth_set_key() 32 host->dhchap_ctrl_key_hash = 0; in nvmet_auth_set_key() 34 kfree(host->dhchap_secret); in nvmet_auth_set_key() 35 host->dhchap_secret = NULL; in nvmet_auth_set_key() 36 host->dhchap_key_hash = 0; in nvmet_auth_set_key() [all …]
|
| H A D | admin-cmd.c | 1 // SPDX-License-Identifier: GPL-2.0 4 * Copyright (c) 2015-2016 HGST, a Western Digital Company. 17 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_delete_sq() local 18 u16 sqid = le16_to_cpu(req->cmd->delete_queue.qid); in nvmet_execute_delete_sq() 21 if (!nvmet_is_pci_ctrl(ctrl)) { in nvmet_execute_delete_sq() 31 status = nvmet_check_sqid(ctrl, sqid, false); in nvmet_execute_delete_sq() 35 status = ctrl->ops->delete_sq(ctrl, sqid); in nvmet_execute_delete_sq() 43 struct nvmet_ctrl *ctrl = req->sq->ctrl; in nvmet_execute_create_sq() local 44 struct nvme_command *cmd = req->cmd; in nvmet_execute_create_sq() 45 u16 sqid = le16_to_cpu(cmd->create_sq.sqid); in nvmet_execute_create_sq() [all …]
|
| /linux/drivers/spi/ |
| H A D | spi-sc18is602.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 5 * Copyright (C) Guenter Roeck <linux@roeck-us.net> 36 u8 ctrl; member 50 static int sc18is602_wait_ready(struct sc18is602 *hw, int len) in sc18is602_wait_ready() argument 53 int usecs = 1000000 * len / hw->speed + 1; in sc18is602_wait_ready() 57 err = i2c_master_recv(hw->client, dummy, 1); in sc18is602_wait_ready() 62 return -ETIMEDOUT; in sc18is602_wait_ready() 68 unsigned int len = t->len; in sc18is602_txrx() local 71 if (hw->tlen == 0) { in sc18is602_txrx() 73 hw->buffer[0] = 1 << spi_get_chipselect(msg->spi, 0); in sc18is602_txrx() [all …]
|
| H A D | spi-ch341.c | 1 // SPDX-License-Identifier: GPL-2.0 3 // QiHeng Electronics ch341a USB-to-SPI adapter driver 31 struct spi_controller *ctrl; member 45 spi_controller_get_devdata(spi->controller); in ch341_set_cs() 48 memset(ch341->tx_buf, 0, CH341_PACKET_LENGTH); in ch341_set_cs() 49 ch341->tx_buf[0] = CH341A_CMD_UIO_STREAM; in ch341_set_cs() 50 ch341->tx_buf[1] = CH341A_CMD_UIO_STM_OUT | (is_high ? 0x36 : 0x37); in ch341_set_cs() 53 ch341->tx_buf[2] = CH341A_CMD_UIO_STM_DIR | 0x3f; in ch341_set_cs() 54 ch341->tx_buf[3] = CH341A_CMD_UIO_STM_END; in ch341_set_cs() 56 ch341->tx_buf[2] = CH341A_CMD_UIO_STM_END; in ch341_set_cs() [all …]
|
| /linux/drivers/media/pci/cx25821/ |
| H A D | cx25821-i2c.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 27 printk(KERN_DEBUG "%s/0: " fmt, dev->name, ##arg); \ 38 struct cx25821_i2c *bus = i2c_adap->algo_data; in i2c_slave_did_ack() 39 struct cx25821_dev *dev = bus->dev; in i2c_slave_did_ack() 40 return cx_read(bus->reg_stat) & 0x01; in i2c_slave_did_ack() 45 struct cx25821_i2c *bus = i2c_adap->algo_data; in i2c_is_busy() 46 struct cx25821_dev *dev = bus->dev; in i2c_is_busy() 47 return cx_read(bus->reg_stat) & 0x02 ? 1 : 0; in i2c_is_busy() 69 struct cx25821_i2c *bus = i2c_adap->algo_data; in i2c_sendbytes() 70 struct cx25821_dev *dev = bus->dev; in i2c_sendbytes() [all …]
|
| /linux/drivers/media/pci/cx23885/ |
| H A D | cx23885-i2c.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 15 #include <media/v4l2-common.h> 39 struct cx23885_i2c *bus = i2c_adap->algo_data; in i2c_slave_did_ack() 40 struct cx23885_dev *dev = bus->dev; in i2c_slave_did_ack() 41 return cx_read(bus->reg_stat) & 0x01; in i2c_slave_did_ack() 46 struct cx23885_i2c *bus = i2c_adap->algo_data; in i2c_is_busy() 47 struct cx23885_dev *dev = bus->dev; in i2c_is_busy() 48 return cx_read(bus->reg_stat) & 0x02 ? 1 : 0; in i2c_is_busy() 70 struct cx23885_i2c *bus = i2c_adap->algo_data; in i2c_sendbytes() 71 struct cx23885_dev *dev = bus->dev; in i2c_sendbytes() [all …]
|
| /linux/drivers/scsi/be2iscsi/ |
| H A D | be_mgmt.c | 16 * OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH 22 * linux-drivers@broadcom.com 26 #include <linux/bsg-lib.h> 33 unsigned int mgmt_vendor_specific_fw_cmd(struct be_ctrl_info *ctrl, in mgmt_vendor_specific_fw_cmd() argument 41 struct iscsi_bsg_request *bsg_req = job->request; in mgmt_vendor_specific_fw_cmd() 42 struct be_bsg_vendor_cmd *req = nonemb_cmd->va; in mgmt_vendor_specific_fw_cmd() 45 nonemb_cmd->size = job->request_payload.payload_len; in mgmt_vendor_specific_fw_cmd() 46 memset(nonemb_cmd->va, 0, nonemb_cmd->size); in mgmt_vendor_specific_fw_cmd() 47 region = bsg_req->rqst_data.h_vendor.vendor_cmd[1]; in mgmt_vendor_specific_fw_cmd() 48 sector_size = bsg_req->rqst_data.h_vendor.vendor_cmd[2]; in mgmt_vendor_specific_fw_cmd() [all …]
|
| /linux/arch/arm/kernel/ |
| H A D | hw_breakpoint.c | 1 // SPDX-License-Identifier: GPL-2.0-only 10 * HW_breakpoint: a unified kernel/user-space hardware breakpoint facility, 13 #define pr_fmt(fmt) "hw-breakpoint: " fmt 151 /* We don't support the memory-mapped interface. */ in debug_arch_supported() 216 return core_has_mismatch_brps() ? brps - 1 : brps; in get_num_brps() 257 return -ENODEV; in enable_monitor_mode() 265 return -EPERM; in enable_monitor_mode() 293 * Check if 8-bit byte-address select is available. 299 struct arch_hw_breakpoint_ctrl ctrl; in get_max_wp_len() local 305 memset(&ctrl, 0, sizeof(ctrl)); in get_max_wp_len() [all …]
|
| /linux/drivers/pci/hotplug/ |
| H A D | shpchp_sysfs.c | 1 // SPDX-License-Identifier: GPL-2.0+ 6 * Copyright (c) 2001,2003 Greg Kroah-Hartman (greg@kroah.com) 29 size_t len = 0; in show_ctrl() local 33 bus = pdev->subordinate; in show_ctrl() 35 len += sysfs_emit_at(buf, len, "Free resources: memory\n"); in show_ctrl() 37 if (res && (res->flags & IORESOURCE_MEM) && in show_ctrl() 38 !(res->flags & IORESOURCE_PREFETCH)) { in show_ctrl() 39 len += sysfs_emit_at(buf, len, in show_ctrl() 41 (unsigned long long)res->start, in show_ctrl() 45 len += sysfs_emit_at(buf, len, "Free resources: prefetchable memory\n"); in show_ctrl() [all …]
|
| /linux/drivers/hid/surface-hid/ |
| H A D | surface_kbd.c | 1 // SPDX-License-Identifier: GPL-2.0+ 7 * Copyright (C) 2019-2021 Maximilian Luz <luzmaximilian@gmail.com> 22 /* -- SAM interface (KBD). -------------------------------------------------- */ 34 static int ssam_kbd_get_descriptor(struct surface_hid_device *shid, u8 entry, u8 *buf, size_t len) in ssam_kbd_get_descriptor() argument 40 rqst.target_category = shid->uid.category; in ssam_kbd_get_descriptor() 41 rqst.target_id = shid->uid.target; in ssam_kbd_get_descriptor() 43 rqst.instance_id = shid->uid.instance; in ssam_kbd_get_descriptor() 48 rsp.capacity = len; in ssam_kbd_get_descriptor() 52 status = ssam_retry(ssam_request_do_sync_onstack, shid->ctrl, &rqst, &rsp, sizeof(entry)); in ssam_kbd_get_descriptor() 56 if (rsp.length != len) { in ssam_kbd_get_descriptor() [all …]
|
| /linux/drivers/mtd/nand/raw/ |
| H A D | fsl_ifc_nand.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 5 * Copyright 2011-2012 Freescale Semiconductor, Inc 33 struct fsl_ifc_ctrl *ctrl; member 52 unsigned int eccread; /* Non zero for a full-page ECC read */ 68 .offs = 2, /* 0 on 8-bit small page */ 69 .len = 4, 78 .offs = 2, /* 0 on 8-bit small page */ 79 .len = 4, 91 return -ERANGE; in fsl_ifc_ooblayout_ecc() 93 oobregion->offset = 8; in fsl_ifc_ooblayout_ecc() [all …]
|
| /linux/drivers/net/ethernet/freescale/fs_enet/ |
| H A D | mii-bitbang.c | 1 // SPDX-License-Identifier: GPL-2.0-only 20 #include <linux/mdio-bitbang.h> 28 struct mdiobb_ctrl ctrl; member 55 static inline void mdio_dir(struct mdiobb_ctrl *ctrl, int dir) in mdio_dir() argument 57 struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl); in mdio_dir() 60 bb_set(bitbang->dir, bitbang->mdio_msk); in mdio_dir() 62 bb_clr(bitbang->dir, bitbang->mdio_msk); in mdio_dir() 65 in_be32(bitbang->dir); in mdio_dir() 68 static inline int mdio_read(struct mdiobb_ctrl *ctrl) in mdio_read() argument 70 struct bb_info *bitbang = container_of(ctrl, struct bb_info, ctrl); in mdio_read() [all …]
|
| /linux/drivers/rtc/ |
| H A D | rtc-pcf8583.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * drivers/rtc/rtc-pcf8583.c 29 unsigned char ctrl; member 43 #define get_ctrl(x) ((struct pcf8583 *)i2c_get_clientdata(x))->ctrl 54 .addr = client->addr, in pcf8583_get_datetime() 56 .len = 1, in pcf8583_get_datetime() 59 .addr = client->addr, in pcf8583_get_datetime() 61 .len = 6, in pcf8583_get_datetime() 69 ret = i2c_transfer(client->adapter, msgs, 2); in pcf8583_get_datetime() 71 dt->tm_year = buf[4] >> 6; in pcf8583_get_datetime() [all …]
|
| /linux/drivers/i2c/busses/ |
| H A D | i2c-microchip-corei2c.c | 1 // SPDX-License-Identifier: GPL-2.0 5 * Copyright (c) 2018-2022 Microchip Corporation. All rights reserved. 93 * struct mchp_corei2c_dev - Microchip CoreI2C device private data 131 u8 ctrl = readb(idev->base + CORE_I2C_CTRL); in mchp_corei2c_core_disable() local 133 ctrl &= ~CTRL_ENS1; in mchp_corei2c_core_disable() 134 writeb(ctrl, idev->base + CORE_I2C_CTRL); in mchp_corei2c_core_disable() 139 u8 ctrl = readb(idev->base + CORE_I2C_CTRL); in mchp_corei2c_core_enable() local 141 ctrl |= CTRL_ENS1; in mchp_corei2c_core_enable() 142 writeb(ctrl, idev->base + CORE_I2C_CTRL); in mchp_corei2c_core_enable() 153 u8 ctrl = readb(idev->base + CORE_I2C_CTRL); in mchp_corei2c_stop() local [all …]
|
| /linux/drivers/dma/ |
| H A D | moxart-dma.c | 1 // SPDX-License-Identifier: GPL-2.0-only 11 #include <linux/dma-mapping.h> 28 #include "virt-dma.h" 63 * 101: -1 (Burst=0), -4 (Burst=1) 64 * 110: -2 (Burst=0), -8 (Burst=1) 65 * 111: -4 (Burst=0), -16 (Burst=1) 86 * e.g. MMC must always request channels where dma_slave_config->slave_id is 5. 89 * 1-15: Request / Grant signal 117 uint32_t len; member 159 return &chan->dev->device; in chan2dev() [all …]
|
| /linux/drivers/tty/hvc/ |
| H A D | hvsi_lib.c | 1 // SPDX-License-Identifier: GPL-2.0 12 packet->seqno = cpu_to_be16(atomic_inc_return(&pv->seqno)); in hvsi_send_packet() 15 return pv->put_chars(pv->termno, (u8 *)packet, packet->len); in hvsi_send_packet() 23 pv->established = 0; in hvsi_start_handshake() 24 atomic_set(&pv->seqno, 0); in hvsi_start_handshake() 26 pr_devel("HVSI@%x: Handshaking started\n", pv->termno); in hvsi_start_handshake() 30 q.hdr.len = sizeof(struct hvsi_query); in hvsi_start_handshake() 37 struct hvsi_control ctrl; in hvsi_send_close() local 39 pv->established = 0; in hvsi_send_close() 41 ctrl.hdr.type = VS_CONTROL_PACKET_HEADER; in hvsi_send_close() [all …]
|
| /linux/drivers/media/dvb-frontends/ |
| H A D | bcm3510.c | 4 * Copyright (C) 2001-5, B2C2 inc. 8 * This driver is "hard-coded" to be used with the 1st generation of 9 * Technisat/B2C2's Air2PC ATSC PCI/USB cards/boxes. The pll-programming 13 * The driver works also with QAM64 DVB-C, but had an unreasonable high 17 * called "dvb-fe-bcm3510-01.fw". 68 MODULE_PARM_DESC(debug, "set debugging level (1=info,2=i2c (|-able))."); 81 static int bcm3510_writebytes (struct bcm3510_state *state, u8 reg, u8 *buf, u8 len) in bcm3510_writebytes() argument 85 …struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = b, .len = len + 1 … in bcm3510_writebytes() 88 memcpy(&b[1],buf,len); in bcm3510_writebytes() 91 dbufout(buf,len,deb_i2c); in bcm3510_writebytes() [all …]
|
| /linux/arch/arm/include/asm/ |
| H A D | hw_breakpoint.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 15 len : 8, 25 struct arch_hw_breakpoint_ctrl ctrl; member 28 static inline u32 encode_ctrl_reg(struct arch_hw_breakpoint_ctrl ctrl) in encode_ctrl_reg() argument 30 return (ctrl.mismatch << 22) | (ctrl.len << 5) | (ctrl.type << 3) | in encode_ctrl_reg() 31 (ctrl.privilege << 1) | ctrl.enabled; in encode_ctrl_reg() 35 struct arch_hw_breakpoint_ctrl *ctrl) in decode_ctrl_reg() argument 37 ctrl->enabled = reg & 0x1; in decode_ctrl_reg() 39 ctrl->privilege = reg & 0x3; in decode_ctrl_reg() 41 ctrl->type = reg & 0x3; in decode_ctrl_reg() [all …]
|