SlideShare a Scribd company logo
1 of 22
Embedded I/O Management



    © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>
                   All Rights Reserved.
What to Expect?
Basic I/O Management Support
Advanced I/O Management
 Video Subsystem
 Audio Subsystem




       © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   2
                      All Rights Reserved.
I/O Management Overview
Linux provides a uniform i/f to on-board I/O Devices
Categorized as follows
  Link oriented (Network Devices)
  Block oriented (Storage Device)
  All Other (Sequential) Devices
Sequential Device or Character Device category is one of
the largest, with majority of Devices falling under this
So, based on the specialized functions, this have been
further categorized
  Basic I/O (GPIOs, and all that uses plain character drivers)
  Custom I/O (tty, audio, video, ..)

              © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   3
                             All Rights Reserved.
Basic I/O Management
Device Category
  Domain-specific Electronics
  Actuators, Sensors, …
  General Purpose I/O
  A2D, D2A, ...
Driver Type: Character




         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   4
                        All Rights Reserved.
Bus I/O Management
Device Category: I2C, SPI, …
Driver Category: Character with Platform
Porting mostly involves
  Respective bus controller code (driver) to be
  enabled in the kernel




         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   5
                        All Rights Reserved.
Custom I/O Management
Topics under Consideration
  Video
  Audio




          © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   6
                         All Rights Reserved.
Video Drivers




© 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   7
               All Rights Reserved.
Video Subsystem
        FB-aware applications
        Such as video players                                        Console
                                                      setterm
 UM
       X Windows          fbset
Driver
                                    User Space

                                                  Virtual Terminal   lpcons    usb_uart
                                                       Driver

                                              fbcon .. vgacon

       Common Frame Buffer API over /dev/fbX

        Frame Buffer Driver
                                   Kernel Space
                                  Hardware Space

         Video Card X                                 VGA Card       Printer   USB UART

                   © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>                      8
                                  All Rights Reserved.
FB Programming Interface
Header: <linux/fb.h>
Data Structures
  struct fb_info – Main data structure
  struct fb_ops – Entry points
  struct fb_var_screen_info – Resolution, ...
  struct fb_fix_screen_info – FB start addr, ...
  struct fb_cmap – RGB colour map
APIs
  int register_framebuffer(struct fb_info *fb_info);
  int unregister_framebuffer(struct fb_info *fb_info);
  struct fb_info *framebuffer_alloc(size_t size, struct device *dev);
  void framebuffer_release(struct fb_info *info);
  int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp);
  void fb_dealloc_cmap(struct fb_cmap *cmap);
Source: drivers/video/
                   © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>    9
                                  All Rights Reserved.
struct fb_ops
fb_open – Open
fb_release – Close
fb_check_var – Check video parameters
fb_set_par – Set video controller registers
fb_setcolreg – Create pseudo colour palette map
fb_blank – Blank / Unblank display
fb_fillrect – Fill rectangle with pixel lines
fb_copyarea – Copy rectangular area between screens
fb_imageblit – Draw an image to the display
fb_rotate – Rotate the display
fb_ioctl – Ioctl interface for device specific commands
              © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   10
                             All Rights Reserved.
Console Programming Interface
Header: <linux/console.h>
Data Structures
  struct console – top-level console driver
  struct consw – bottom-level console driver
APIs
  void register_console(struct console *);
  int unregister_console(struct console *);
  int register_con_driver(const struct consw *csw, int
  first, int last);
  int unregister_con_driver(const struct consw *csw);
           © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   11
                          All Rights Reserved.
Porting a Video Driver
Standard Video Chipset
 Mostly involves changing pin assignments as
 per the Board Design
New Video Chipset
 Complete Driver as per the preceeding
 discussions, need to be implemented




       © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   12
                      All Rights Reserved.
Browse some Video Drivers
For Frame Buffer drivers
  Browse the drivers/video/ folder
For Console drivers
  Browse the drivers/video/console/ folder




         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   13
                        All Rights Reserved.
Audio Drivers




© 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   14
               All Rights Reserved.
Audio Subsystem
   ALSA conforming Apps            User Space          OSS conforming Apps
(aplay, arecord, mplayer, ...)                         (rawplay, rawrec, ...)

        /dev/snd/pcm*,
              ...                  /proc/asound          /dev/dsp, /dev/adsp,
      /dev/snd/controlC0,        /sys/class/sound       /dev/mixer, /dev/audio
        /dev/snd/timer
                                                           OSS Emulation Layer
                                                       (snd_pcm_oss, snd_mixer_oss)
                                 Sound Core


              Audio Controller                    Audio Codec
                  Driver                            Driver
                                  Kernel Space
                                 Hardware Space
                                                                        MIC
              Audio Controller                    Audio Codec
                                                                        Speaker
                    © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>                 15
                                   All Rights Reserved.
ALSA Sound Card Interface
Header: <linux/sound/core.h>
Data Structure: struct snd_card
APIs
  int snd_card_create(int idx, const char *id,
  struct module *module, int extra_size, struct
  snd_card **card_ret);
  int snd_card_free(struct snd_card *card);
  int snd_card_register(struct snd_card *card);


         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   16
                        All Rights Reserved.
ALSA PCM Interface
Header: <linux/sound/pcm.h>
Data Structure
  struct snd_pcm
  struct snd_pcm_ops
APIs
  int snd_pcm_lib_malloc_pages(struct snd_pcm_substream
  *substream, size_t size);
  int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream);
  int snd_pcm_new(struct snd_card *card, const char *id, int device,
  int playback_count, int capture_count, struct snd_pcm **rpcm);
  void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct
  snd_pcm_ops *ops);


              © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>        17
                             All Rights Reserved.
ALSA Sound Card Interface
Header: <linux/sound/control.h>
Data Structure: struct snd_kcontrol_new
APIs
  int snd_ctl_add(struct snd_card * card, struct
  snd_kcontrol * kcontrol);
  int snd_ctl_remove(struct snd_card * card,
  struct snd_kcontrol * kcontrol);



         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   18
                        All Rights Reserved.
Porting a Audio Driver
Standard Audio Codec
 Mostly involves changing pin assignments as
 per the Board Design
New Audio Codec
 Complete Driver as per the preceeding
 discussions, need to be implemented




       © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   19
                      All Rights Reserved.
Browse some Audio Drivers
For ALSA drivers
  Browse the sound/ folder
  Say sound/arm/aaci.*




         © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   20
                        All Rights Reserved.
What all have we learnt?
Basic I/O Management Support
Advanced I/O Management
 Video Subsystem
   Frame Buffer Programming Interface
   Console Programming Interface
   Porting
 Audio Subsystem
   ALSA Programming Interface
   Porting

        © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   21
                       All Rights Reserved.
Any Queries?




© 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   22
               All Rights Reserved.

More Related Content

What's hot (20)

Board Bringup
Board BringupBoard Bringup
Board Bringup
 
Introduction to BeagleBoard-xM
Introduction to BeagleBoard-xMIntroduction to BeagleBoard-xM
Introduction to BeagleBoard-xM
 
Audio Drivers
Audio DriversAudio Drivers
Audio Drivers
 
Linux DMA Engine
Linux DMA EngineLinux DMA Engine
Linux DMA Engine
 
File System Modules
File System ModulesFile System Modules
File System Modules
 
Introduction to Linux Drivers
Introduction to Linux DriversIntroduction to Linux Drivers
Introduction to Linux Drivers
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
 
Audio in linux embedded
Audio in linux embeddedAudio in linux embedded
Audio in linux embedded
 
SPI Drivers
SPI DriversSPI Drivers
SPI Drivers
 
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
 
Introduction to Embedded Systems
Introduction to Embedded SystemsIntroduction to Embedded Systems
Introduction to Embedded Systems
 
BeagleBoard-xM Booting Process
BeagleBoard-xM Booting ProcessBeagleBoard-xM Booting Process
BeagleBoard-xM Booting Process
 
Processes
ProcessesProcesses
Processes
 
Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
gcc and friends
gcc and friendsgcc and friends
gcc and friends
 
PCI Drivers
PCI DriversPCI Drivers
PCI Drivers
 
Platform Drivers
Platform DriversPlatform Drivers
Platform Drivers
 
Bootloaders
BootloadersBootloaders
Bootloaders
 
Toolchain
ToolchainToolchain
Toolchain
 

Viewers also liked (18)

Architecture Porting
Architecture PortingArchitecture Porting
Architecture Porting
 
Embedded Storage Management
Embedded Storage ManagementEmbedded Storage Management
Embedded Storage Management
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
 
Interrupts
InterruptsInterrupts
Interrupts
 
Linux Kernel Overview
Linux Kernel OverviewLinux Kernel Overview
Linux Kernel Overview
 
File Systems
File SystemsFile Systems
File Systems
 
Synchronization
SynchronizationSynchronization
Synchronization
 
Linux Network Management
Linux Network ManagementLinux Network Management
Linux Network Management
 
Signals
SignalsSignals
Signals
 
Embedded Software Design
Embedded Software DesignEmbedded Software Design
Embedded Software Design
 
Timers
TimersTimers
Timers
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Embedded C
Embedded CEmbedded C
Embedded C
 
System Calls
System CallsSystem Calls
System Calls
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Linux File System
Linux File SystemLinux File System
Linux File System
 
Threads
ThreadsThreads
Threads
 

Similar to Embedded I/O Management

my Windows 7 info
my Windows 7 infomy Windows 7 info
my Windows 7 infoisky guard
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)ijceronline
 
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...Ingria. Technopark St. Petersburg
 
Track F- Designing the kiler soc - sonics
Track F- Designing the kiler soc - sonicsTrack F- Designing the kiler soc - sonics
Track F- Designing the kiler soc - sonicschiportal
 
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux Devices
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux DevicesELCE 2010 - State Of Multimedia In 2010 Embedded Linux Devices
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux DevicesBenjamin Zores
 
Embedded Android
Embedded AndroidEmbedded Android
Embedded Android晓东 杜
 
Industry’s performance leading ultra low-power dsp solution
Industry’s performance leading ultra low-power dsp solutionIndustry’s performance leading ultra low-power dsp solution
Industry’s performance leading ultra low-power dsp solutionAnalog Devices, Inc.
 
Movi presentation Singapore video tech meetup
Movi presentation Singapore video tech meetupMovi presentation Singapore video tech meetup
Movi presentation Singapore video tech meetupLars-Erik M Ravn
 
Visão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
Visão geral do hardware do servidor System z e Linux on z - Concurso MainframeVisão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
Visão geral do hardware do servidor System z e Linux on z - Concurso MainframeAnderson Bassani
 
Qualcomm Snapdragon Processors: A Super Gaming Platform
Qualcomm Snapdragon Processors: A Super Gaming Platform Qualcomm Snapdragon Processors: A Super Gaming Platform
Qualcomm Snapdragon Processors: A Super Gaming Platform Qualcomm Developer Network
 
UplinQ - qualcomm® snapdragon™ processors a super gaming platform
UplinQ - qualcomm® snapdragon™ processors a super gaming platformUplinQ - qualcomm® snapdragon™ processors a super gaming platform
UplinQ - qualcomm® snapdragon™ processors a super gaming platformSatya Harish
 
SBC6020 SAM9G20 based Single Board Computer
SBC6020 SAM9G20 based Single Board ComputerSBC6020 SAM9G20 based Single Board Computer
SBC6020 SAM9G20 based Single Board Computeryclinda666
 
Tac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PITac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PICliff Samuels Jr.
 

Similar to Embedded I/O Management (20)

my Windows 7 info
my Windows 7 infomy Windows 7 info
my Windows 7 info
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)
 
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
Вадим Сухомлинов _Платформы Intel(r) Atom(tm) – новые возможности для социаль...
 
Track F- Designing the kiler soc - sonics
Track F- Designing the kiler soc - sonicsTrack F- Designing the kiler soc - sonics
Track F- Designing the kiler soc - sonics
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux Devices
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux DevicesELCE 2010 - State Of Multimedia In 2010 Embedded Linux Devices
ELCE 2010 - State Of Multimedia In 2010 Embedded Linux Devices
 
Choosing the right processor
Choosing the right processorChoosing the right processor
Choosing the right processor
 
Embedded Android
Embedded AndroidEmbedded Android
Embedded Android
 
Industry’s performance leading ultra low-power dsp solution
Industry’s performance leading ultra low-power dsp solutionIndustry’s performance leading ultra low-power dsp solution
Industry’s performance leading ultra low-power dsp solution
 
Movi presentation Singapore video tech meetup
Movi presentation Singapore video tech meetupMovi presentation Singapore video tech meetup
Movi presentation Singapore video tech meetup
 
Visão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
Visão geral do hardware do servidor System z e Linux on z - Concurso MainframeVisão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
Visão geral do hardware do servidor System z e Linux on z - Concurso Mainframe
 
Qualcomm Snapdragon Processors: A Super Gaming Platform
Qualcomm Snapdragon Processors: A Super Gaming Platform Qualcomm Snapdragon Processors: A Super Gaming Platform
Qualcomm Snapdragon Processors: A Super Gaming Platform
 
UplinQ - qualcomm® snapdragon™ processors a super gaming platform
UplinQ - qualcomm® snapdragon™ processors a super gaming platformUplinQ - qualcomm® snapdragon™ processors a super gaming platform
UplinQ - qualcomm® snapdragon™ processors a super gaming platform
 
SBC6020 SAM9G20 based Single Board Computer
SBC6020 SAM9G20 based Single Board ComputerSBC6020 SAM9G20 based Single Board Computer
SBC6020 SAM9G20 based Single Board Computer
 
MarcoMorenoResume
MarcoMorenoResumeMarcoMorenoResume
MarcoMorenoResume
 
Beagle board101 esc-boston-2009b
Beagle board101 esc-boston-2009bBeagle board101 esc-boston-2009b
Beagle board101 esc-boston-2009b
 
Resume
ResumeResume
Resume
 
Linux Audio Drivers. ALSA
Linux Audio Drivers. ALSALinux Audio Drivers. ALSA
Linux Audio Drivers. ALSA
 
Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)
 
Tac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PITac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PI
 

More from Anil Kumar Pugalia (12)

Processes
ProcessesProcesses
Processes
 
System Calls
System CallsSystem Calls
System Calls
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Playing with R L C Circuits
Playing with R L C CircuitsPlaying with R L C Circuits
Playing with R L C Circuits
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
References
ReferencesReferences
References
 
Functional Programming with LISP
Functional Programming with LISPFunctional Programming with LISP
Functional Programming with LISP
 
Power of vi
Power of viPower of vi
Power of vi
 
"make" system
"make" system"make" system
"make" system
 
Hardware Design for Software Hackers
Hardware Design for Software HackersHardware Design for Software Hackers
Hardware Design for Software Hackers
 
RPM Building
RPM BuildingRPM Building
RPM Building
 
Linux User Space Debugging & Profiling
Linux User Space Debugging & ProfilingLinux User Space Debugging & Profiling
Linux User Space Debugging & Profiling
 

Recently uploaded

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 

Embedded I/O Management

  • 1. Embedded I/O Management © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> All Rights Reserved.
  • 2. What to Expect? Basic I/O Management Support Advanced I/O Management Video Subsystem Audio Subsystem © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 2 All Rights Reserved.
  • 3. I/O Management Overview Linux provides a uniform i/f to on-board I/O Devices Categorized as follows Link oriented (Network Devices) Block oriented (Storage Device) All Other (Sequential) Devices Sequential Device or Character Device category is one of the largest, with majority of Devices falling under this So, based on the specialized functions, this have been further categorized Basic I/O (GPIOs, and all that uses plain character drivers) Custom I/O (tty, audio, video, ..) © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 3 All Rights Reserved.
  • 4. Basic I/O Management Device Category Domain-specific Electronics Actuators, Sensors, … General Purpose I/O A2D, D2A, ... Driver Type: Character © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 4 All Rights Reserved.
  • 5. Bus I/O Management Device Category: I2C, SPI, … Driver Category: Character with Platform Porting mostly involves Respective bus controller code (driver) to be enabled in the kernel © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 5 All Rights Reserved.
  • 6. Custom I/O Management Topics under Consideration Video Audio © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 6 All Rights Reserved.
  • 7. Video Drivers © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 7 All Rights Reserved.
  • 8. Video Subsystem FB-aware applications Such as video players Console setterm UM X Windows fbset Driver User Space Virtual Terminal lpcons usb_uart Driver fbcon .. vgacon Common Frame Buffer API over /dev/fbX Frame Buffer Driver Kernel Space Hardware Space Video Card X VGA Card Printer USB UART © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 8 All Rights Reserved.
  • 9. FB Programming Interface Header: <linux/fb.h> Data Structures struct fb_info – Main data structure struct fb_ops – Entry points struct fb_var_screen_info – Resolution, ... struct fb_fix_screen_info – FB start addr, ... struct fb_cmap – RGB colour map APIs int register_framebuffer(struct fb_info *fb_info); int unregister_framebuffer(struct fb_info *fb_info); struct fb_info *framebuffer_alloc(size_t size, struct device *dev); void framebuffer_release(struct fb_info *info); int fb_alloc_cmap(struct fb_cmap *cmap, int len, int transp); void fb_dealloc_cmap(struct fb_cmap *cmap); Source: drivers/video/ © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 9 All Rights Reserved.
  • 10. struct fb_ops fb_open – Open fb_release – Close fb_check_var – Check video parameters fb_set_par – Set video controller registers fb_setcolreg – Create pseudo colour palette map fb_blank – Blank / Unblank display fb_fillrect – Fill rectangle with pixel lines fb_copyarea – Copy rectangular area between screens fb_imageblit – Draw an image to the display fb_rotate – Rotate the display fb_ioctl – Ioctl interface for device specific commands © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 10 All Rights Reserved.
  • 11. Console Programming Interface Header: <linux/console.h> Data Structures struct console – top-level console driver struct consw – bottom-level console driver APIs void register_console(struct console *); int unregister_console(struct console *); int register_con_driver(const struct consw *csw, int first, int last); int unregister_con_driver(const struct consw *csw); © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 11 All Rights Reserved.
  • 12. Porting a Video Driver Standard Video Chipset Mostly involves changing pin assignments as per the Board Design New Video Chipset Complete Driver as per the preceeding discussions, need to be implemented © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 12 All Rights Reserved.
  • 13. Browse some Video Drivers For Frame Buffer drivers Browse the drivers/video/ folder For Console drivers Browse the drivers/video/console/ folder © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 13 All Rights Reserved.
  • 14. Audio Drivers © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 14 All Rights Reserved.
  • 15. Audio Subsystem ALSA conforming Apps User Space OSS conforming Apps (aplay, arecord, mplayer, ...) (rawplay, rawrec, ...) /dev/snd/pcm*, ... /proc/asound /dev/dsp, /dev/adsp, /dev/snd/controlC0, /sys/class/sound /dev/mixer, /dev/audio /dev/snd/timer OSS Emulation Layer (snd_pcm_oss, snd_mixer_oss) Sound Core Audio Controller Audio Codec Driver Driver Kernel Space Hardware Space MIC Audio Controller Audio Codec Speaker © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 15 All Rights Reserved.
  • 16. ALSA Sound Card Interface Header: <linux/sound/core.h> Data Structure: struct snd_card APIs int snd_card_create(int idx, const char *id, struct module *module, int extra_size, struct snd_card **card_ret); int snd_card_free(struct snd_card *card); int snd_card_register(struct snd_card *card); © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 16 All Rights Reserved.
  • 17. ALSA PCM Interface Header: <linux/sound/pcm.h> Data Structure struct snd_pcm struct snd_pcm_ops APIs int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); int snd_pcm_new(struct snd_card *card, const char *id, int device, int playback_count, int capture_count, struct snd_pcm **rpcm); void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *ops); © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 17 All Rights Reserved.
  • 18. ALSA Sound Card Interface Header: <linux/sound/control.h> Data Structure: struct snd_kcontrol_new APIs int snd_ctl_add(struct snd_card * card, struct snd_kcontrol * kcontrol); int snd_ctl_remove(struct snd_card * card, struct snd_kcontrol * kcontrol); © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 18 All Rights Reserved.
  • 19. Porting a Audio Driver Standard Audio Codec Mostly involves changing pin assignments as per the Board Design New Audio Codec Complete Driver as per the preceeding discussions, need to be implemented © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 19 All Rights Reserved.
  • 20. Browse some Audio Drivers For ALSA drivers Browse the sound/ folder Say sound/arm/aaci.* © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 20 All Rights Reserved.
  • 21. What all have we learnt? Basic I/O Management Support Advanced I/O Management Video Subsystem Frame Buffer Programming Interface Console Programming Interface Porting Audio Subsystem ALSA Programming Interface Porting © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 21 All Rights Reserved.
  • 22. Any Queries? © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 22 All Rights Reserved.