Linux Kernel 设备驱动
星空探索
linux
展开
-
Linux Kernel input ev操作
static struct input_handler evdev_handler = { .event = evdev_event, .events = evdev_events, .connect = evdev_connect, .disconnect = evdev_disconnect, .legacy_minors = true, .minor = EVD原创 2017-03-13 08:14:01 · 375 阅读 · 0 评论 -
Linux Kernel设备驱动模型之class 查找设备
/** * class_find_device - device iterator for locating a particular device * @class: the class we're iterating * @start: Device to begin with * @data: data for the match function * @match: f原创 2017-03-25 13:51:19 · 2207 阅读 · 0 评论 -
Linux Kernel设备驱动模型之class 接口注册
int class_interface_register(struct class_interface *class_intf){ struct class *parent; struct class_dev_iter iter; struct device *dev; if (!class_intf || !class_intf->class) return -ENODEV原创 2017-03-25 13:51:58 · 634 阅读 · 0 评论 -
Linux Kernel设备驱动模型之class注册
设备驱动模型之 class注册 int __class_register(struct class *cls, struct lock_class_key *key){ struct subsys_private *cp; int error; pr_debug("device class '%s': registering\n", cls->name); cp = kza原创 2017-03-25 13:52:33 · 666 阅读 · 0 评论 -
Linux Kernel设备驱动模型之设备绑定驱动
/** * device_attach - try to attach device to a driver. * @dev: device. * * Walk the list of drivers that the bus has and call * driver_probe_device() for each pair. If a compatible * pair原创 2017-03-25 13:53:21 · 432 阅读 · 0 评论 -
Linux Kernel设备驱动模型之驱动探测设备
/** * driver_attach - try to bind driver to devices. * @drv: driver. * * Walk the list of devices that the bus has on it and try to * match the driver with each one. If driver_probe_device(原创 2017-03-25 13:54:08 · 363 阅读 · 0 评论 -
Linux Kernel设备驱动模型之绑定驱动到设备
/** * device_bind_driver - bind a driver to one device. * @dev: device. * * Allow manual attachment of a driver to a device. * Caller must have already set @dev->driver. * * Note that th原创 2017-03-25 13:54:49 · 564 阅读 · 0 评论 -
Linux Kernel设备驱动模型之驱动探测设备
/** * driver_probe_device - attempt to bind device & driver together * @drv: driver to bind a device to * @dev: device to try to bind to the driver * * This function returns -ENODEV if the d原创 2017-03-25 13:55:15 · 406 阅读 · 0 评论 -
Linux Kernel设备驱动模型之总线初始化
int __init buses_init(void){ bus_kset = kset_create_and_add("bus", &bus_uevent_ops, NULL); if (!bus_kset) return -ENOMEM; system_kset = kset_create_and_add("system", NULL, &devices_kset->kobj原创 2017-03-25 13:55:46 · 590 阅读 · 0 评论 -
Linux Kernel设备驱动模型之子系统注册
static int subsys_register(struct bus_type *subsys, const struct attribute_group **groups, struct kobject *parent_of_root){ struct device *dev; int err; err = bus_register(subsys);原创 2017-03-25 13:56:17 · 291 阅读 · 0 评论 -
Linux Kernel设备驱动模型之子系统接口注册
设备驱动模型之子系统注册:int subsys_interface_register(struct subsys_interface *sif){ struct bus_type *subsys; struct subsys_dev_iter iter; struct device *dev; if (!sif || !sif->subsys) return -ENO原创 2017-03-25 13:56:44 · 548 阅读 · 0 评论 -
Linux Kernel设备驱动模型之class 初始化
int __init classes_init(void){ class_kset = kset_create_and_add("class", NULL, NULL); if (!class_kset) return -ENOMEM; return 0;}原创 2017-03-25 13:50:25 · 331 阅读 · 0 评论 -
Linux Kernel设备驱动模型之CPU接口注册
/* * register_cpu - Setup a sysfs device for a CPU. * @cpu - cpu->hotpluggable field set to 1 will generate a control file in * sysfs for this CPU. * @num - CPU number to use when creating t原创 2017-03-25 13:49:48 · 642 阅读 · 0 评论 -
Linux Kernel input evdev
struct evdev { int open; struct input_handle handle; wait_queue_head_t wait; struct evdev_client __rcu *grab; struct list_head client_list; spinlock_t client_lock; /* protects client_list原创 2017-03-13 08:16:18 · 286 阅读 · 0 评论 -
Linux Kernel input设备之分配input设备
/** * input_allocate_device - allocate memory for new input device * * Returns prepared struct input_dev or %NULL. * * NOTE: Use input_free_device() to free devices that have not been * re原创 2017-03-13 08:16:31 · 447 阅读 · 0 评论 -
pin control subsystem之 pinctrl_dev
/** * struct pinctrl_dev - pin control class device * @node: node to include this pin controller in the global pin controller list * @desc: the pin controller descriptor supplied when initializi原创 2017-03-15 08:17:05 · 485 阅读 · 0 评论 -
Linux内核设备驱动之GIC驱动
对于可提供中断这种功能的IC来说,具体中断IC应该具有哪些功能参见IC描述,下面我们着重讲解GIC,并且是GIC-V3版本的IC。对于中断控制器来说,内核对其抽象,用数据结构struct irq_chip来对其描述。对于GIC来说,实现下面对象: static struct irq_chip gic_chip = { .name = "GICv3", .irq_mask原创 2017-03-25 13:37:58 · 1576 阅读 · 0 评论 -
Linux Kernel设备驱动模型之 平台驱动注册
/** * __platform_register_drivers - register an array of platform drivers * @drivers: an array of drivers to register * @count: the number of drivers to register * @owner: module owning the dr原创 2017-03-25 13:39:50 · 634 阅读 · 0 评论 -
Linux Kernel设备驱动模型之 平台设备注册
/** * platform_device_register_full - add a platform-level device with * resources and platform-specific data * * @pdevinfo: data used to create device * * Returns &struct platform_device原创 2017-03-25 13:42:22 · 485 阅读 · 0 评论 -
Linux Kernel设备驱动模型之平台驱动
struct platform_driver { int (*probe)(struct platform_device *); int (*remove)(struct platform_device *); void (*shutdown)(struct platform_device *); int (*suspend)(struct platform_device *, p原创 2017-03-25 13:43:24 · 228 阅读 · 0 评论 -
Linux Kernel设备驱动模型之平台设备
struct platform_device { const char *name; int id; bool id_auto; struct device dev; u32 num_resources; struct resource *resource; const struct platform_device_id *id_entry; char *driv原创 2017-03-25 13:44:12 · 495 阅读 · 0 评论 -
Linux Kernel设备驱动模型之驱动模型初始化
/** * driver_init - initialize driver model. * * Call the driver model init functions to initialize their * subsystems. Called early from init/main.c. */void __init driver_init(void){原创 2017-03-25 13:46:49 · 344 阅读 · 0 评论 -
Linux Kernel设备驱动模型之CPU相关初始化
void __init cpu_dev_init(void){ if (subsys_system_register(&cpu_subsys, cpu_root_attr_groups)) panic("Failed to register CPU subsystem"); cpu_dev_register_generic();}原创 2017-03-25 13:48:47 · 851 阅读 · 0 评论 -
Linux Kernel设备驱动模型之设备探测驱动
设备驱动模型之设备查找驱动:/** * bus_probe_device - probe drivers for a new device * @dev: device to probe * * - Automatically probe for a driver if the bus allows it. */void bus_probe_device(struct原创 2017-03-25 13:57:09 · 362 阅读 · 0 评论 -
Linux Kernel设备驱动模型之 Power 管理
extern void pm_runtime_init(struct device *dev);extern void pm_runtime_reinit(struct device *dev);extern void pm_runtime_remove(struct device *dev);struct wake_irq { struct device *dev; int ir原创 2017-03-27 08:00:07 · 739 阅读 · 0 评论 -
Linux Kernel设备驱动模型之总线查找设备
设备驱动模型之总线查找设备:/** * bus_find_device - device iterator for locating a particular device. * @bus: bus type * @start: Device to begin with * @data: Data to pass to match function * @match: Ca原创 2017-03-27 08:06:52 · 3204 阅读 · 0 评论 -
Linux Kernel设备驱动模型之总线添加设备
设备驱动之总线添加设备:/** * bus_add_device - add device to bus * @dev: device being added * * - Add device's bus attributes. * - Create links to device's bus. * - Add the device to its bus's lis原创 2017-03-27 08:07:04 · 419 阅读 · 0 评论 -
Linux Kernel设备驱动模型之class迭代设备
设备驱动模型之class迭代设备: /** * class_for_each_device - device iterator * @class: the class we're iterating * @start: the device to start with in the list, if any. * @data: data for the callback原创 2017-03-27 08:07:26 · 786 阅读 · 0 评论 -
Linux Kernel设备驱动模型之平台设备初始化
static const struct dev_pm_ops platform_dev_pm_ops = { .runtime_suspend = pm_generic_runtime_suspend, .runtime_resume = pm_generic_runtime_resume, USE_PLATFORM_PM_SLEEP_OPS};struct bus_type pl原创 2017-03-27 08:07:44 · 336 阅读 · 0 评论 -
RTC
static struct rtc_class_ops qpnp_rtc_ops = { .read_time = qpnp_rtc_read_time, .set_alarm = qpnp_rtc_set_alarm, .read_alarm = qpnp_rtc_read_alarm, .alarm_irq_enable = qpnp_rtc_alarm_irq_enable,原创 2017-12-18 13:44:45 · 596 阅读 · 0 评论 -
qpnp_rtc_read_time
[ 767.369284] CPU: 0 PID: 212 Comm: kworker/0:2 Tainted: PF W O 3.10.49-gc16db38-00006-g163c972-dirty #9[ 767.369316] Workqueue: events monitor_soc_work[ 767.369352] [] (unwind_backtrace原创 2017-12-18 13:48:41 · 427 阅读 · 0 评论 -
qpnp_rtc_set_alarm
[ 197.371667] msm_ds2_dap_set_security_control: dmid 0 license key 0[ 197.377043] core_set_license: Invalid cal block to send[ 197.382250] msm_ds2_dap_set_security_control: failed to set dolby原创 2017-12-18 17:30:46 · 1347 阅读 · 2 评论 -
驱动调用栈
[ 14.873268] [<ffffff800808c078>] dump_backtrace+0x0/0x4b0[ 14.881364] [<ffffff800808c53c>] show_stack+0x14/0x1c[ 14.888952] [<ffffff80087579d8>] dump_stack+0x78/0x98[ 14....原创 2019-08-07 13:36:31 · 560 阅读 · 0 评论 -
ARM64 DTS 处理-早期处理
setup_arch() // arch/arm64/kernel/setup.c --> setup_machine_fdt(__fdt_pointer); 检查DTB是否正确,以及早期配置系统 --> unflatten_device_tree();对DTB进行解析,填充设备树结构下内核针对设备树定义的struct device_node类型对象初始化。st...原创 2019-08-15 19:45:32 · 1276 阅读 · 0 评论 -
Linux Kernel设备驱动模型之总线添加驱动
设备驱动之总线添加驱动:/** * bus_add_driver - Add a driver to the bus. * @drv: driver. */int bus_add_driver(struct device_driver *drv){ struct bus_type *bus; struct driver_private *priv; int原创 2017-03-27 07:59:35 · 419 阅读 · 0 评论 -
Linux Kernel设备驱动模型之驱动注册
设备模型之驱动注册:/** * driver_register - register driver with bus * @drv: driver to register * * We pass off most of the work to the bus_add_driver() call, * since most of the things we have to原创 2017-03-27 08:05:11 · 559 阅读 · 0 评论 -
Linux Kernel设备驱动模型之资源管理
/* * Resources are tree-like, allowing * nesting etc.. */struct resource { resource_size_t start; resource_size_t end; const char *name; unsigned long flags; unsigned long desc; st原创 2017-03-27 08:00:34 · 374 阅读 · 0 评论 -
TTY之register_console
extern int add_preferred_console(char *name, int idx, char *options);extern void register_console(struct console *);extern int unregister_console(struct console *);extern struct console *console原创 2017-03-27 08:00:59 · 810 阅读 · 0 评论 -
TTY之struct console
struct console { char name[16]; void (*write)(struct console *, const char *, unsigned); int (*read)(struct console *, char *, unsigned); struct tty_driver *(*device)(struct console *, int *);原创 2017-03-27 08:01:17 · 1542 阅读 · 0 评论 -
TTY之struct consw
/** * struct consw - callbacks for consoles * * @con_set_palette: sets the palette of the console to @table (optional) * @con_scrolldelta: the contents of the console should be scrolled by @li原创 2017-03-27 08:01:37 · 560 阅读 · 0 评论