SlideShare a Scribd company logo
1 of 12
© 2014-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Platform Device Drivers
2© 2014-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
What to Expect?
W's of Platform Device Drivers
Registering a Platform Driver
Registering a Platform Device
Binding a platform driver to a device
Platform resources and platform data
Testing a simple platform driver
3© 2014-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
W's of Platform Device Drivers
Provides a mechanism to notify the kernel of
available hardware on the board
Mechanism to add the devices to the device
model of the kernel
Used for non-discoverable devices
Driver for the devices on the virtual 'platform' bus
4© 2014-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Components of Platform Device
Drivers
Two components
Platform Driver
Set of operations done on the device
Platform Device
Information about the device
Deemed to be connected to a virtual 'platform' bus
5© 2014-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Platform Bus Drivers Registration
platform_device.h
platform_driver structure defined as below:
struct platform_driver
int (*probe)(struct platform_device *);
int (*remove)(struct platform_device *);
void (*shutdown)(struct platform_device *);
int (*suspend)(struct platform_device *, pm_message_t state);
int (*resume)(struct platform_device *);
At minimum, probe() & remove needs to be supplied
int platform_driver_register(struct platform_driver *)
6© 2014-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Platform Device Registration
Defined by board specific file
platform_device.h
platform_device structure defined as below:
const char *name
int id
struct resource *resource
const struct platform_device_id *id_entry
int platform_device_register(struct platform_device
*pdev)
7© 2014-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Binding the Driver with Device
Mechanism for bus code to attach a driver to
device
id_table
struct platform_device_id
char name[PLATFORM_NAME_SIZE]
kernel_ulong_t driver_data
Name of driver, specified in the name field
8© 2014-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Specifying the Resource Info
For providing the information such as memory locations, IRQ numbers etc
struct resource my_resource [] = {
{
.start = RESOURCE_START_ADDRESS,
.end = RESOURCE_END_ADDRESS,
.flags = IORESOURCE_MEM
}
}
struct platform_device my_device = {
.name = DRIVER_NAME,
.num_resources = ARRAY_SIZE(my_resource),
.resources = my_resource,
}
9© 2014-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Platform Data
Mechanism to pass the generic device specific
information from Platform Device to the Platform Driver
Example – Passing GPIO information
int gpio_led = 53;
struct platform_device led_device {
name = DRIVER_NAME,
.dev = {
.platform_data = &gpio_led,
}
}
10© 2014-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Platform Driver With DTB
const struct of_device_id gpio_led_dt[] = {
{ .compatible = "my-led", },
{ }
};
of_property_read_u32(np, "led-number",
&gpio_number);
.of_match_table = of_match_ptr(gpio_led_dt);
11© 2014-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
What all we Learnt?
W's of Platform Device Drivers
Registering a Platform Driver
Registering a Platform Device
Binding a platform driver to a device
Platform resources and platform data
Testing a simple platform driver
12© 2014-17 SysPlay Workshops <workshop@sysplay.in>
All Rights Reserved.
Any Queries?

More Related Content

What's hot

Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequenceHoucheng Lin
 
I2C Subsystem In Linux-2.6.24
I2C Subsystem In Linux-2.6.24I2C Subsystem In Linux-2.6.24
I2C Subsystem In Linux-2.6.24Varun Mahajan
 
Introduction to open_sbi
Introduction to open_sbiIntroduction to open_sbi
Introduction to open_sbiNylon
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBshimosawa
 
Introduction Linux Device Drivers
Introduction Linux Device DriversIntroduction Linux Device Drivers
Introduction Linux Device DriversNEEVEE Technologies
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Linaro
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New HardwareRuggedBoardGroup
 

What's hot (20)

I2C Drivers
I2C DriversI2C Drivers
I2C Drivers
 
Bootloaders
BootloadersBootloaders
Bootloaders
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
I2C Subsystem In Linux-2.6.24
I2C Subsystem In Linux-2.6.24I2C Subsystem In Linux-2.6.24
I2C Subsystem In Linux-2.6.24
 
Introduction to Linux Drivers
Introduction to Linux DriversIntroduction to Linux Drivers
Introduction to Linux Drivers
 
Linux device drivers
Linux device drivers Linux device drivers
Linux device drivers
 
Introduction to open_sbi
Introduction to open_sbiIntroduction to open_sbi
Introduction to open_sbi
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
I2c drivers
I2c driversI2c drivers
I2c drivers
 
Board Bringup
Board BringupBoard Bringup
Board Bringup
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
 
Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernelEmbedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
 
Introduction Linux Device Drivers
Introduction Linux Device DriversIntroduction Linux Device Drivers
Introduction Linux Device Drivers
 
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
Secure Boot on ARM systems – Building a complete Chain of Trust upon existing...
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
 
Linux I2C
Linux I2CLinux I2C
Linux I2C
 
Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
 

Viewers also liked (18)

Linux Porting
Linux PortingLinux Porting
Linux Porting
 
BeagleBoard-xM Bootloaders
BeagleBoard-xM BootloadersBeagleBoard-xM Bootloaders
BeagleBoard-xM Bootloaders
 
Character Drivers
Character DriversCharacter Drivers
Character Drivers
 
File System Modules
File System ModulesFile System Modules
File System Modules
 
PCI Drivers
PCI DriversPCI Drivers
PCI Drivers
 
Block Drivers
Block DriversBlock Drivers
Block Drivers
 
Interrupts
InterruptsInterrupts
Interrupts
 
Serial Drivers
Serial DriversSerial Drivers
Serial Drivers
 
Network Drivers
Network DriversNetwork Drivers
Network Drivers
 
File Systems
File SystemsFile Systems
File Systems
 
Kernel Programming
Kernel ProgrammingKernel Programming
Kernel Programming
 
Low-level Accesses
Low-level AccessesLow-level Accesses
Low-level Accesses
 
Video Drivers
Video DriversVideo Drivers
Video Drivers
 
Audio Drivers
Audio DriversAudio Drivers
Audio Drivers
 
Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
 
Embedded C
Embedded CEmbedded C
Embedded C
 
References
ReferencesReferences
References
 
gcc and friends
gcc and friendsgcc and friends
gcc and friends
 

Similar to Platform Drivers

APIs: The Bridge to IoT
APIs: The Bridge to IoT APIs: The Bridge to IoT
APIs: The Bridge to IoT WSO2
 
2015 06-api days-sf-apis-dbridge2iot-asanka
2015 06-api days-sf-apis-dbridge2iot-asanka2015 06-api days-sf-apis-dbridge2iot-asanka
2015 06-api days-sf-apis-dbridge2iot-asankaAsanka Abeysinghe
 
Airline Reservation system(project report of six week training)-ppt
Airline Reservation system(project report of six week training)-pptAirline Reservation system(project report of six week training)-ppt
Airline Reservation system(project report of six week training)-pptPunjab technical University
 
17 demonstration server client system-v1.00_en
17 demonstration server client system-v1.00_en17 demonstration server client system-v1.00_en
17 demonstration server client system-v1.00_enconfidencial
 
Ingesting streaming data for analysis in apache ignite (stream sets theme)
Ingesting streaming data for analysis in apache ignite (stream sets theme)Ingesting streaming data for analysis in apache ignite (stream sets theme)
Ingesting streaming data for analysis in apache ignite (stream sets theme)Tom Diederich
 
Chapter 09 Operating Systems
Chapter 09 Operating SystemsChapter 09 Operating Systems
Chapter 09 Operating Systemsxtin101
 
Running head AVIATION MAINTENANCE SYSTEM DEFICIENCY1Aviation.docx
Running head AVIATION MAINTENANCE SYSTEM DEFICIENCY1Aviation.docxRunning head AVIATION MAINTENANCE SYSTEM DEFICIENCY1Aviation.docx
Running head AVIATION MAINTENANCE SYSTEM DEFICIENCY1Aviation.docxjoellemurphey
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded SystemsAnil Kumar Pugalia
 
Ruby Driver Explained: DataStax Webinar May 5th 2015
Ruby Driver Explained: DataStax Webinar May 5th 2015Ruby Driver Explained: DataStax Webinar May 5th 2015
Ruby Driver Explained: DataStax Webinar May 5th 2015DataStax
 
eEnabled Aircraft Software CORENA Case Study
eEnabled Aircraft Software CORENA Case StudyeEnabled Aircraft Software CORENA Case Study
eEnabled Aircraft Software CORENA Case StudyFlatirons Solutions®
 
Service Assurance Constructs for Achieving Network Transformation by Sunku Ra...
Service Assurance Constructs for Achieving Network Transformation by Sunku Ra...Service Assurance Constructs for Achieving Network Transformation by Sunku Ra...
Service Assurance Constructs for Achieving Network Transformation by Sunku Ra...Liz Warner
 
Service Assurance Constructs for Achieving Network Transformation - Sunku Ran...
Service Assurance Constructs for Achieving Network Transformation - Sunku Ran...Service Assurance Constructs for Achieving Network Transformation - Sunku Ran...
Service Assurance Constructs for Achieving Network Transformation - Sunku Ran...Liz Warner
 

Similar to Platform Drivers (20)

APIs: The Bridge to IoT
APIs: The Bridge to IoT APIs: The Bridge to IoT
APIs: The Bridge to IoT
 
2015 06-api days-sf-apis-dbridge2iot-asanka
2015 06-api days-sf-apis-dbridge2iot-asanka2015 06-api days-sf-apis-dbridge2iot-asanka
2015 06-api days-sf-apis-dbridge2iot-asanka
 
Airline Reservation system(project report of six week training)-ppt
Airline Reservation system(project report of six week training)-pptAirline Reservation system(project report of six week training)-ppt
Airline Reservation system(project report of six week training)-ppt
 
17 demonstration server client system-v1.00_en
17 demonstration server client system-v1.00_en17 demonstration server client system-v1.00_en
17 demonstration server client system-v1.00_en
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Paper3x.PDF
Paper3x.PDFPaper3x.PDF
Paper3x.PDF
 
1. device onboarding
1. device onboarding1. device onboarding
1. device onboarding
 
EPiServer Deployment Tips & Tricks
EPiServer Deployment Tips & TricksEPiServer Deployment Tips & Tricks
EPiServer Deployment Tips & Tricks
 
Building Training Devices
Building Training DevicesBuilding Training Devices
Building Training Devices
 
Ingesting streaming data for analysis in apache ignite (stream sets theme)
Ingesting streaming data for analysis in apache ignite (stream sets theme)Ingesting streaming data for analysis in apache ignite (stream sets theme)
Ingesting streaming data for analysis in apache ignite (stream sets theme)
 
Chapter 09 Operating Systems
Chapter 09 Operating SystemsChapter 09 Operating Systems
Chapter 09 Operating Systems
 
Running head AVIATION MAINTENANCE SYSTEM DEFICIENCY1Aviation.docx
Running head AVIATION MAINTENANCE SYSTEM DEFICIENCY1Aviation.docxRunning head AVIATION MAINTENANCE SYSTEM DEFICIENCY1Aviation.docx
Running head AVIATION MAINTENANCE SYSTEM DEFICIENCY1Aviation.docx
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded Systems
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
Linux Network Management
Linux Network ManagementLinux Network Management
Linux Network Management
 
Ruby Driver Explained: DataStax Webinar May 5th 2015
Ruby Driver Explained: DataStax Webinar May 5th 2015Ruby Driver Explained: DataStax Webinar May 5th 2015
Ruby Driver Explained: DataStax Webinar May 5th 2015
 
eEnabled Aircraft Software CORENA Case Study
eEnabled Aircraft Software CORENA Case StudyeEnabled Aircraft Software CORENA Case Study
eEnabled Aircraft Software CORENA Case Study
 
Service Assurance Constructs for Achieving Network Transformation by Sunku Ra...
Service Assurance Constructs for Achieving Network Transformation by Sunku Ra...Service Assurance Constructs for Achieving Network Transformation by Sunku Ra...
Service Assurance Constructs for Achieving Network Transformation by Sunku Ra...
 
Service Assurance Constructs for Achieving Network Transformation - Sunku Ran...
Service Assurance Constructs for Achieving Network Transformation - Sunku Ran...Service Assurance Constructs for Achieving Network Transformation - Sunku Ran...
Service Assurance Constructs for Achieving Network Transformation - Sunku Ran...
 
1. device onboarding pdf
1. device onboarding pdf1. device onboarding pdf
1. device onboarding pdf
 

More from SysPlay eLearning Academy for You (14)

Linux Internals Part - 3
Linux Internals Part - 3Linux Internals Part - 3
Linux Internals Part - 3
 
Linux Internals Part - 2
Linux Internals Part - 2Linux Internals Part - 2
Linux Internals Part - 2
 
Linux Internals Part - 1
Linux Internals Part - 1Linux Internals Part - 1
Linux Internals Part - 1
 
Kernel Timing Management
Kernel Timing ManagementKernel Timing Management
Kernel Timing Management
 
Understanding the BBB
Understanding the BBBUnderstanding the BBB
Understanding the BBB
 
POSIX Threads
POSIX ThreadsPOSIX Threads
POSIX Threads
 
Linux DMA Engine
Linux DMA EngineLinux DMA Engine
Linux DMA Engine
 
Cache Management
Cache ManagementCache Management
Cache Management
 
SPI Drivers
SPI DriversSPI Drivers
SPI Drivers
 
Introduction to BeagleBone Black
Introduction to BeagleBone BlackIntroduction to BeagleBone Black
Introduction to BeagleBone Black
 
Introduction to BeagleBoard-xM
Introduction to BeagleBoard-xMIntroduction to BeagleBoard-xM
Introduction to BeagleBoard-xM
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
 
BeagleBoard-xM Booting Process
BeagleBoard-xM Booting ProcessBeagleBoard-xM Booting Process
BeagleBoard-xM Booting Process
 
Linux System
Linux SystemLinux System
Linux System
 

Recently uploaded

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Platform Drivers

  • 1. © 2014-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Platform Device Drivers
  • 2. 2© 2014-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. What to Expect? W's of Platform Device Drivers Registering a Platform Driver Registering a Platform Device Binding a platform driver to a device Platform resources and platform data Testing a simple platform driver
  • 3. 3© 2014-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. W's of Platform Device Drivers Provides a mechanism to notify the kernel of available hardware on the board Mechanism to add the devices to the device model of the kernel Used for non-discoverable devices Driver for the devices on the virtual 'platform' bus
  • 4. 4© 2014-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Components of Platform Device Drivers Two components Platform Driver Set of operations done on the device Platform Device Information about the device Deemed to be connected to a virtual 'platform' bus
  • 5. 5© 2014-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Platform Bus Drivers Registration platform_device.h platform_driver structure defined as below: struct platform_driver int (*probe)(struct platform_device *); int (*remove)(struct platform_device *); void (*shutdown)(struct platform_device *); int (*suspend)(struct platform_device *, pm_message_t state); int (*resume)(struct platform_device *); At minimum, probe() & remove needs to be supplied int platform_driver_register(struct platform_driver *)
  • 6. 6© 2014-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Platform Device Registration Defined by board specific file platform_device.h platform_device structure defined as below: const char *name int id struct resource *resource const struct platform_device_id *id_entry int platform_device_register(struct platform_device *pdev)
  • 7. 7© 2014-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Binding the Driver with Device Mechanism for bus code to attach a driver to device id_table struct platform_device_id char name[PLATFORM_NAME_SIZE] kernel_ulong_t driver_data Name of driver, specified in the name field
  • 8. 8© 2014-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Specifying the Resource Info For providing the information such as memory locations, IRQ numbers etc struct resource my_resource [] = { { .start = RESOURCE_START_ADDRESS, .end = RESOURCE_END_ADDRESS, .flags = IORESOURCE_MEM } } struct platform_device my_device = { .name = DRIVER_NAME, .num_resources = ARRAY_SIZE(my_resource), .resources = my_resource, }
  • 9. 9© 2014-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Platform Data Mechanism to pass the generic device specific information from Platform Device to the Platform Driver Example – Passing GPIO information int gpio_led = 53; struct platform_device led_device { name = DRIVER_NAME, .dev = { .platform_data = &gpio_led, } }
  • 10. 10© 2014-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Platform Driver With DTB const struct of_device_id gpio_led_dt[] = { { .compatible = "my-led", }, { } }; of_property_read_u32(np, "led-number", &gpio_number); .of_match_table = of_match_ptr(gpio_led_dt);
  • 11. 11© 2014-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. What all we Learnt? W's of Platform Device Drivers Registering a Platform Driver Registering a Platform Device Binding a platform driver to a device Platform resources and platform data Testing a simple platform driver
  • 12. 12© 2014-17 SysPlay Workshops <workshop@sysplay.in> All Rights Reserved. Any Queries?