2008-07-02 19:53:45 +07:00
|
|
|
/*
|
|
|
|
* linux/arch/arm/mach-pxa/pxa2xx.c
|
|
|
|
*
|
|
|
|
* code specific to pxa2xx
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008 Dmitry Baryshkov
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/device.h>
|
2012-03-21 02:33:19 +07:00
|
|
|
#include <linux/io.h>
|
2008-07-02 19:53:45 +07:00
|
|
|
|
2008-08-07 17:05:25 +07:00
|
|
|
#include <mach/hardware.h>
|
|
|
|
#include <mach/pxa2xx-regs.h>
|
2008-08-05 22:14:15 +07:00
|
|
|
#include <mach/mfp-pxa25x.h>
|
2008-08-07 17:05:25 +07:00
|
|
|
#include <mach/reset.h>
|
2008-08-05 22:14:15 +07:00
|
|
|
#include <mach/irda.h>
|
2008-07-02 19:53:45 +07:00
|
|
|
|
2008-07-29 13:26:00 +07:00
|
|
|
void pxa2xx_clear_reset_status(unsigned int mask)
|
|
|
|
{
|
|
|
|
/* RESET_STATUS_* has a 1:1 mapping with RCSR */
|
|
|
|
RCSR = mask;
|
|
|
|
}
|
|
|
|
|
2008-07-02 19:53:45 +07:00
|
|
|
static unsigned long pxa2xx_mfp_fir[] = {
|
|
|
|
GPIO46_FICP_RXD,
|
|
|
|
GPIO47_FICP_TXD,
|
|
|
|
};
|
|
|
|
|
|
|
|
static unsigned long pxa2xx_mfp_sir[] = {
|
|
|
|
GPIO46_STUART_RXD,
|
|
|
|
GPIO47_STUART_TXD,
|
|
|
|
};
|
|
|
|
|
|
|
|
static unsigned long pxa2xx_mfp_off[] = {
|
|
|
|
GPIO46_GPIO | MFP_LPM_DRIVE_LOW,
|
|
|
|
GPIO47_GPIO | MFP_LPM_DRIVE_LOW,
|
|
|
|
};
|
|
|
|
|
|
|
|
void pxa2xx_transceiver_mode(struct device *dev, int mode)
|
|
|
|
{
|
|
|
|
if (mode & IR_OFF) {
|
|
|
|
pxa2xx_mfp_config(pxa2xx_mfp_off, ARRAY_SIZE(pxa2xx_mfp_off));
|
|
|
|
} else if (mode & IR_SIRMODE) {
|
|
|
|
pxa2xx_mfp_config(pxa2xx_mfp_sir, ARRAY_SIZE(pxa2xx_mfp_sir));
|
|
|
|
} else if (mode & IR_FIRMODE) {
|
|
|
|
pxa2xx_mfp_config(pxa2xx_mfp_fir, ARRAY_SIZE(pxa2xx_mfp_fir));
|
|
|
|
} else
|
|
|
|
BUG();
|
|
|
|
}
|
2009-07-17 17:50:43 +07:00
|
|
|
EXPORT_SYMBOL_GPL(pxa2xx_transceiver_mode);
|