summaryrefslogtreecommitdiffstats
path: root/include/driver.h
Commit message (Collapse)AuthorAgeFilesLines
* switch all platform_bus device/driver registering to ↵Jean-Christophe PLAGNIOL-VILLARD2012-10-041-0/+3
| | | | | | | | platform_driver/device_register now register_driver and register_device are for bus only usage. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'for-next/remove-fsf-address'Sascha Hauer2012-10-031-4/+0
|\ | | | | | | | | | | Conflicts: drivers/net/miidev.c include/miidev.h
| * Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-4/+0
| | | | | | | | | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | driver: search device and driver based on the bus instead of allJean-Christophe PLAGNIOL-VILLARD2012-09-231-0/+12
| | | | | | | | | | | | | | This will allow reduce the number of driver and device to search on. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | driver: register busJean-Christophe PLAGNIOL-VILLARD2012-09-231-0/+8
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of: add devicetree probing supportSascha Hauer2012-09-141-0/+10
| | | | | | | | | | | | | | This adds code to probe devices from a devicetree. Most helper functions are directly imported from Linux. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | driver: Add platform_device_id mechanismSascha Hauer2012-09-141-0/+9
| | | | | | | | | | | | | | | | It is common for drivers to handle multiple similar devices. On Linux the driver can distinguish between the devices using the platform_device_id mechanism. Introduce the same for barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | driver: rewrite dev_printf as a functionSascha Hauer2012-09-141-3/+3
|/ | | | | | | | | | Printing device context normally should be "driver instance:", but instead we printed the device name twice. This patch fixes this and as a bonus makes the binary a bit smaller. Instead of a '@' between driver and instance this function now prints a whitespace which is a bit more like Linux. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: set DEVICE_ID_DYNAMIC to -2 and DEVICE_ID_SINGLE to -1Jean-Christophe PLAGNIOL-VILLARD2012-08-121-2/+2
| | | | | | | so we can have the same behaviour as in the kernel for id = -1 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial_ns16550: change the driver's nameAntony Pavlov2012-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The name "serial_ns16550" is not handy because the devices will have the names like "serial_ns165500", "serial_ns165501", "serial_ns165502" etc. The names like "ns16550_serial0" and "ns16550_serial1" look much better. Also it is reasonable to make serial driver's names unification. E.g. see the names for drivers in drivers/serial directory: "netx_serial", "mpc5xxx_serial", "altera_serial", "s3c_serial", "imx_serial", "pxa_serial", "blackfin_serial", "stm_serial", "pl010_serial", and even "g_serial" in ./drivers/usb/gadget/serial.c Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: fix standard zero, full devicesSascha Hauer2012-07-041-0/+1
| | | | | | | | | | | | | | | | The standard devices are currently broken since they have the size ~0. As now files use loff_t as file size which is a signed type the read implementation gets confused and now returns -1. The current implementation also has the (somewhat theorical) problem that we do not have real streaming devices, so /dev/zero went out of zeroes after reading 4GB (or now LLONG_MAX). This patch introduces a new cdev flag DEVFS_IS_CHARACTER_DEV and a new file size flag FILE_SIZE_STREAM which makes it possible to create real stream devices instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/sparse'Sascha Hauer2012-07-021-1/+1
|\
| * Do not use iomem space for dev_get_mem_regionSascha Hauer2012-06-301-1/+1
| | | | | | | | | | | | It is mostly used for mmapping sdram which is no iomem. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | partitions: Make 64bit capableSascha Hauer2012-06-301-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | make cdev 64bit capableSascha Hauer2012-06-301-5/+5
| | | | | | | | | | | | Next step to 64bit support: Make cdev size a 64bit type. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | use loff_t for file offsetsSascha Hauer2012-06-301-8/+8
|/ | | | | | | This is a first step for 64bit file support: Make the file sizes/offsets 64bit. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Use DEVICE_ID_DYNAMIC where applicableSascha Hauer2012-04-161-1/+1
| | | | | | | We now have DEVICE_ID_DYNAMIC for dynamic allocation of device ids, Use it where applicable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* device: make singular devices possibleSascha Hauer2012-04-151-0/+5
| | | | | | | | | Currently all devices have an id meaning that all devicenames end with a number. This patch adds a DEVICE_ID_SINGLE to make it ppossible to register a device without an id assigned to it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* NET: Add support for ks8851_mllJan Weitzel2012-03-131-0/+11
| | | | | | | Add support for KS8851 16bit MLL chip from Micrel Inc. Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove unused variable from struct driver_dSascha Hauer2012-02-271-1/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: remove unused type_data field from struct driver_dSascha Hauer2012-02-251-6/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add gpio keyboard supportJean-Christophe PLAGNIOL-VILLARD2012-02-161-0/+5
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* driver: switch driver_d name to const char*Jean-Christophe PLAGNIOL-VILLARD2012-01-111-1/+1
| | | | | | this will allow to save 200 bytes on a9g20 and 180 bytes on ti xlaoder Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'pu/misc' into nextSascha Hauer2011-12-151-1/+1
|\
| * cdev: pass flags to open functionSascha Hauer2011-12-151-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Remove the obsolet driver for the DM9000E ethernet deviceJuergen Beisert2011-12-141-1/+1
|/ | | | | | | | Support for the old DM9000E device is now part of the new dm9k.c driver. So, remove the old driver source and switch all users to the new driver. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* implement resource management for platform devicesSascha Hauer2011-12-041-5/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Create a unique cdev number for on demand devicesJuergen Beisert2011-11-281-0/+1
| | | | | | | | For disk like devices attached to MCI, ATA or USB it depends on the order they will be recognized. So an unique number for all disk like devices is required. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: introduce add_generic_device_res to add multiple resourceJean-Christophe PLAGNIOL-VILLARD2011-09-201-0/+7
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: remove map_baseJean-Christophe PLAGNIOL-VILLARD2011-08-011-6/+0
| | | | | | | as now all the drivers and board have been switch to resource whe can drop map_base and size from device_d Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* ns16550: switch to resourceJean-Christophe PLAGNIOL-VILLARD2011-08-011-2/+2
| | | | | | | use generic read/write depending on the memory size if no reg_read/write defined Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* resource: introduce add_usb_ehci_device to register echi deviceJean-Christophe PLAGNIOL-VILLARD2011-07-291-0/+17
| | | | | | | | | pass the hccr and hcor register base via resource instroduce add_generic_usb_echi_device with hccr = base + 0x100 and hcor = base + 0x140 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* dm9000: introduce add_dm9000_device to register dm9000 deviceJean-Christophe PLAGNIOL-VILLARD2011-07-291-0/+11
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
*-. Merge branches 'pu-ethaddr', 'pu-fec', 'pu-imx-iim', 'pu-resources' and ↵Sascha Hauer2011-07-291-0/+8
|\ \ | | | | | | | | | 'pu-resources1' into next
| | * add a ns16550 registration helper and use itSascha Hauer2011-07-291-0/+8
| |/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'pu' into nextSascha Hauer2011-07-291-1/+1
|\ \ | |/ |/|
| * fix typoSascha Hauer2011-07-291-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | resource: introduce add_cfi_device to register simple cfi deviceJean-Christophe PLAGNIOL-VILLARD2011-07-231-0/+7
| | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | resource: introduce add_generic_device to register simple deviceJean-Christophe PLAGNIOL-VILLARD2011-07-211-2/+14
| | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | add a add_mem_device functionSascha Hauer2011-07-181-5/+6
| | | | | | | | | | | | | | | | | | | | | | Add a helper function for boards to register their memory devices. This makes the board code smaller and also helps getting rid of map_base and struct memory_platform_data. And switch all of the memory to it Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | mem: replace DEVFS_RDWR by IORESOURCE_MEM_WRITEABLEJean-Christophe PLAGNIOL-VILLARD2011-07-181-1/+0
| | | | | | | | | | | | | | we keep struct memory_platform_data for now on we will switch off the memories resources to struct resource Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | device: Add a dev_request_mem_region functionSascha Hauer2011-07-181-0/+14
| | | | | | | | | | | | | | | | | | | | | | We might want to add real resource tracking later. Also The first resource may not be a IORESOURCE_MEM at all. For these reasons introduce a wrapper function for driver so that they do not have to fiddle with resources directly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* | device: introduce resource structure to simplify resource declarationJean-Christophe PLAGNIOL-VILLARD2011-07-181-0/+4
|/ | | | | | | | | | | and add multi resource per device support for now we keep the old map_base and size temporary but will switch all of the used step by step to them resource way and mirror the first resource to the map_base and size if available Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* devfs: factor out core devfs functionalitySascha Hauer2011-04-111-0/+5
| | | | | | | | | This makes it possible to compile without devfs. devfs_create/devfs_remove is used by drivers and thus must still be present even without devfs support. Also, this patch adds cdev_open/cdev_close/cdev_flush/cdev_ioctl calls to work with devices without using the file api. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: implement flush functionSascha Hauer2011-04-111-0/+1
| | | | | | | Once we have caching in file functions we need a way to sync the the underlying devices. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs: remove unused struct filep* argument from open/closeSascha Hauer2011-04-111-2/+2
| | | | | | | the cdev layer is under the file layer, so it should not use struct filep*. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* device: fix dev_nameJean-Christophe PLAGNIOL-VILLARD2010-09-201-5/+7
| | | | | | | | | | | | dev_name is supposed to return the name of the device plus the id currently we use %s%d format where in the kernel the use %s.%d we may think to switch to this format for the device name and keeping the %s%d for the devfs this will be usefull to not modify the clock device name as example Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* use resource_size_t for device resourcesJean-Christophe PLAGNIOL-VILLARD2010-08-271-3/+2
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add partition mtd supportSascha Hauer2010-07-051-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rework device parametersSascha Hauer2010-06-171-1/+1
| | | | | | | | Change device parameters so that the memory management is in generic code. This also removes the need of storing statically initialized parameters as they are stored in a struct list_head for each device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>