Lines Matching refs:device

87 rt_err_t rt_spi_device_register(struct rt_spi_device *device)  in rt_spi_device_register()  argument
89 RT_ASSERT(device != RT_NULL); in rt_spi_device_register()
91 return rt_bus_add_device(&spi_bus, &device->parent); in rt_spi_device_register()
98 struct rt_spi_device *device = rt_container_of(dev, struct rt_spi_device, parent); in spi_match() local
104 if (!rt_strcmp(id->name, device->name)) in spi_match()
106 device->id = id; in spi_match()
107 device->ofw_id = RT_NULL; in spi_match()
115 device->ofw_id = rt_ofw_node_match(device->parent.ofw_node, driver->ofw_ids); in spi_match()
117 if (device->ofw_id) in spi_match()
119 device->id = RT_NULL; in spi_match()
133 struct rt_spi_device *device = rt_container_of(dev, struct rt_spi_device, parent); in spi_probe() local
135 if (!device->bus) in spi_probe()
140 err = driver->probe(device); in spi_probe()
147 bus = device->bus; in spi_probe()
151 device->cs_pin = bus->cs_pins[device->chip_select[0]]; in spi_probe()
153 rt_pin_mode(device->cs_pin, PIN_MODE_OUTPUT); in spi_probe()
157 device->cs_pin = PIN_NONE; in spi_probe()
161 if (device->parent.type == RT_Device_Class_Unknown) in spi_probe()
163 rt_spidev_device_init(device, rt_dm_dev_get_name(&device->parent)); in spi_probe()
172 struct rt_spi_device *device = rt_container_of(dev, struct rt_spi_device, parent); in spi_remove() local
176 driver->remove(device); in spi_remove()
178 rt_free(device); in spi_remove()
186 struct rt_spi_device *device = rt_container_of(dev, struct rt_spi_device, parent); in spi_shutdown() local
190 driver->shutdown(device); in spi_shutdown()
192 rt_free(device); in spi_shutdown()