]> git.ipfire.org Git - people/ms/linux.git/blob - arch/arm/mach-pxa/pxa2xx.c
ac72acb43e26f8ea5f5d0ed0a1c0e2b4a13fef86
[people/ms/linux.git] / arch / arm / mach-pxa / pxa2xx.c
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * linux/arch/arm/mach-pxa/pxa2xx.c
4 *
5 * code specific to pxa2xx
6 *
7 * Copyright (C) 2008 Dmitry Baryshkov
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/pxa2xx-regs.h>
16 #include "mfp-pxa25x.h"
17 #include <mach/reset.h>
18 #include <linux/platform_data/irda-pxaficp.h>
19
20 void pxa2xx_clear_reset_status(unsigned int mask)
21 {
22 /* RESET_STATUS_* has a 1:1 mapping with RCSR */
23 RCSR = mask;
24 }
25
26 static unsigned long pxa2xx_mfp_fir[] = {
27 GPIO46_FICP_RXD,
28 GPIO47_FICP_TXD,
29 };
30
31 static unsigned long pxa2xx_mfp_sir[] = {
32 GPIO46_STUART_RXD,
33 GPIO47_STUART_TXD,
34 };
35
36 static unsigned long pxa2xx_mfp_off[] = {
37 GPIO46_GPIO | MFP_LPM_DRIVE_LOW,
38 GPIO47_GPIO | MFP_LPM_DRIVE_LOW,
39 };
40
41 void pxa2xx_transceiver_mode(struct device *dev, int mode)
42 {
43 if (mode & IR_OFF) {
44 pxa2xx_mfp_config(pxa2xx_mfp_off, ARRAY_SIZE(pxa2xx_mfp_off));
45 } else if (mode & IR_SIRMODE) {
46 pxa2xx_mfp_config(pxa2xx_mfp_sir, ARRAY_SIZE(pxa2xx_mfp_sir));
47 } else if (mode & IR_FIRMODE) {
48 pxa2xx_mfp_config(pxa2xx_mfp_fir, ARRAY_SIZE(pxa2xx_mfp_fir));
49 } else
50 BUG();
51 }
52 EXPORT_SYMBOL_GPL(pxa2xx_transceiver_mode);