Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | drivers/bluetooth/hci_ldisc.c | static void hci_uart_tty_wakeup(struct tty_struct *tty) {
struct hci_uart *hu = tty->disc_data;
BT_DBG("");
if (!hu)
return;
clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
if (tty != hu->tty)
return;
if (test_bit(HCI_UART_PROTO_READY, &hu->flags))
hci_uart_tx_wakeup(hu);
} | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_ldisc.c |
static int hci_uart_set_flags(struct hci_uart *hu, unsigned long flags) {
unsigned long valid_flags =
BIT(HCI_UART_RAW_DEVICE) | BIT(HCI_UART_RESET_ON_INIT) |
BIT(HCI_UART_CREATE_AMP) | BIT(HCI_UART_INIT_PENDING) |
BIT(HCI_UART_EXT_CONFIG) | BIT(HCI_UART_VND_DETECT);
if (flags & ~valid_flags)
... | [
1,
0
] |
Linux Kernel | drivers/bluetooth/hci_ll.c | static int send_command_from_firmware(struct ll_device *lldev,
struct hci_command *cmd) {
struct sk_buff *skb;
if (cmd->opcode == HCI_VS_UPDATE_UART_HCI_BAUDRATE) {
bt_dev_warn(lldev->hu.hdev, "change remote baud rate command in firmware");
return 0;
}
if (cmd->pr... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_mrvl.c | static struct sk_buff *mrvl_dequeue(struct hci_uart *hu) {
struct mrvl_data *mrvl = hu->priv;
struct sk_buff *skb;
skb = skb_dequeue(&mrvl->txq);
if (!skb) {
skb = skb_dequeue(&mrvl->rawq);
} else {
/* Prepend skb with frame type */
memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
}
retu... | [
1,
0
] |
Linux Kernel | drivers/bluetooth/hci_mrvl.c | static void mrvl_send_ack(struct hci_uart *hu, unsigned char type) {
struct mrvl_data *mrvl = hu->priv;
struct sk_buff *skb;
skb = bt_skb_alloc(0, GFP_ATOMIC);
if (!skb) {
bt_dev_err(hu->hdev, "Unable to alloc ack/nak packet");
return;
}
hci_skb_pkt_type(skb) = type;
skb_queue_tail(&mrvl->txq, s... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_mrvl.c |
static int mrvl_recv_chip_ver(struct hci_dev *hdev, struct sk_buff *skb) {
struct hci_mrvl_pkt *pkt = (void *)skb->data;
struct hci_uart *hu = hci_get_drvdata(hdev);
struct mrvl_data *mrvl = hu->priv;
u16 version = le16_to_cpu(pkt->lhs);
int ret = 0;
if ((pkt->lhs ^ pkt->rhs) != 0xffff) {
bt_dev_err(h... | [
1,
0
] |
Linux Kernel | drivers/bluetooth/hci_mrvl.c | static int mrvl_setup(struct hci_uart *hu) {
int err;
hci_uart_set_flow_control(hu, true);
err = mrvl_load_firmware(hu->hdev, "mrvl/helper_uart_3000000.bin");
if (err) {
bt_dev_err(hu->hdev, "Unable to download firmware helper");
return -EINVAL;
}
hci_uart_wait_until_sent(hu);
if (hu->serdev)
... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_nokia.c | static int nokia_reset(struct hci_uart *hu) {
struct nokia_bt_dev *btdev = hu->priv;
struct device *dev = &btdev->serdev->dev;
int err;
gpiod_set_value_cansleep(btdev->reset, 1);
gpiod_set_value_cansleep(btdev->wakeup_bt, 1);
msleep(100);
/* safety check */
err = gpiod_get_value_cansleep(btdev->wakeu... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_nokia.c |
static struct sk_buff *nokia_dequeue(struct hci_uart *hu) {
struct nokia_bt_dev *btdev = hu->priv;
struct device *dev = &btdev->serdev->dev;
struct sk_buff *result = skb_dequeue(&btdev->txq);
if (!btdev->initialized)
return result;
if (btdev->tx_enabled == !!result)
return result;
if (result) {
... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_nokia.c |
static void nokia_bluetooth_serdev_remove(struct serdev_device *serdev) {
struct nokia_bt_dev *btdev = serdev_device_get_drvdata(serdev);
hci_uart_unregister_device(&btdev->hu);
} | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_qca.c | static int send_hci_ibs_cmd(u8 cmd, struct hci_uart *hu) {
int err = 0;
struct sk_buff *skb = NULL;
struct qca_data *qca = hu->priv;
BT_DBG("hu %p send hci ibs cmd 0x%x", hu, cmd);
skb = bt_skb_alloc(1, GFP_ATOMIC);
if (!skb) {
BT_ERR("Failed to allocate memory for HCI_IBS packet");
return -ENOMEM... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_qca.c | static void qca_wq_awake_device(struct work_struct *work) {
struct qca_data *qca = container_of(work, struct qca_data, ws_awake_device);
struct hci_uart *hu = qca->hu;
unsigned long retrans_delay;
unsigned long flags;
BT_DBG("hu %p wq awake device", hu);
serial_clock_vote(HCI_IBS_TX_VOTE_CLOCK_ON, hu);
... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_qca.c |
static void qca_wq_serial_rx_clock_vote_off(struct work_struct *work) {
struct qca_data *qca = container_of(work, struct qca_data, ws_rx_vote_off);
struct hci_uart *hu = qca->hu;
BT_DBG("hu %p rx clock vote off", hu);
serial_clock_vote(HCI_IBS_RX_VOTE_CLOCK_OFF, hu);
} | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_qca.c | static void qca_controller_memdump_timeout(struct work_struct *work) {
struct qca_data *qca =
container_of(work, struct qca_data, ctrl_memdump_timeout.work);
struct hci_uart *hu = qca->hu;
mutex_lock(&qca->hci_memdump_lock);
if (test_bit(QCA_MEMDUMP_COLLECTION, &qca->flags)) {
qca->memdump_state = QC... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_qca.c | static int qca_close(struct hci_uart *hu) {
struct qca_data *qca = hu->priv;
BT_DBG("hu %p qca close", hu);
serial_clock_vote(HCI_IBS_VOTE_STATS_UPDATE, hu);
skb_queue_purge(&qca->tx_wait_q);
skb_queue_purge(&qca->txq);
skb_queue_purge(&qca->rx_memdump_q);
timer_shutdown_sync(&qca->tx_idle_timer);
t... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_qca.c | static void device_want_to_wakeup(struct hci_uart *hu) {
unsigned long flags;
struct qca_data *qca = hu->priv;
BT_DBG("hu %p want to wake up", hu);
spin_lock_irqsave(&qca->hci_ibs_lock, flags);
qca->ibs_recv_wakes++;
if (test_bit(QCA_SUSPENDING, &qca->flags)) {
spin_unlock_irqrestore(&qca->hci_ibs_l... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_qca.c | static void device_want_to_sleep(struct hci_uart *hu) {
unsigned long flags;
struct qca_data *qca = hu->priv;
BT_DBG("hu %p want to sleep in %d state", hu, qca->rx_ibs_state);
spin_lock_irqsave(&qca->hci_ibs_lock, flags);
qca->ibs_recv_slps++;
switch (qca->rx_ibs_state) {
case HCI_IBS_RX_AWAKE:
q... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_qca.c |
static int qca_ibs_sleep_ind(struct hci_dev *hdev, struct sk_buff *skb) {
struct hci_uart *hu = hci_get_drvdata(hdev);
BT_DBG("hu %p recv hci ibs cmd 0x%x", hu, HCI_IBS_SLEEP_IND);
device_want_to_sleep(hu);
kfree_skb(skb);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_qca.c |
static uint8_t qca_get_baudrate_value(int speed) {
switch (speed) {
case 9600:
return QCA_BAUDRATE_9600;
case 19200:
return QCA_BAUDRATE_19200;
case 38400:
return QCA_BAUDRATE_38400;
case 57600:
return QCA_BAUDRATE_57600;
case 115200:
return QCA_BAUDRATE_115200;
case 230400:
retur... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_qca.c |
static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed) {
if (hu->serdev)
serdev_device_set_baudrate(hu->serdev, speed);
else
hci_uart_set_baudrate(hu, speed);
} | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_qca.c | static int qca_send_power_pulse(struct hci_uart *hu, bool on) {
int ret;
int timeout = msecs_to_jiffies(CMD_TRANS_TIMEOUT_MS);
u8 cmd = on ? QCA_WCN3990_POWERON_PULSE : QCA_WCN3990_POWEROFF_PULSE;
bt_dev_dbg(hu->hdev, "sending power pulse %02x to controller", cmd);
serdev_device_write_flush(hu->serdev);
h... | [
1,
0
] |
Linux Kernel | drivers/bluetooth/hci_qca.c | static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type) {
unsigned int speed, qca_baudrate;
struct qca_data *qca = hu->priv;
int ret = 0;
if (speed_type == QCA_INIT_SPEED) {
speed = qca_get_speed(hu, QCA_INIT_SPEED);
if (speed)
host_set_baudrate(hu, speed);
} else {
en... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_qca.c |
static void qca_wait_for_dump_collection(struct hci_dev *hdev) {
struct hci_uart *hu = hci_get_drvdata(hdev);
struct qca_data *qca = hu->priv;
wait_on_bit_timeout(&qca->flags, QCA_MEMDUMP_COLLECTION, TASK_UNINTERRUPTIBLE,
MEMDUMP_TIMEOUT_MS);
clear_bit(QCA_MEMDUMP_COLLECTION, &qca->flag... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_qca.c | static void qca_cmd_timeout(struct hci_dev *hdev) {
struct hci_uart *hu = hci_get_drvdata(hdev);
struct qca_data *qca = hu->priv;
set_bit(QCA_SSR_TRIGGERED, &qca->flags);
if (qca->memdump_state == QCA_MEMDUMP_IDLE) {
set_bit(QCA_MEMDUMP_COLLECTION, &qca->flags);
qca_send_crashbuffer(hu);
qca_wait_f... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_qca.c | static void qca_power_shutdown(struct hci_uart *hu) {
struct qca_serdev *qcadev;
struct qca_data *qca = hu->priv;
unsigned long flags;
enum qca_btsoc_type soc_type = qca_soc_type(hu);
bool sw_ctrl_state;
spin_lock_irqsave(&qca->hci_ibs_lock, flags);
set_bit(QCA_IBS_DISABLED, &qca->flags);
qca_flush(hu)... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_qca.c | static void qca_regulator_disable(struct qca_serdev *qcadev) {
struct qca_power *power;
if (!qcadev)
return;
power = qcadev->bt_power;
if (!power->vregs_on)
return;
regulator_bulk_disable(power->num_vregs, power->vreg_bulk);
power->vregs_on = false;
clk_disable_unprepare(qcadev->susclk);
} | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_qca.c |
static int __maybe_unused qca_resume(struct device *dev) {
struct serdev_device *serdev = to_serdev_device(dev);
struct qca_serdev *qcadev = serdev_device_get_drvdata(serdev);
struct hci_uart *hu = &qcadev->serdev_hu;
struct qca_data *qca = hu->priv;
clear_bit(QCA_SUSPENDING, &qca->flags);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_serdev.c |
static inline struct sk_buff *hci_uart_dequeue(struct hci_uart *hu) {
struct sk_buff *skb = hu->tx_skb;
if (!skb) {
if (test_bit(HCI_UART_PROTO_READY, &hu->flags))
skb = hu->proto->dequeue(hu);
} else
hu->tx_skb = NULL;
return skb;
} | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_serdev.c | static void hci_uart_write_work(struct work_struct *work) {
struct hci_uart *hu = container_of(work, struct hci_uart, write_work);
struct serdev_device *serdev = hu->serdev;
struct hci_dev *hdev = hu->hdev;
struct sk_buff *skb;
do {
clear_bit(HCI_UART_TX_WAKEUP, &hu->tx_state);
while ((skb = hci_uar... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_serdev.c | static int hci_uart_open(struct hci_dev *hdev) {
struct hci_uart *hu = hci_get_drvdata(hdev);
int err;
BT_DBG("%s %p", hdev->name, hdev);
if (!test_bit(HCI_UART_PROTO_READY, &hu->flags)) {
err = serdev_device_open(hu->serdev);
if (err)
return err;
set_bit(HCI_UART_PROTO_READY, &hu->flags);
... | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_serdev.c | static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb) {
struct hci_uart *hu = hci_get_drvdata(hdev);
BT_DBG("%s: type %d len %d", hdev->name, hci_skb_pkt_type(skb), skb->len);
hu->proto->enqueue(hu, skb);
hci_uart_tx_wakeup(hu);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_vhci.c |
static int vhci_flush(struct hci_dev *hdev) {
struct vhci_data *data = hci_get_drvdata(hdev);
skb_queue_purge(&data->readq);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_vhci.c |
static int vhci_get_data_path_id(struct hci_dev *hdev, u8 *data_path_id) {
*data_path_id = 0;
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_vhci.c |
static bool vhci_wakeup(struct hci_dev *hdev) {
struct vhci_data *data = hci_get_drvdata(hdev);
return data->wakeup;
} | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_vhci.c |
static int vhci_create_device(struct vhci_data *data, __u8 opcode) {
int err;
mutex_lock(&data->open_mutex);
err = __vhci_create_device(data, opcode);
mutex_unlock(&data->open_mutex);
return err;
} | [
0,
0
] |
Linux Kernel | drivers/bluetooth/hci_vhci.c |
static void vhci_open_timeout(struct work_struct *work) {
struct vhci_data *data =
container_of(work, struct vhci_data, open_timeout.work);
vhci_create_device(data, amp ? HCI_AMP : HCI_PRIMARY);
} | [
0,
0
] |
Linux Kernel | drivers/bluetooth/virtio_bt.c | static int virtbt_set_bdaddr_zephyr(struct hci_dev *hdev,
const bdaddr_t *bdaddr) {
struct sk_buff *skb;
skb = __hci_cmd_sync(hdev, 0xfc06, 6, bdaddr, HCI_INIT_TIMEOUT);
if (IS_ERR(skb))
return PTR_ERR(skb);
kfree_skb(skb);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/bluetooth/virtio_bt.c | static int virtbt_setup_intel(struct hci_dev *hdev) {
struct sk_buff *skb;
skb = __hci_cmd_sync(hdev, 0xfc05, 0, NULL, HCI_CMD_TIMEOUT);
if (IS_ERR(skb))
return PTR_ERR(skb);
kfree_skb(skb);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/bluetooth/virtio_bt.c | static int virtbt_shutdown_generic(struct hci_dev *hdev) {
struct sk_buff *skb;
skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT);
if (IS_ERR(skb))
return PTR_ERR(skb);
kfree_skb(skb);
return 0;
} | [
0,
0
] |
Linux Kernel | drivers/bluetooth/virtio_bt.c |
static void virtbt_rx_handle(struct virtio_bluetooth *vbt,
struct sk_buff *skb) {
__u8 pkt_type;
pkt_type = *((__u8 *)skb->data);
skb_pull(skb, 1);
switch (pkt_type) {
case HCI_EVENT_PKT:
case HCI_ACLDATA_PKT:
case HCI_SCODATA_PKT:
case HCI_ISODATA_PKT:
hci_skb_pkt_ty... | [
0,
0
] |
Linux Kernel | drivers/bus/arm-cci.c |
static int __init cci_platform_init(void) {
return platform_driver_register(&cci_platform_driver);
}
#ifdef CONFIG_ARM_CCI400_PORT_CTRL
#define CCI_PORT_CTRL 0x0
#define CCI_CTRL_STATUS 0xc
#define CCI_ENABLE_SNOOP_REQ 0x1
#define CCI_ENABLE_DVM_REQ 0x2
#define CCI_ENABLE_REQ (CCI_ENABLE_SNOOP_REQ | CCI_ENABLE_DV... | [
0,
0
] |
Linux Kernel | drivers/bus/arm-cci.c |
static inline void init_cpu_port(struct cpu_port *port, u32 index, u64 mpidr) {
port->port = PORT_VALID | index;
port->mpidr = mpidr;
} | [
0,
0
] |
Linux Kernel | drivers/bus/arm-cci.c |
static inline bool cpu_port_match(struct cpu_port *port, u64 mpidr) {
return port->mpidr == (mpidr & MPIDR_HWID_BITMASK);
} | [
0,
0
] |
Linux Kernel | drivers/bus/arm-cci.c | static void cci_ace_init_ports(void) {
int port, cpu;
struct device_node *cpun;
for_each_possible_cpu(cpu) {
/* too early to use cpu->of_node */
cpun = of_get_cpu_node(cpu, NULL);
if (WARN(!cpun, "Missing cpu device node\n"))
continue;
port = __cci_ace_get_port(cpun, ACE_PORT);
if (po... | [
0,
0
] |
Linux Kernel | drivers/bus/arm-cci.c |
static int cci_probe(void) {
int ret;
struct device_node *np;
struct resource res;
np = of_find_matching_node(NULL, arm_cci_matches);
if (!of_device_is_available(np))
return -ENODEV;
ret = of_address_to_resource(np, 0, &res);
if (!ret) {
cci_ctrl_base = ioremap(res.start, resource_size(&res));
... | [
0,
0
] |
Linux Kernel | drivers/bus/brcmstb_gisb.c |
static ssize_t gisb_arb_get_timeout(struct device *dev,
struct device_attribute *attr, char *buf) {
struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev);
u32 timeout;
mutex_lock(&gdev->lock);
timeout = gisb_read(gdev, ARB_TIMER);
mutex_unlock(&gdev->lock);
retur... | [
1,
0
] |
Linux Kernel | drivers/bus/brcmstb_gisb.c |
static ssize_t gisb_arb_set_timeout(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count) {
struct brcmstb_gisb_arb_device *gdev = dev_get_drvdata(dev);
int val, ret;
ret = kstrtoint(buf, 10, &val);
if (ret < 0... | [
0,
0
] |
Linux Kernel | drivers/bus/bt1-apb.c |
static inline unsigned long bt1_apb_timeout_to_n_us(struct bt1_apb *apb,
unsigned long timeout) {
u64 n = (u64)timeout * apb->rate;
do_div(n, USEC_PER_SEC);
return n;
} | [
0,
0
] |
Linux Kernel | drivers/bus/bt1-apb.c | static irqreturn_t bt1_apb_isr(int irq, void *data) {
struct bt1_apb *apb = data;
u32 addr = 0;
regmap_read(apb->regs, APB_EHB_ADDR, &addr);
dev_crit_ratelimited(apb->dev,
"APB-bus fault %d: Slave access timeout at 0x%08x\n",
atomic_inc_return(&apb->count), addr);... | [
1,
0
] |
Linux Kernel | drivers/bus/bt1-apb.c |
static int bt1_apb_request_regs(struct bt1_apb *apb) {
struct platform_device *pdev = to_platform_device(apb->dev);
void __iomem *regs;
regs = devm_platform_ioremap_resource_byname(pdev, "ehb");
if (IS_ERR(regs)) {
dev_err(apb->dev, "Couldn't map APB EHB registers\n");
return PTR_ERR(regs);
}
apb... | [
0,
0
] |
Linux Kernel | drivers/bus/bt1-apb.c |
static void bt1_apb_disable_clk(void *data) {
struct bt1_apb *apb = data;
clk_disable_unprepare(apb->pclk);
} | [
0,
0
] |
Linux Kernel | drivers/bus/bt1-apb.c |
static int bt1_apb_request_clk(struct bt1_apb *apb) {
int ret;
apb->pclk = devm_clk_get(apb->dev, "pclk");
if (IS_ERR(apb->pclk))
return dev_err_probe(apb->dev, PTR_ERR(apb->pclk),
"Couldn't get APB clock descriptor\n");
ret = clk_prepare_enable(apb->pclk);
if (ret) {
dev_e... | [
0,
0
] |
Linux Kernel | drivers/bus/bt1-apb.c |
static ssize_t count_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct bt1_apb *apb = dev_get_drvdata(dev);
return scnprintf(buf, PAGE_SIZE, "%d\n", atomic_read(&apb->count));
} | [
0,
0
] |
Linux Kernel | drivers/bus/bt1-apb.c |
static ssize_t timeout_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct bt1_apb *apb = dev_get_drvdata(dev);
unsigned long timeout;
int ret;
u32 n;
ret = regmap_read(apb->regs, APB_EHB_TIMEOUT, &n);
if (ret)
return ret;
timeout = bt1_apb_n_to_t... | [
0,
0
] |
Linux Kernel | drivers/bus/bt1-apb.c |
static void bt1_apb_remove_sysfs(void *data) {
struct bt1_apb *apb = data;
device_remove_groups(apb->dev, bt1_apb_sysfs_groups);
} | [
0,
0
] |
Linux Kernel | drivers/bus/bt1-apb.c |
static int bt1_apb_init_sysfs(struct bt1_apb *apb) {
int ret;
ret = device_add_groups(apb->dev, bt1_apb_sysfs_groups);
if (ret) {
dev_err(apb->dev, "Failed to create EHB APB sysfs nodes\n");
return ret;
}
ret = devm_add_action_or_reset(apb->dev, bt1_apb_remove_sysfs, apb);
if (ret)
dev_err(ap... | [
0,
0
] |
Linux Kernel | drivers/bus/bt1-axi.c |
static void bt1_axi_clear_data(void *data) {
struct bt1_axi *axi = data;
struct platform_device *pdev = to_platform_device(axi->dev);
platform_set_drvdata(pdev, NULL);
} | [
0,
0
] |
Linux Kernel | drivers/bus/bt1-axi.c |
static int bt1_axi_request_regs(struct bt1_axi *axi) {
struct platform_device *pdev = to_platform_device(axi->dev);
struct device *dev = axi->dev;
axi->sys_regs = syscon_regmap_lookup_by_phandle(dev->of_node, "syscon");
if (IS_ERR(axi->sys_regs)) {
dev_err(dev, "Couldn't find syscon registers\n");
ret... | [
0,
0
] |
Linux Kernel | drivers/bus/bt1-axi.c |
static int bt1_axi_request_rst(struct bt1_axi *axi) {
int ret;
axi->arst = devm_reset_control_get_optional_exclusive(axi->dev, "arst");
if (IS_ERR(axi->arst))
return dev_err_probe(axi->dev, PTR_ERR(axi->arst),
"Couldn't get reset control line\n");
ret = reset_control_deassert(axi... | [
0,
0
] |
Linux Kernel | drivers/bus/bt1-axi.c |
static int bt1_axi_request_irq(struct bt1_axi *axi) {
struct platform_device *pdev = to_platform_device(axi->dev);
int ret;
axi->irq = platform_get_irq(pdev, 0);
if (axi->irq < 0)
return axi->irq;
ret = devm_request_irq(axi->dev, axi->irq, bt1_axi_isr, IRQF_SHARED,
"bt1-axi", a... | [
0,
0
] |
Linux Kernel | drivers/bus/bt1-axi.c |
static int bt1_axi_probe(struct platform_device *pdev) {
struct bt1_axi *axi;
int ret;
axi = bt1_axi_create_data(pdev);
if (IS_ERR(axi))
return PTR_ERR(axi);
ret = bt1_axi_request_regs(axi);
if (ret)
return ret;
ret = bt1_axi_request_rst(axi);
if (ret)
return ret;
ret = bt1_axi_reques... | [
0,
0
] |
Linux Kernel | drivers/bus/da8xx-mstpri.c |
static int da8xx_mstpri_probe(struct platform_device *pdev) {
const struct da8xx_mstpri_board_priorities *prio_list;
const struct da8xx_mstpri_descr *prio_descr;
const struct da8xx_mstpri_priority *prio;
struct device *dev = &pdev->dev;
struct resource *res;
void __iomem *mstpri;
u32 reg;
int i;
res... | [
1,
0
] |
Linux Kernel | drivers/bus/fsl-mc/dpbp.c | int dpbp_enable(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token) {
struct fsl_mc_command cmd = {0};
cmd.header = mc_encode_cmd_header(DPBP_CMDID_ENABLE, cmd_flags, token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
} | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/dpbp.c | int dpbp_reset(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token) {
struct fsl_mc_command cmd = {0};
cmd.header = mc_encode_cmd_header(DPBP_CMDID_RESET, cmd_flags, token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
} | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/dpbp.c | int dpbp_get_attributes(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
struct dpbp_attr *attr) {
struct fsl_mc_command cmd = {0};
struct dpbp_rsp_get_attributes *rsp_params;
int err;
cmd.header = mc_encode_cmd_header(DPBP_CMDID_GET_ATTR, cmd_flags, token);
/* send command to mc*/... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/dpcon.c | int dpcon_disable(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token) {
struct fsl_mc_command cmd = {0};
cmd.header = mc_encode_cmd_header(DPCON_CMDID_DISABLE, cmd_flags, token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
} | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/dpcon.c | int dpcon_set_notification(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
struct dpcon_notification_cfg *cfg) {
struct fsl_mc_command cmd = {0};
struct dpcon_cmd_set_notification *dpcon_cmd;
cmd.header =
mc_encode_cmd_header(DPCON_CMDID_SET_NOTIFICATION, cmd_flags, token);
... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/dpmcp.c | int dpmcp_open(struct fsl_mc_io *mc_io, u32 cmd_flags, int dpmcp_id,
u16 *token) {
struct fsl_mc_command cmd = {0};
struct dpmcp_cmd_open *cmd_params;
int err;
cmd.header = mc_encode_cmd_header(DPMCP_CMDID_OPEN, cmd_flags, 0);
cmd_params = (struct dpmcp_cmd_open *)cmd.params;
cmd_params->dpm... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/dpmcp.c | int dpmcp_close(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token) {
struct fsl_mc_command cmd = {0};
cmd.header = mc_encode_cmd_header(DPMCP_CMDID_CLOSE, cmd_flags, token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
} | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/dprc-driver.c |
static int __fsl_mc_device_match(struct device *dev, void *data) {
struct fsl_mc_obj_desc *obj_desc = data;
struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
return fsl_mc_device_match(mc_dev, obj_desc);
} | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/dprc-driver.c | static int register_dprc_irq_handler(struct fsl_mc_device *mc_dev) {
int error;
struct fsl_mc_device_irq *irq = mc_dev->irqs[0];
error = devm_request_threaded_irq(
&mc_dev->dev, irq->virq, dprc_irq0_handler, dprc_irq0_handler_thread,
IRQF_NO_SUSPEND | IRQF_ONESHOT, dev_name(&mc_dev->dev), &mc_dev->de... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/dprc-driver.c | static int dprc_probe(struct fsl_mc_device *mc_dev) {
int error;
error = dprc_setup(mc_dev);
if (error < 0)
return error;
error = dprc_scan_container(mc_dev, true);
if (error < 0)
goto dprc_cleanup;
/*
* Configure interrupt for the DPRC object associated with this MC bus:
*/
error = dprc_... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/dprc-driver.c | static int dprc_remove(struct fsl_mc_device *mc_dev) {
struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_dev);
if (!is_fsl_mc_bus_dprc(mc_dev))
return -EINVAL;
if (!mc_bus->irq_resources)
return -EINVAL;
if (dev_get_msi_domain(&mc_dev->dev))
dprc_teardown_irq(mc_dev);
device_for_each_child(&mc_dev-... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/dprc.c | int dprc_open(struct fsl_mc_io *mc_io, u32 cmd_flags, int container_id,
u16 *token) {
struct fsl_mc_command cmd = {0};
struct dprc_cmd_open *cmd_params;
int err;
cmd.header = mc_encode_cmd_header(DPRC_CMDID_OPEN, cmd_flags, 0);
cmd_params = (struct dprc_cmd_open *)cmd.params;
cmd_params->cont... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/dprc.c | int dprc_close(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token) {
struct fsl_mc_command cmd = {0};
cmd.header = mc_encode_cmd_header(DPRC_CMDID_CLOSE, cmd_flags, token);
/* send command to mc*/
return mc_send_command(mc_io, &cmd);
} | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/dprc.c | int dprc_get_irq_status(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
u8 irq_index, u32 *status) {
struct fsl_mc_command cmd = {0};
struct dprc_cmd_get_irq_status *cmd_params;
struct dprc_rsp_get_irq_status *rsp_params;
int err;
cmd.header =
mc_encode_cmd_header(DPRC_CMDID_... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/dprc.c | int dprc_get_obj(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
int obj_index, struct fsl_mc_obj_desc *obj_desc) {
struct fsl_mc_command cmd = {0};
struct dprc_cmd_get_obj *cmd_params;
struct dprc_rsp_get_obj *rsp_params;
int err;
cmd.header = mc_encode_cmd_header(DPRC_CMDID_GET_OBJ, cmd... | [
1,
0
] |
Linux Kernel | drivers/bus/fsl-mc/dprc.c | int dprc_get_api_version(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 *major_ver,
u16 *minor_ver) {
struct fsl_mc_command cmd = {0};
int err;
cmd.header = mc_encode_cmd_header(DPRC_CMDID_GET_API_VERSION, cmd_flags, 0);
/* send command to mc */
err = mc_send_command(mc_io, &cmd);
if... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/dprc.c | int dprc_get_connection(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
const struct dprc_endpoint *endpoint1,
struct dprc_endpoint *endpoint2, int *state) {
struct dprc_cmd_get_connection *cmd_params;
struct dprc_rsp_get_connection *rsp_params;
struct fsl_mc_com... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-allocator.c | static int __must_check fsl_mc_resource_pool_add_device(
struct fsl_mc_bus *mc_bus, enum fsl_mc_pool_type pool_type,
struct fsl_mc_device *mc_dev) {
struct fsl_mc_resource_pool *res_pool;
struct fsl_mc_resource *resource;
struct fsl_mc_device *mc_bus_dev = &mc_bus->mc_dev;
int error = -EINVAL;
if (po... | [
1,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-allocator.c |
void fsl_mc_resource_free(struct fsl_mc_resource *resource) {
struct fsl_mc_resource_pool *res_pool;
res_pool = resource->parent_pool;
if (resource->type != res_pool->type)
return;
mutex_lock(&res_pool->mutex);
if (res_pool->free_count < 0 || res_pool->free_count >= res_pool->max_count)
goto out_un... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-allocator.c | int __must_check fsl_mc_object_allocate(struct fsl_mc_device *mc_dev,
enum fsl_mc_pool_type pool_type,
struct fsl_mc_device **new_mc_adev) {
struct fsl_mc_device *mc_bus_dev;
struct fsl_mc_bus *mc_bus;
struct fsl_mc_device *mc_adev;
... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-allocator.c |
void fsl_mc_allocator_driver_exit(void) {
fsl_mc_driver_unregister(&fsl_mc_allocator_driver);
} | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-bus.c |
static void fsl_mc_dma_cleanup(struct device *dev) {
struct fsl_mc_driver *mc_drv = to_fsl_mc_driver(dev->driver);
if (!mc_drv->driver_managed_dma)
iommu_device_unuse_default_domain(dev);
} | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-bus.c |
static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
char *buf) {
struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
return sprintf(buf, "fsl-mc:v%08Xd%s\n", mc_dev->obj_desc.vendor,
mc_dev->obj_desc.type);
} | [
1,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-bus.c |
static ssize_t rescan_store(struct bus_type *bus, const char *buf,
size_t count) {
unsigned long val;
if (kstrtoul(buf, 0, &val) < 0)
return -EINVAL;
if (val)
bus_for_each_dev(bus, NULL, NULL, scan_fsl_mc_bus);
return count;
} | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-bus.c |
static int fsl_mc_bus_get_autorescan(struct device *dev, void *data) {
struct fsl_mc_device *root_mc_dev;
char *buf = data;
if (!fsl_mc_is_root_dprc(dev))
goto exit;
root_mc_dev = to_fsl_mc_device(dev);
sprintf(buf, "%d\n", get_dprc_irq_state(root_mc_dev));
exit:
return 0;
} | [
1,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-bus.c |
static int fsl_mc_driver_probe(struct device *dev) {
struct fsl_mc_driver *mc_drv;
struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
int error;
mc_drv = to_fsl_mc_driver(dev->driver);
error = mc_drv->probe(mc_dev);
if (error < 0) {
if (error != -EPROBE_DEFER)
dev_err(dev, "%s failed: %d\n",... | [
1,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-bus.c |
static int fsl_mc_driver_remove(struct device *dev) {
struct fsl_mc_driver *mc_drv = to_fsl_mc_driver(dev->driver);
struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
int error;
error = mc_drv->remove(mc_dev);
if (error < 0) {
dev_err(dev, "%s failed: %d\n", __func__, error);
return error;
}
... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-bus.c |
static void fsl_mc_driver_shutdown(struct device *dev) {
struct fsl_mc_driver *mc_drv = to_fsl_mc_driver(dev->driver);
struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
mc_drv->shutdown(mc_dev);
} | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-bus.c |
static int get_dprc_attr(struct fsl_mc_io *mc_io, int container_id,
struct dprc_attributes *attr) {
u16 dprc_handle;
int error;
error = dprc_open(mc_io, 0, container_id, &dprc_handle);
if (error < 0) {
dev_err(mc_io->dev, "dprc_open() failed: %d\n", error);
return error;
}
... | [
1,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-bus.c | struct fsl_mc_device *fsl_mc_get_endpoint(struct fsl_mc_device *mc_dev,
u16 if_id) {
struct fsl_mc_device *mc_bus_dev, *endpoint;
struct fsl_mc_obj_desc endpoint_desc = {{0}};
struct dprc_endpoint endpoint1 = {{0}};
struct dprc_endpoint endpoint2 = {{0}};
int state, e... | [
1,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-bus.c | static int fsl_mc_bus_notifier(struct notifier_block *nb, unsigned long action,
void *data) {
struct device *dev = data;
struct resource *res;
void __iomem *fsl_mc_regs;
if (action != BUS_NOTIFY_ADD_DEVICE)
return 0;
if (!of_match_device(fsl_mc_bus_match_table, dev) &&
... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-bus.c |
static int __init fsl_mc_bus_driver_init(void) {
int error;
error = bus_register(&fsl_mc_bus_type);
if (error < 0) {
pr_err("bus type registration failed: %d\n", error);
goto error_cleanup_cache;
}
error = platform_driver_register(&fsl_mc_bus_driver);
if (error < 0) {
pr_err("platform_driver_... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-msi.c |
static void fsl_mc_msi_set_desc(msi_alloc_info_t *arg, struct msi_desc *desc) {
arg->desc = desc;
arg->hwirq = fsl_mc_domain_calc_hwirq(to_fsl_mc_device(desc->dev), desc);
} | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-msi.c | static void fsl_mc_msi_update_chip_ops(struct msi_domain_info *info) {
struct irq_chip *chip = info->chip;
if (!chip)
return;
if (!chip->irq_write_msi_msg)
chip->irq_write_msi_msg = fsl_mc_msi_write_msg;
} | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-uapi.c |
static int fsl_mc_uapi_dev_open(struct inode *inode, struct file *filep) {
struct fsl_mc_device *root_mc_device;
struct uapi_priv_data *priv_data;
struct fsl_mc_io *dynamic_mc_io;
struct fsl_mc_uapi *mc_uapi;
struct fsl_mc_bus *mc_bus;
int error;
priv_data = kzalloc(sizeof(*priv_data), GFP_KERNEL);
if... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-uapi.c |
static int fsl_mc_uapi_dev_release(struct inode *inode, struct file *filep) {
struct uapi_priv_data *priv_data;
struct fsl_mc_uapi *mc_uapi;
struct fsl_mc_io *mc_io;
priv_data = filep->private_data;
mc_uapi = priv_data->uapi;
mc_io = priv_data->mc_io;
mutex_lock(&mc_uapi->mutex);
if (mc_io == mc_uap... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-uapi.c |
static long fsl_mc_uapi_dev_ioctl(struct file *file, unsigned int cmd,
unsigned long arg) {
struct uapi_priv_data *priv_data = file->private_data;
struct fsl_mc_device *root_mc_device;
struct fsl_mc_bus *mc_bus;
int error;
mc_bus = container_of(priv_data->uapi, struct fsl_m... | [
0,
0
] |
Linux Kernel | drivers/bus/fsl-mc/fsl-mc-uapi.c |
void fsl_mc_uapi_remove_device_file(struct fsl_mc_bus *mc_bus) {
misc_deregister(&mc_bus->uapi_misc.misc);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.