summaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_s3c.c
Commit message (Collapse)AuthorAgeFilesLines
* serial: Drop .remove functions from all driversAndrey Smirnov2018-04-171-10/+0
| | | | | | | | | | | | | | | | | | | Depending on specifics, some 'serdev' devices might need prevent parent console device from being removed and corresponding memory deallocated to properly function until the very end of Barebox's execution. An example of such a use-case would be a reset handler relying on a serdev device for transport. To avoid having to develop complicatione reference counting/ownership scheme drop all of the code that calls console_unregister() and frees the memory effectively making the problem above impossible to arise. All of the de-initialization that serial drivers were doing in their .remove functions was somewhat superflous anyway, so this change should be pretty harmless. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: replace dev_request_mem_region with dev_request_mem_resourceSascha Hauer2016-03-071-1/+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>
* 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>
* 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>
* 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 Samsung: add the S3C64xx requirementsJuergen Beisert2012-08-011-0/+3
| | | | | Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Samsung/serial: make the clock source configureableJuergen Beisert2012-07-251-6/+12
| | | | | | | | | Instead of taking the value from somewhere, use the selected architecture to select one. This ensures the selected clock source corresponds to the values setup in the clocks-*.c from the mach directory. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Samsung/serial: unify UCON register settingsJuergen Beisert2012-07-251-3/+7
| | | | | | | | | This should work on S3C24XX and S3C64XX SoCs. Tested at runtime on a Mini2440 and Mini6410. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Samsung/serial: move the decision about an improved UART into KconfigJuergen Beisert2012-07-251-8/+8
| | | | | | | More or less just cosmetic (removing ifdefs!). Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Samsung/serial: there is no need to ifdef the slot tableJuergen Beisert2012-07-251-2/+0
| | | | | | | | | The '__maybe_unused' attribute prevents the compiler from warning about an unused variable and the 'static' will remove it entirely if it's not used. This patch is only cosmetic. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Samsung/serial: there is no need to ifdef these register definesJuergen Beisert2012-07-251-6/+2
| | | | | Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Samsung/serial: make the code more readableJuergen Beisert2012-07-251-3/+5
| | | | | | | This bit magic is just setting and reading the UART's selected clock source. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Samsung/serial: remove more ugly ifdef linesJuergen Beisert2012-07-251-5/+4
| | | | | | | | More or less just cosmetic. Easier to read, and lets the compiler remove unused code. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Support most Samsung SoCs in S3C serial driverAlexey Galakhov2012-05-141-17/+38
| | | | | | | | | | | | | | | | Ok, I assume this should go into separate series. It fits both S5PV210 and S3C6410. This adds support for S3C and S5P architectures (all of my knowledge) to the serial driver. Since the only difference between them is in clock handling, this is moved to an arch-dependent separate function. Most modern architectures should define S3C_UART_HAS_UBRDIVSLOT and S3C_UART_HAS_UINTM. This adds support for most Signed-off-by: Alexey Galakhov <agalakhov@gmail.com> Signed-off-by: Juergen Beisewrt <kernel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial S3: fix local structure mallocJuergen Beisert2012-03-131-1/+1
| | | | | | | | | Patch 2c5404651091e985c9009aa417d80fdaf50d7a68 introduces a private structure for the S3C based UARTs but still reserves the memory for the smaller structure which fails at runtime. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* serial s3c: add a driver private structSascha Hauer2012-02-251-19/+28
| | | | | | | Do not use dev->priv as a register base, but use a driver private struct instead. Also, remove usage of dev->type_data Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* MACH SAMSUNG/S3C: Unify the UART driver for the S3C family of CPUsJuergen Beisert2012-01-021-0/+188
The UART is one of the units which differs only slightly inside the S3C family. Prepare this driver to share it with more recent CPUs. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>