summaryrefslogtreecommitdiffstats
path: root/drivers/serial/stm-serial.c
Commit message (Collapse)AuthorAgeFilesLines
* driver: replace dev_request_mem_region with dev_request_mem_resourceSascha Hauer2016-03-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_request_mem_region doesn't work properly one some SoCs on which PTR_ERR() values clash with valid return values from dev_request_mem_region. Replace them with dev_request_mem_resource where possible. This patch has been generated with the following semantic patch: // <smpl> @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { ... - return PTR_ERR(io); -} + return PTR_ERR(iores); +} +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) - return PTR_ERR(io); -} + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); -if (IS_ERR(io)) { - ret = PTR_ERR(io); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) { + ret = PTR_ERR(iores); ... } +io = IOMEM(iores->start); ...+> } @@ expression d; expression n; expression io; identifier func; @@ func(...) { +struct resource *iores; <+... -io = dev_request_mem_region(d, n); +iores = dev_request_mem_resource(d, n); +if (IS_ERR(iores)) + return PTR_ERR(iores); +io = IOMEM(iores->start); ...+> } @@ identifier func; @@ func(...) { <+... struct resource *iores; -struct resource *iores; ...+> } // </smpl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: stm_serial: Add devicetree supportSascha Hauer2015-01-281-0/+9
| | | | | | | | | | This adds device tree support for the stm serial driver. This driver really is a AMBA primecell, so the amba-pl011 could be used. However, the current code tries to get the apb_pclk before the clocks are registered, so this does not work. Use the stm driver instead until a solution is found. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: remove unnecessary mach/imx-regs.h includeSascha Hauer2015-01-051-1/+0
| | | | | | And replace the ones needed with the SoC specific header. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: Let dev_request_mem_region return an error pointerSascha Hauer2014-09-161-0/+2
| | | | | | For all users fix or add the error check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: drop f_caps and check the function pointer getc/putc insteadJean-Christophe PLAGNIOL-VILLARD2013-09-211-1/+0
| | | | | | | | | | None of the driver make the difference between STDOUT and STDERR. So we just need to check if putc or getc are filled in the console_device save 32 bytes on versatilepb Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial: stm: Use clk supportSascha Hauer2013-06-201-1/+7
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/device-driver-macros'Sascha Hauer2013-04-041-8/+1
|\
| * Introduce console_platform_driver() macro and use it for serial driversAlexander Shiyan2013-03-141-8/+1
| | | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | driver/serial: stm-serial: fix flushMarc Kleine-Budde2013-03-151-1/+2
|/ | | | | | | Wait until fifo is empty, not until fifo is not full. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* switch all platform_bus device/driver registering to ↵Jean-Christophe PLAGNIOL-VILLARD2012-10-041-1/+1
| | | | | | | | 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>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-3/+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>
* serial stm: fix unregisterSascha Hauer2012-02-251-3/+6
| | | | | | | - Add missing console_unregister call - use dev->priv instead of dev->type_data Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce io.hSascha Hauer2011-09-221-1/+1
| | | | | | | To allow for some generic io accessors introduce io.h and use this instead of asm/io.h throughout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial stm: get rid of map_baseSascha Hauer2011-07-281-46/+48
| | | | | | | | While at it, dynamically allocate private driver struct. There might be only a single instance of this driver, but don't be a bad example for others. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* STM378x: Do not configure any pin usage in the driverJuergen Beisert2010-12-141-7/+0
| | | | | | | | Only the platform should configure pins to be used by the driver. The driver must work independently from the settings. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* STM378x: Use Hz as the clock unit like in all other archJuergen Beisert2010-12-141-1/+1
| | | | | | | | | | i.MX23 currently uses kHz as the unit for its clock handling and calculation to avoid overflows when calculation with the internal 480 MHz PLL and its fractional divider. This patch changes all routines to accept Hz and deliver Hz as the clock unit. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add the driver for the i.MX23 debug UARTJuergen Beisert2010-10-111-0/+202
The i.MX23 comes with a special UART dedicated for debugging purposes. This one is mostly used for the console the user can reach. Signed-off-by: Juergen Beisert <jbe@pengutronix.de>