David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * linux/arch/arm/mach-pxa/pxa2xx.c |
| 4 | * |
| 5 | * code specific to pxa2xx |
| 6 | * |
| 7 | * Copyright (C) 2008 Dmitry Baryshkov |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #include <linux/module.h> |
| 11 | #include <linux/kernel.h> |
| 12 | #include <linux/device.h> |
| 13 | #include <linux/io.h> |
| 14 | |
| 15 | #include <mach/hardware.h> |
| 16 | #include <mach/pxa2xx-regs.h> |
| 17 | #include "mfp-pxa25x.h" |
| 18 | #include <mach/reset.h> |
| 19 | #include <linux/platform_data/irda-pxaficp.h> |
| 20 | |
| 21 | void pxa2xx_clear_reset_status(unsigned int mask) |
| 22 | { |
| 23 | /* RESET_STATUS_* has a 1:1 mapping with RCSR */ |
| 24 | RCSR = mask; |
| 25 | } |
| 26 | |
| 27 | static unsigned long pxa2xx_mfp_fir[] = { |
| 28 | GPIO46_FICP_RXD, |
| 29 | GPIO47_FICP_TXD, |
| 30 | }; |
| 31 | |
| 32 | static unsigned long pxa2xx_mfp_sir[] = { |
| 33 | GPIO46_STUART_RXD, |
| 34 | GPIO47_STUART_TXD, |
| 35 | }; |
| 36 | |
| 37 | static unsigned long pxa2xx_mfp_off[] = { |
| 38 | GPIO46_GPIO | MFP_LPM_DRIVE_LOW, |
| 39 | GPIO47_GPIO | MFP_LPM_DRIVE_LOW, |
| 40 | }; |
| 41 | |
| 42 | void pxa2xx_transceiver_mode(struct device *dev, int mode) |
| 43 | { |
| 44 | if (mode & IR_OFF) { |
| 45 | pxa2xx_mfp_config(pxa2xx_mfp_off, ARRAY_SIZE(pxa2xx_mfp_off)); |
| 46 | } else if (mode & IR_SIRMODE) { |
| 47 | pxa2xx_mfp_config(pxa2xx_mfp_sir, ARRAY_SIZE(pxa2xx_mfp_sir)); |
| 48 | } else if (mode & IR_FIRMODE) { |
| 49 | pxa2xx_mfp_config(pxa2xx_mfp_fir, ARRAY_SIZE(pxa2xx_mfp_fir)); |
| 50 | } else |
| 51 | BUG(); |
| 52 | } |
| 53 | EXPORT_SYMBOL_GPL(pxa2xx_transceiver_mode); |