| /components/drivers/core/ |
| A D | device.c | 41 #define device_init (dev->ops ? dev->ops->init : RT_NULL) 42 #define device_open (dev->ops ? dev->ops->open : RT_NULL) 43 #define device_close (dev->ops ? dev->ops->close : RT_NULL) 44 #define device_read (dev->ops ? dev->ops->read : RT_NULL) 45 #define device_write (dev->ops ? dev->ops->write : RT_NULL) 46 #define device_control (dev->ops ? dev->ops->control : RT_NULL) 71 if (dev == RT_NULL) in rt_device_register() 78 dev->flag = flags; in rt_device_register() 79 dev->ref_count = 0; in rt_device_register() 80 dev->open_flag = 0; in rt_device_register() [all …]
|
| A D | dm.c | 310 if (dev->ofw_node) in rt_dm_dev_get_address_count() 325 if (dev->ofw_node) in rt_dm_dev_get_address() 341 if (dev->ofw_node) in rt_dm_dev_get_address_by_name() 356 if (dev->ofw_node) in rt_dm_dev_get_address_array() 370 if (dev->ofw_node) in rt_dm_dev_iomap() 384 if (dev->ofw_node) in rt_dm_dev_iomap_by_name() 398 if (dev->ofw_node) in rt_dm_dev_get_irq_count() 412 if (dev->ofw_node) in rt_dm_dev_get_irq() 426 if (dev->ofw_node) in rt_dm_dev_get_irq_by_name() 485 if (dev->ofw_node) in rt_dm_dev_prop_read_u8_array_index() [all …]
|
| A D | bus.c | 72 return dev; in rt_device_bus_create() 115 rt_device_t dev; in rt_bus_for_each_dev() local 139 dev = rt_list_entry(dev->node.next, struct rt_device, node); in rt_bus_for_each_dev() 197 bus = dev->bus; in bus_probe() 200 if (!dev->drv && bus->match(drv, dev)) in bus_probe() 284 dev->bus = bus; in rt_bus_add_device() 348 bus = dev->bus; in rt_bus_remove_device() 349 drv = dev->drv; in rt_bus_remove_device() 359 err = dev->bus->remove(dev); in rt_bus_remove_device() 398 else if (dev->drv && dev->drv->shutdown) in device_shutdown() [all …]
|
| A D | mnt.c | 37 const char *dev = bootargs_select("root=", 0); in rootfs_mnt_init() local 41 if (!dev || !fstype) in rootfs_mnt_init() 68 if (fstype != cromfs_type && dev) in rootfs_mnt_init() 106 LOG_E("Wait for /dev/%s init time out", dev); in rootfs_mnt_init() 116 if (rt_device_find(dev)) in rootfs_mnt_init() 127 if (!(err = dfs_mount(dev, "/", fstype, rw ? 0 : ~0, fsdata))) in rootfs_mnt_init() 130 (dev && *dev) ? "on /dev/" : "", in rootfs_mnt_init() 131 (dev && *dev) ? dev : "\b", in rootfs_mnt_init() 137 (dev && *dev) ? "on /dev/" : "", in rootfs_mnt_init() 138 (dev && *dev) ? dev : "\b", in rootfs_mnt_init()
|
| A D | platform.c | 77 static rt_bool_t platform_match(rt_driver_t drv, rt_device_t dev) in platform_match() argument 80 struct rt_platform_device *pdev = rt_container_of(dev, struct rt_platform_device, parent); in platform_match() 81 struct rt_ofw_node *np = dev->ofw_node; in platform_match() 113 static rt_err_t platform_probe(rt_device_t dev) in platform_probe() argument 119 struct rt_ofw_node *np = dev->ofw_node; in platform_probe() 122 err = rt_dm_power_domain_attach(dev, RT_TRUE); in platform_probe() 155 rt_dm_power_domain_detach(dev, RT_TRUE); in platform_probe() 161 static rt_err_t platform_remove(rt_device_t dev) in platform_remove() argument 171 rt_dm_power_domain_detach(dev, RT_TRUE); in platform_remove() 177 static rt_err_t platform_shutdown(rt_device_t dev) in platform_shutdown() argument [all …]
|
| A D | power_domain.c | 197 if (domain->dev) in dm_power_domain_release() 324 if (!dev || index < 0) in rt_dm_power_domain_get_by_index() 343 if (!dev || !name) in rt_dm_power_domain_get_by_name() 376 if (!dev) in rt_dm_power_domain_attach() 403 dev->power_domain_unit = unit; in rt_dm_power_domain_attach() 409 err = domain->attach_dev(domain, dev); in rt_dm_power_domain_attach() 421 dev->power_domain_unit = RT_NULL; in rt_dm_power_domain_attach() 441 if (!dev || !dev->power_domain_unit) in rt_dm_power_domain_detach() 446 unit = dev->power_domain_unit; in rt_dm_power_domain_detach() 453 err = domain->detach_dev(domain, dev); in rt_dm_power_domain_detach() [all …]
|
| /components/drivers/include/drivers/core/ |
| A D | dm.h | 59 int rt_dm_dev_set_name_auto(rt_device_t dev, const char *prefix); 60 int rt_dm_dev_get_name_id(rt_device_t dev); 62 int rt_dm_dev_set_name(rt_device_t dev, const char *format, ...); 63 const char *rt_dm_dev_get_name(rt_device_t dev); 65 int rt_dm_dev_get_address_count(rt_device_t dev); 66 rt_err_t rt_dm_dev_get_address(rt_device_t dev, int index, 72 void *rt_dm_dev_iomap(rt_device_t dev, int index); 73 void *rt_dm_dev_iomap_by_name(rt_device_t dev, const char *name); 75 int rt_dm_dev_get_irq_count(rt_device_t dev); 76 int rt_dm_dev_get_irq(rt_device_t dev, int index); [all …]
|
| A D | driver.h | 28 rt_err_t (*init) (rt_device_t dev); 29 rt_err_t (*open) (rt_device_t dev, rt_uint16_t oflag); 30 rt_err_t (*close) (rt_device_t dev); 31 rt_ssize_t (*read) (rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size); 32 rt_ssize_t (*write) (rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size); 33 rt_err_t (*control)(rt_device_t dev, int cmd, void *args); 38 int (*probe)(struct rt_device *dev); 39 int (*remove)(struct rt_device *dev); 40 int (*shutdown)(struct rt_device *dev);
|
| /components/drivers/virtio/ |
| A D | virtio.c | 19 RT_ASSERT(dev != RT_NULL); in _virtio_dev_check() 25 _virtio_dev_check(dev); in virtio_reset_device() 32 _virtio_dev_check(dev); in virtio_status_acknowledge_driver() 39 _virtio_dev_check(dev); in virtio_status_driver_ok() 48 _virtio_dev_check(dev); in virtio_interrupt_ack() 60 _virtio_dev_check(dev); in virtio_has_feature() 67 _virtio_dev_check(dev); in virtio_queues_alloc() 85 dev->queues_num = 0; in virtio_queues_free() 97 _virtio_dev_check(dev); in virtio_queue_init() 155 _virtio_dev_check(dev); in virtio_queue_destroy() [all …]
|
| A D | virtio.h | 133 void virtio_reset_device(struct virtio_device *dev); 134 void virtio_status_acknowledge_driver(struct virtio_device *dev); 135 void virtio_status_driver_ok(struct virtio_device *dev); 136 void virtio_interrupt_ack(struct virtio_device *dev); 137 rt_bool_t virtio_has_feature(struct virtio_device *dev, rt_uint32_t feature_bit); 139 rt_err_t virtio_queues_alloc(struct virtio_device *dev, rt_size_t queues_num); 140 void virtio_queues_free(struct virtio_device *dev); 142 void virtio_queue_destroy(struct virtio_device *dev, rt_uint32_t queue_index); 143 void virtio_queue_notify(struct virtio_device *dev, rt_uint32_t queue_index); 147 rt_uint16_t virtio_alloc_desc(struct virtio_device *dev, rt_uint32_t queue_index); [all …]
|
| /components/drivers/mtd/ |
| A D | mtd_nor.c | 69 rt_device_t dev; in rt_mtd_nor_register_device() local 71 dev = RT_DEVICE(device); in rt_mtd_nor_register_device() 72 RT_ASSERT(dev != RT_NULL); in rt_mtd_nor_register_device() 77 dev->ops = &mtd_nor_ops; in rt_mtd_nor_register_device() 79 dev->init = _mtd_init; in rt_mtd_nor_register_device() 80 dev->open = _mtd_open; in rt_mtd_nor_register_device() 81 dev->read = _mtd_read; in rt_mtd_nor_register_device() 82 dev->write = _mtd_write; in rt_mtd_nor_register_device() 83 dev->close = _mtd_close; in rt_mtd_nor_register_device() 87 dev->rx_indicate = RT_NULL; in rt_mtd_nor_register_device() [all …]
|
| /components/drivers/block/ |
| A D | blk_dfs.c | 24 struct rt_device *dev = file->vnode->data; in blk_fops_open() local 32 dev->user_data = data; in blk_fops_open() 41 struct rt_device *dev = file->vnode->data; in blk_fops_close() local 43 rt_free(dev->user_data); in blk_fops_close() 44 dev->user_data = RT_NULL; in blk_fops_close() 51 struct rt_device *dev = file->vnode->data; in blk_fops_ioctl() local 53 return (int)rt_device_control(dev, cmd, arg); in blk_fops_ioctl() 61 struct rt_device *dev = file->vnode->data; in blk_fops_read() local 62 struct blk_fops_data *data = dev->user_data; in blk_fops_read() 126 struct rt_device *dev = file->vnode->data; in blk_fops_write() local [all …]
|
| A D | blk_dev.c | 24 struct rt_blk_device *blk = to_blk(dev); in blk_dev_open() 31 struct rt_blk_device *blk = to_blk(dev); in blk_dev_close() 154 struct rt_device *dev; in blk_dev_initialize() local 161 dev = &blk->parent; in blk_dev_initialize() 162 dev->type = RT_Device_Class_Block; in blk_dev_initialize() 164 dev->ops = &blk_dev_ops; in blk_dev_initialize() 166 dev->open = blk_dev_open; in blk_dev_initialize() 167 dev->close = blk_dev_close; in blk_dev_initialize() 168 dev->read = blk_dev_read; in blk_dev_initialize() 169 dev->write = blk_dev_write; in blk_dev_initialize() [all …]
|
| /components/drivers/usb/cherryusb/platform/rtthread/ |
| A D | usbh_dfs.c | 101 RT_ASSERT(dev != RT_NULL); in rt_udisk_control() 152 struct rt_device *dev; in usbh_msc_run() local 162 dev->ops = &udisk_device_ops; in usbh_msc_run() 164 dev->init = rt_udisk_init; in usbh_msc_run() 165 dev->read = rt_udisk_read; in usbh_msc_run() 166 dev->write = rt_udisk_write; in usbh_msc_run() 169 dev->user_data = msc_class; in usbh_msc_run() 178 struct rt_device *dev; in usbh_msc_stop() local 187 dev = rt_device_find(name); in usbh_msc_stop() 188 if (dev) { in usbh_msc_stop() [all …]
|
| /components/vbus/ |
| A D | vbus_chnx.c | 19 rt_device_t dev = ctx; in _rx_indicate() local 21 if (dev->rx_indicate) in _rx_indicate() 22 dev->rx_indicate(dev, 0); in _rx_indicate() 27 rt_device_t dev = ctx; in _tx_complete() local 29 if (dev->tx_complete) in _tx_complete() 30 dev->tx_complete(dev, 0); in _tx_complete() 53 static rt_err_t _close(rt_device_t dev) in _close() argument 160 RT_ASSERT(dev); in _control() 223 RT_ASSERT(dev); in rt_vbus_get_chnnr() 225 vdev = dev->user_data; in rt_vbus_get_chnnr() [all …]
|
| /components/drivers/dma/ |
| A D | dma_pool.c | 224 dma_pool->dev = dev; in ofw_device_dma_ops() 247 if (dev->ofw_node && (ops = ofw_device_dma_ops(dev))) in device_dma_ops() 253 if (rt_dma_device_is_coherent(dev)) in device_dma_ops() 262 dev->dma_ops = ops; in device_dma_ops() 327 if (!(flags & RT_DMA_F_DEVICE) || pool->dev != dev) in dma_alloc() 417 if (!dev || !size) in rt_dma_alloc() 422 ops = device_dma_ops(dev); in rt_dma_alloc() 451 if (!dev || !size || !cpu_addr) in rt_dma_free() 456 ops = device_dma_ops(dev); in rt_dma_free() 480 ops = device_dma_ops(dev); in rt_dma_sync_out_data() [all …]
|
| /components/drivers/sensor/v1/ |
| A D | sensor_cmd.c | 137 rt_device_t dev = RT_NULL; in sensor_fifo() local 141 if (dev == RT_NULL) in sensor_fifo() 146 sensor = (rt_sensor_t)dev; in sensor_fifo() 202 rt_device_t dev = RT_NULL; in sensor_int() local 206 if (dev == RT_NULL) in sensor_int() 211 sensor = (rt_sensor_t)dev; in sensor_int() 255 if (dev == RT_NULL) in sensor_polling() 287 rt_device_close(dev); in sensor_polling() 319 if (dev == RT_NULL) in sensor() 449 if (dev == RT_NULL) in sensor() [all …]
|
| /components/drivers/misc/ |
| A D | adc.c | 120 RT_ASSERT(dev); in rt_adc_read() 124 result = dev->ops->convert(dev, channel, &value); in rt_adc_read() 133 RT_ASSERT(dev); in rt_adc_enable() 138 result = dev->ops->enabled(dev, channel, RT_TRUE); in rt_adc_enable() 150 RT_ASSERT(dev); in rt_adc_disable() 155 result = dev->ops->enabled(dev, channel, RT_FALSE); in rt_adc_disable() 175 resolution = dev->ops->get_resolution(dev); in rt_adc_voltage() 177 vref = dev->ops->get_vref(dev); in rt_adc_voltage() 182 result = dev->ops->enabled(dev, channel, RT_TRUE); in rt_adc_voltage() 185 result = dev->ops->convert(dev, channel, &value); in rt_adc_voltage() [all …]
|
| A D | dac.c | 24 struct rt_dac_device *dac = (struct rt_dac_device *)dev; in _dac_write() 40 static rt_err_t _dac_control(rt_device_t dev, int cmd, void *args) in _dac_control() argument 43 rt_dac_device_t dac = (struct rt_dac_device *)dev; in _dac_control() 108 RT_ASSERT(dev); in rt_dac_write() 110 return dev->ops->convert(dev, channel, &value); in rt_dac_write() 117 RT_ASSERT(dev); in rt_dac_enable() 118 if (dev->ops->enabled != RT_NULL) in rt_dac_enable() 120 result = dev->ops->enabled(dev, channel); in rt_dac_enable() 134 RT_ASSERT(dev); in rt_dac_disable() 135 if (dev->ops->disabled != RT_NULL) in rt_dac_disable() [all …]
|
| /components/legacy/usb/usbhost/class/ |
| A D | udisk.c | 56 static rt_err_t rt_udisk_init(rt_device_t dev) in rt_udisk_init() argument 80 RT_ASSERT(dev != RT_NULL); in rt_udisk_read() 85 data = (struct ustor_data*)dev->user_data; in rt_udisk_read() 118 RT_ASSERT(dev != RT_NULL); in rt_udisk_write() 123 data = (struct ustor_data*)dev->user_data; in rt_udisk_write() 150 RT_ASSERT(dev != RT_NULL); in rt_udisk_control() 152 data = (struct ustor_data*)dev->user_data; in rt_udisk_control() 335 stor->dev[i].init = rt_udisk_init; in rt_udisk_run() 336 stor->dev[i].read = rt_udisk_read; in rt_udisk_run() 437 rt_device_t dev = &stor->dev[i]; in rt_udisk_stop() local [all …]
|
| /components/drivers/sdio/sdhci/ |
| A D | sdhci-platform.c | 21 struct rt_device *dev = &pdev->parent; in rt_sdhci_get_property() local 26 if (rt_dm_dev_prop_read_bool(dev, "sdhci,auto-cmd12")) in rt_sdhci_get_property() 29 …if (rt_dm_dev_prop_read_bool(dev, "sdhci,1-bit-only") || (rt_dm_dev_prop_read_u32(dev, "bus-width"… in rt_sdhci_get_property() 32 if (rt_dm_dev_prop_read_bool(dev, "broken-cd")) in rt_sdhci_get_property() 35 if (rt_dm_dev_prop_read_bool(dev, "no-1-8-v")) in rt_sdhci_get_property() 40 if (rt_dm_dev_prop_read_bool(dev, "keep-power-in-suspend")) in rt_sdhci_get_property() 43 …if (rt_dm_dev_prop_read_bool(dev, "wakeup-source") || rt_dm_dev_prop_read_bool(dev, "enable-sdio-w… in rt_sdhci_get_property() 52 struct rt_device *dev = &pdev->parent; in rt_sdhci_pltfm_init() local 56 ioaddr = rt_dm_dev_iomap(dev, 0); in rt_sdhci_pltfm_init() 62 irq = rt_dm_dev_get_irq(dev, 0); in rt_sdhci_pltfm_init() [all …]
|
| /components/utilities/rt-link/src/ |
| A D | rtlink_dev.c | 20 #define RTLINK_SERV(dev) (((struct rt_link_device*)dev)->service) argument 225 RT_ASSERT(dev != RT_NULL); in rt_link_dev_init() 227 dev->rx_indicate = RT_NULL; in rt_link_dev_init() 228 dev->tx_complete = RT_NULL; in rt_link_dev_init() 243 RT_ASSERT(dev != RT_NULL); in rt_link_dev_open() 263 RT_ASSERT(dev != RT_NULL); in rt_link_dev_close() 270 RT_ASSERT(dev != RT_NULL); in rt_link_dev_read() 310 RT_ASSERT(dev != RT_NULL); in rt_link_dev_write() 319 RT_ASSERT(dev != RT_NULL); in rt_link_dev_control() 332 dev->rx_indicate = RT_NULL; in rt_link_dev_control() [all …]
|
| /components/dfs/dfs_v2/filesystems/procfs/ |
| A D | proc_devices.c | 166 dev->index ++; in save_info() 172 if (dev->size > dev->len + len) in save_info() 174 strcat(dev->buf, tmp); in save_info() 175 dev->len += len; in save_info() 179 if (dev->buf == RT_NULL) in save_info() 181 dev->buf = rt_calloc(1, 4096); in save_info() 185 dev->buf = rt_realloc(dev->buf, dev->size + 4096); in save_info() 187 if (dev->buf) in save_info() 189 dev->size += 4096; in save_info() 190 strcat(dev->buf, tmp); in save_info() [all …]
|
| /components/drivers/include/drivers/ |
| A D | dma.h | 82 struct rt_device *dev; member 143 struct rt_device *dev; member 148 void *(*alloc)(struct rt_device *dev, rt_size_t size, 150 void (*free)(struct rt_device *dev, rt_size_t size, 194 void *rt_dma_alloc(struct rt_device *dev, rt_size_t size, 197 void rt_dma_free(struct rt_device *dev, rt_size_t size, 203 return rt_dma_alloc(dev, size, dma_handle, in rt_dma_alloc_coherent() 210 rt_dma_free(dev, size, cpu_addr, dma_handle, in rt_dma_free_coherent() 221 return rt_dm_dev_prop_read_bool(dev, "dma-coherent"); in rt_dma_device_is_coherent() 224 rt_inline void rt_dma_device_set_ops(struct rt_device *dev, in rt_dma_device_set_ops() argument [all …]
|
| /components/drivers/iio/ |
| A D | iio.c | 42 void *rt_iio_channel_get_by_index(struct rt_device *dev, int index, int *out_channel) in rt_iio_channel_get_by_index() argument 46 if (!dev || index < 0) in rt_iio_channel_get_by_index() 51 if (dev->ofw_node) in rt_iio_channel_get_by_index() 53 iio = ofw_iio_channel_get_by_index(dev->ofw_node, index, out_channel); in rt_iio_channel_get_by_index() 59 void *rt_iio_channel_get_by_name(struct rt_device *dev, const char *name, int *out_channel) in rt_iio_channel_get_by_name() argument 63 if (!dev || !name) in rt_iio_channel_get_by_name() 68 index = rt_dm_dev_prop_index_of_string(dev, "io-channel-names", name); in rt_iio_channel_get_by_name() 70 return rt_iio_channel_get_by_index(dev, index, out_channel); in rt_iio_channel_get_by_name()
|