/linux/drivers/ssb/ |
H A D | pcmcia.c | 3 * PCMCIA-Hostbus related functions 6 * Copyright 2007-2008 Michael Buesch <m@bues.ch> 71 static int ssb_pcmcia_cfg_write(struct ssb_bus *bus, u8 offset, u8 value) in ssb_pcmcia_cfg_write() argument 75 res = pcmcia_write_config_byte(bus->host_pcmcia, offset, value); in ssb_pcmcia_cfg_write() 77 return -EBUSY; in ssb_pcmcia_cfg_write() 83 static int ssb_pcmcia_cfg_read(struct ssb_bus *bus, u8 offset, u8 *value) in ssb_pcmcia_cfg_read() argument 87 res = pcmcia_read_config_byte(bus->host_pcmcia, offset, value); in ssb_pcmcia_cfg_read() 89 return -EBUSY; in ssb_pcmcia_cfg_read() 94 int ssb_pcmcia_switch_coreidx(struct ssb_bus *bus, in ssb_pcmcia_switch_coreidx() argument 97 int err; in ssb_pcmcia_switch_coreidx() local [all …]
|
H A D | main.c | 20 #include <linux/dma-mapping.h> 33 /* Temporary list of yet-to-be-attached buses */ 44 /* There are differences in the codeflow, if the bus is 60 struct ssb_bus *bus; in ssb_pci_dev_to_bus() local 63 list_for_each_entry(bus, &buses, list) { in ssb_pci_dev_to_bus() 64 if (bus->bustype == SSB_BUSTYPE_PCI && in ssb_pci_dev_to_bus() 65 bus->host_pci == pdev) in ssb_pci_dev_to_bus() 68 bus = NULL; in ssb_pci_dev_to_bus() 72 return bus; in ssb_pci_dev_to_bus() 79 struct ssb_bus *bus; in ssb_pcmcia_dev_to_bus() local [all …]
|
H A D | driver_gpio.c | 6 * Copyright 2012, Hauke Mehrtens <hauke@hauke-m.de> 28 struct ssb_bus *bus = gpiochip_get_data(chip); in ssb_gpio_to_irq() local 30 if (bus->bustype == SSB_BUSTYPE_SSB) in ssb_gpio_to_irq() 31 return irq_find_mapping(bus->irq_domain, gpio); in ssb_gpio_to_irq() 33 return -EINVAL; in ssb_gpio_to_irq() 43 struct ssb_bus *bus = gpiochip_get_data(chip); in ssb_gpio_chipco_get_value() local 45 return !!ssb_chipco_gpio_in(&bus->chipco, 1 << gpio); in ssb_gpio_chipco_get_value() 51 struct ssb_bus *bus = gpiochip_get_data(chip); in ssb_gpio_chipco_set_value() local 53 ssb_chipco_gpio_out(&bus->chipco, 1 << gpio, value ? 1 << gpio : 0); in ssb_gpio_chipco_set_value() 59 struct ssb_bus *bus = gpiochip_get_data(chip); in ssb_gpio_chipco_direction_input() local [all …]
|
H A D | sprom.c | 5 * Copyright (C) 2005-2008 Michael Buesch <m@bues.ch> 6 * Copyright (C) 2005 Martin Langer <martin-langer@gmx.de> 29 pos += scnprintf(buf + pos, buf_len - pos - 1, in sprom2hex() 31 pos += scnprintf(buf + pos, buf_len - pos - 1, "\n"); in sprom2hex() 40 int err, cnt = 0; in hex2sprom() local 45 c = dump[len - 1]; in hex2sprom() 48 len--; in hex2sprom() 52 return -EINVAL; in hex2sprom() 57 err = kstrtoul(tmp, 16, &parsed); in hex2sprom() 58 if (err) in hex2sprom() [all …]
|
H A D | pci.c | 2 * Sonics Silicon Backplane PCI-Hostbus related functions. 4 * Copyright (C) 2005-2006 Michael Buesch <m@bues.ch> 5 * Copyright (C) 2005 Martin Langer <martin-langer@gmx.de> 32 int ssb_pci_switch_coreidx(struct ssb_bus *bus, u8 coreidx) in ssb_pci_switch_coreidx() argument 34 int err; in ssb_pci_switch_coreidx() local 39 err = pci_write_config_dword(bus->host_pci, SSB_BAR0_WIN, in ssb_pci_switch_coreidx() 42 if (err) in ssb_pci_switch_coreidx() 44 err = pci_read_config_dword(bus->host_pci, SSB_BAR0_WIN, in ssb_pci_switch_coreidx() 46 if (err) in ssb_pci_switch_coreidx() 48 cur_core = (cur_core - SSB_ENUM_BASE) in ssb_pci_switch_coreidx() [all …]
|
H A D | embedded.c | 5 * Copyright 2005-2008, Broadcom Corporation 6 * Copyright 2006-2008, Michael Buesch <m@bues.ch> 7 * Copyright 2012, Hauke Mehrtens <hauke@hauke-m.de> 23 int ssb_watchdog_timer_set(struct ssb_bus *bus, u32 ticks) in ssb_watchdog_timer_set() argument 25 if (ssb_chipco_available(&bus->chipco)) { in ssb_watchdog_timer_set() 26 ssb_chipco_watchdog_timer_set(&bus->chipco, ticks); in ssb_watchdog_timer_set() 29 if (ssb_extif_available(&bus->extif)) { in ssb_watchdog_timer_set() 30 ssb_extif_watchdog_timer_set(&bus->extif, ticks); in ssb_watchdog_timer_set() 33 return -ENODEV; in ssb_watchdog_timer_set() 37 int ssb_watchdog_register(struct ssb_bus *bus) in ssb_watchdog_register() argument [all …]
|
H A D | scan.c | 3 * Bus scanning 5 * Copyright (C) 2005-2007 Michael Buesch <m@bues.ch> 6 * Copyright (C) 2005 Martin Langer <martin-langer@gmx.de> 78 return "SATA XOR-DMA"; in ssb_core_name() 82 return "PCI-E"; in ssb_core_name() 103 switch (pci_dev->device) { in pcidev_to_chipid() 128 dev_err(&pci_dev->dev, "PCI-ID not in fallback list\n"); in pcidev_to_chipid() 160 static u32 scan_read32(struct ssb_bus *bus, u8 current_coreidx, in scan_read32() argument 165 switch (bus->bustype) { in scan_read32() 173 ssb_pcmcia_switch_segment(bus, 1); in scan_read32() [all …]
|
/linux/drivers/bcma/ |
H A D | main.c | 3 * Bus subsystem 23 /* contains the number the next bus should get. */ 37 return sprintf(buf, "0x%03X\n", core->id.manuf); in manuf_show() 44 return sprintf(buf, "0x%03X\n", core->id.id); in id_show() 51 return sprintf(buf, "0x%02X\n", core->id.rev); in rev_show() 58 return sprintf(buf, "0x%X\n", core->id.class); in class_show() 80 static u16 bcma_cc_core_id(struct bcma_bus *bus) in bcma_cc_core_id() argument 82 if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) in bcma_cc_core_id() 87 struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid, in bcma_find_core_unit() argument 92 list_for_each_entry(core, &bus->cores, list) { in bcma_find_core_unit() [all …]
|
H A D | host_pci.c | 16 int win2 = core->bus->host_is_pcie2 ? in bcma_host_pci_switch_core() 19 pci_write_config_dword(core->bus->host_pci, BCMA_PCI_BAR0_WIN, in bcma_host_pci_switch_core() 20 core->addr); in bcma_host_pci_switch_core() 21 pci_write_config_dword(core->bus->host_pci, win2, core->wrap); in bcma_host_pci_switch_core() 22 core->bus->mapped_core = core; in bcma_host_pci_switch_core() 23 bcma_debug(core->bus, "Switched to core: 0x%X\n", core->id.id); in bcma_host_pci_switch_core() 30 switch (core->id.id) { in bcma_host_pci_provide_access_to_core() 37 if (core->bus->mapped_core != core) in bcma_host_pci_provide_access_to_core() 45 return ioread8(core->bus->mmio + offset); in bcma_host_pci_read8() 51 return ioread16(core->bus->mmio + offset); in bcma_host_pci_read16() [all …]
|
H A D | host_soc.c | 18 return readb(core->io_addr + offset); in bcma_host_soc_read8() 23 return readw(core->io_addr + offset); in bcma_host_soc_read16() 28 return readl(core->io_addr + offset); in bcma_host_soc_read32() 34 writeb(value, core->io_addr + offset); in bcma_host_soc_write8() 40 writew(value, core->io_addr + offset); in bcma_host_soc_write16() 46 writel(value, core->io_addr + offset); in bcma_host_soc_write32() 53 void __iomem *addr = core->io_addr + offset; in bcma_host_soc_block_read() 62 count--; in bcma_host_soc_block_read() 73 count -= 2; in bcma_host_soc_block_read() 84 count -= 4; in bcma_host_soc_block_read() [all …]
|
/linux/sound/i2c/ |
H A D | i2c.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 5 * (c) 1998 Gerd Knorr <kraxel@cs.tu-berlin.de> 25 static int snd_i2c_bit_probeaddr(struct snd_i2c_bus *bus, 34 static int snd_i2c_bus_free(struct snd_i2c_bus *bus) in snd_i2c_bus_free() argument 39 if (snd_BUG_ON(!bus)) in snd_i2c_bus_free() 40 return -EINVAL; in snd_i2c_bus_free() 41 while (!list_empty(&bus->devices)) { in snd_i2c_bus_free() 42 device = snd_i2c_device(bus->devices.next); in snd_i2c_bus_free() 45 if (bus->master) in snd_i2c_bus_free() 46 list_del(&bus->buses); in snd_i2c_bus_free() [all …]
|
H A D | cs8427.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Routines for control of the CS8427 via i2c bus 48 int err; in snd_cs8427_reg_write() local 53 err = snd_i2c_sendbytes(device, buf, 2); in snd_cs8427_reg_write() 54 if (err != 2) { in snd_cs8427_reg_write() 55 dev_err(device->bus->card->dev, in snd_cs8427_reg_write() 57 buf[0], buf[1], err); in snd_cs8427_reg_write() 58 return err < 0 ? err : -EIO; in snd_cs8427_reg_write() 67 int err; in snd_cs8427_reg_read() local 70 err = snd_i2c_sendbytes(device, ®, 1); in snd_cs8427_reg_read() [all …]
|
H A D | tea6330t.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * Routines for control of the TEA6330T circuit via i2c bus 16 MODULE_DESCRIPTION("Routines for control of the TEA6330T circuit via i2c bus"); 27 #define TEA6330T_FCH 0x10 /* select fader channels - front or rear */ 30 #define TEA6330T_EQN 0x40 /* equalizer switchover (0=equalizer-on) */ 35 struct snd_i2c_bus *bus; member 45 int snd_tea6330t_detect(struct snd_i2c_bus *bus, int equalizer) in snd_tea6330t_detect() argument 49 snd_i2c_lock(bus); in snd_tea6330t_detect() 50 res = snd_i2c_probeaddr(bus, TEA6330T_ADDR); in snd_tea6330t_detect() 51 snd_i2c_unlock(bus); in snd_tea6330t_detect() [all …]
|
/linux/drivers/pci/ |
H A D | xen-pcifront.c | 1 // SPDX-License-Identifier: GPL-2.0 27 #include <asm/xen/swiotlb-xen.h> 29 #define INVALID_EVTCHN (-1) 33 struct pci_bus *bus; member 64 return sd->pdev; in pcifront_get_pdev() 68 unsigned int domain, unsigned int bus, in pcifront_init_sd() argument 72 sd->sd.node = first_online_node; in pcifront_init_sd() 73 sd->sd.domain = domain; in pcifront_init_sd() 74 sd->pdev = pdev; in pcifront_init_sd() 104 if (test_bit(_XEN_PCIB_active, (unsigned long *)&pdev->sh_info->flags) in schedule_pcifront_aer_op() [all …]
|
/linux/drivers/pci/pcie/ |
H A D | aer_inject.c | 1 // SPDX-License-Identifier: GPL-2.0 8 * user space helper tool aer-inject, which can be gotten from: 9 * https://github.com/intel/aer-inject.git 35 u8 bus; member 50 unsigned int bus; member 66 struct pci_bus *bus; member 77 static void aer_error_init(struct aer_error *err, u32 domain, in aer_error_init() argument 78 unsigned int bus, unsigned int devfn, in aer_error_init() argument 81 INIT_LIST_HEAD(&err->list); in aer_error_init() 82 err->domain = domain; in aer_error_init() [all …]
|
/linux/drivers/pmdomain/bcm/ |
H A D | bcm-pmb.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 7 #include <dt-bindings/soc/bcm-pmb.h> 80 u8 bus; member 90 static int bcm_pmb_bpcm_read(struct bcm_pmb *pmb, int bus, u8 device, in bcm_pmb_bpcm_read() argument 93 void __iomem *base = pmb->base + bus * 0x20; in bcm_pmb_bpcm_read() 95 int err; in bcm_pmb_bpcm_read() local 97 spin_lock_irqsave(&pmb->lock, flags); in bcm_pmb_bpcm_read() 98 err = bpcm_rd(base, device, offset, val); in bcm_pmb_bpcm_read() 99 spin_unlock_irqrestore(&pmb->lock, flags); in bcm_pmb_bpcm_read() 101 if (!err) in bcm_pmb_bpcm_read() [all …]
|
/linux/drivers/net/phy/ |
H A D | mdio_bus.c | 1 // SPDX-License-Identifier: GPL-2.0+ 2 /* MDIO Bus interface 40 #include "mdio-boardinfo.h" 45 mdiodev->reset_gpio = gpiod_get_optional(&mdiodev->dev, in mdiobus_register_gpiod() 47 if (IS_ERR(mdiodev->reset_gpio)) in mdiobus_register_gpiod() 48 return PTR_ERR(mdiodev->reset_gpio); in mdiobus_register_gpiod() 50 if (mdiodev->reset_gpio) in mdiobus_register_gpiod() 51 gpiod_set_consumer_name(mdiodev->reset_gpio, "PHY reset"); in mdiobus_register_gpiod() 60 reset = reset_control_get_optional_exclusive(&mdiodev->dev, "phy"); in mdiobus_register_reset() 64 mdiodev->reset_ctrl = reset; in mdiobus_register_reset() [all …]
|
/linux/drivers/xen/xen-pciback/ |
H A D | pci_stub.c | 2 * PCI Stub Driver - Grabs devices in backend to be exported later 46 unsigned char bus; member 58 struct xen_pcibk_device *pdev;/* non-NULL if struct pci_dev is in use */ 80 dev_dbg(&dev->dev, "pcistub_device_alloc\n"); in pcistub_device_alloc() 86 psdev->dev = pci_dev_get(dev); in pcistub_device_alloc() 87 if (!psdev->dev) { in pcistub_device_alloc() 92 kref_init(&psdev->kref); in pcistub_device_alloc() 93 spin_lock_init(&psdev->lock); in pcistub_device_alloc() 95 psdev->gsi = -1; in pcistub_device_alloc() 119 dev = psdev->dev; in pcistub_device_release() [all …]
|
H A D | xenbus.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * PCI Backend Xenbus Setup - handles setup with frontend and xend 20 #define INVALID_EVTCHN_IRQ (-1) 26 " 0 - (default) Hide the true PCI topology and makes the frontend\n"\ 27 " there is a single PCI bus with only the exported devices on it.\n"\ 28 " For example, a device at 03:05.0 will be re-assigned to 00:00.0\n"\ 29 " while second device at 02:1a.1 will be re-assigned to 00:01.1.\n"\ 30 " 1 - Passthrough provides a real view of the PCI topology to the\n"\ 35 " bus/slot locations."); 44 dev_dbg(&xdev->dev, "allocated pdev @ 0x%p\n", pdev); in alloc_pdev() [all …]
|
/linux/drivers/net/dsa/mv88e6xxx/ |
H A D | phy.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 16 int mv88e6165_phy_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus, in mv88e6165_phy_read() argument 22 int mv88e6165_phy_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus, in mv88e6165_phy_write() argument 31 struct mii_bus *bus; in mv88e6xxx_phy_read() local 33 bus = mv88e6xxx_default_mdio_bus(chip); in mv88e6xxx_phy_read() 34 if (!bus) in mv88e6xxx_phy_read() 35 return -EOPNOTSUPP; in mv88e6xxx_phy_read() 37 if (!chip->info->ops->phy_read) in mv88e6xxx_phy_read() 38 return -EOPNOTSUPP; in mv88e6xxx_phy_read() 40 return chip->info->ops->phy_read(chip, bus, addr, reg, val); in mv88e6xxx_phy_read() [all …]
|
/linux/sound/hda/ |
H A D | hdac_bus.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * HD-audio core bus driver 24 * snd_hdac_bus_init - initialize a HD-audio bas bus 25 * @bus: the pointer to bus object 27 * @ops: bus verb operators 31 int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev, in snd_hdac_bus_init() argument 34 memset(bus, 0, sizeof(*bus)); in snd_hdac_bus_init() 35 bus->dev = dev; in snd_hdac_bus_init() 37 bus->ops = ops; in snd_hdac_bus_init() 39 bus->ops = &default_ops; in snd_hdac_bus_init() [all …]
|
/linux/drivers/pci/hotplug/ |
H A D | cpcihp_generic.c | 1 // SPDX-License-Identifier: GPL-2.0+ 32 #define MY_NAME THIS_MODULE->name 41 #define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME, ## arg) macro 50 static struct pci_bus *bus; variable 68 return -EINVAL; in validate_parameters() 72 return -EINVAL; in validate_parameters() 76 err("Invalid hotplug bus bridge device bus number"); in validate_parameters() 77 return -EINVAL; in validate_parameters() 82 err("Invalid hotplug bus bridge device"); in validate_parameters() 83 return -EINVAL; in validate_parameters() [all …]
|
/linux/sound/pci/hda/ |
H A D | hda_bind.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * HD-audio codec driver binding 28 u32 id = codec->probe_id ? codec->probe_id : codec->core.vendor_id; in hda_codec_match() 29 u32 rev_id = codec->core.revision_id; in hda_codec_match() 31 for (list = driver->id; list->vendor_id; list++) { in hda_codec_match() 32 if (list->vendor_id == id && in hda_codec_match() 33 (!list->rev_id || list->rev_id == rev_id)) { in hda_codec_match() 34 codec->preset = list; in hda_codec_match() 47 if (codec->bus->shutdown) in hda_codec_unsol_event() 51 if (codec->core.dev.power.power_state.event != PM_EVENT_ON) in hda_codec_unsol_event() [all …]
|
/linux/drivers/xen/xenbus/ |
H A D | xenbus_probe_backend.c | 5 * Copyright (C) 2005 Mike Wray, Hewlett-Packard 41 #include <linux/err.h> 58 /* backend/<type>/<fe-uuid>/<id> => <type>-<fe-domid>-<id> */ 61 int domid, err; in backend_bus_id() local 67 return -EINVAL; in backend_bus_id() 71 return -EINVAL; in backend_bus_id() 75 err = xenbus_gather(XBT_NIL, nodename, "frontend-id", "%i", &domid, in backend_bus_id() 78 if (err) in backend_bus_id() 79 return err; in backend_bus_id() 81 err = -ERANGE; in backend_bus_id() [all …]
|
/linux/arch/mips/bcm47xx/ |
H A D | setup.c | 6 * Copyright (C) 2010-2012 Hauke Mehrtens <hauke@hauke-m.de> 52 * with "brcm,bmips-cbr-reg" in the "cpus" node. 84 bcma_chipco_watchdog_timer_set(&bcm47xx_bus.bcma.bus.drv_cc, 1); in bcm47xx_machine_restart() 104 bcma_chipco_watchdog_timer_set(&bcm47xx_bus.bcma.bus.drv_cc, 0); in bcm47xx_machine_halt() 115 int err; in bcm47xx_register_ssb() local 119 err = ssb_bus_host_soc_register(&bcm47xx_bus.ssb, SSB_ENUM_BASE); in bcm47xx_register_ssb() 120 if (err) in bcm47xx_register_ssb() 121 panic("Failed to initialize SSB bus (err %d)", err); in bcm47xx_register_ssb() 130 memcpy(&port, &mcore->serial_ports[0], sizeof(port)); in bcm47xx_register_ssb() 131 memcpy(&mcore->serial_ports[0], &mcore->serial_ports[1], in bcm47xx_register_ssb() [all …]
|