Skip to Content
Linux Device Drivers Development
book

Linux Device Drivers Development

by John Madieu
October 2017
Intermediate to advanced
586 pages
14h 8m
English
Packt Publishing
Content preview from Linux Device Drivers Development

init data structure

There are two ways to pass regulator_init_data to a driver; this can be done by platform data in the board initialization file or by a node in the device tree using the of_get_regulator_init_data function:

struct regulator_init_data { 
   struct regulation_constraints constraints; 
 
   /* optional regulator machine specific init */ 
   int (*regulator_init)(void *driver_data); 
   void *driver_data;      /* core does not touch this */ 
}; 

The following are the meanings of elements in the structure:

  • constraints represents the regulator constraints
  • regulator_init is an optional callback invoked at a given moment when the core registers the regulator
  • driver_data represents the data passed to regulator_init

As you can see, the struct constraints ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Device Drivers, Second Edition

Linux Device Drivers, Second Edition

Jonathan Corbet, Alessandro Rubini
Linux Device Drivers, 3rd Edition

Linux Device Drivers, 3rd Edition

Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman

Publisher Resources

ISBN: 9781785280009Supplemental Content