mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
793ffb9ed3
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
74 lines
1.6 KiB
C
74 lines
1.6 KiB
C
/*
|
|
* ssp.h
|
|
*
|
|
* Copyright (C) 2003 Russell King, All Rights Reserved.
|
|
*
|
|
* 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.
|
|
*
|
|
* This driver supports the following PXA CPU/SSP ports:-
|
|
*
|
|
* PXA250 SSP
|
|
* PXA255 SSP, NSSP
|
|
* PXA26x SSP, NSSP, ASSP
|
|
* PXA27x SSP1, SSP2, SSP3
|
|
* PXA3xx SSP1, SSP2, SSP3, SSP4
|
|
*/
|
|
|
|
#ifndef __ASM_ARCH_SSP_H
|
|
#define __ASM_ARCH_SSP_H
|
|
|
|
#include <linux/list.h>
|
|
#include <linux/io.h>
|
|
|
|
enum pxa_ssp_type {
|
|
SSP_UNDEFINED = 0,
|
|
PXA25x_SSP, /* pxa 210, 250, 255, 26x */
|
|
PXA25x_NSSP, /* pxa 255, 26x (including ASSP) */
|
|
PXA27x_SSP,
|
|
};
|
|
|
|
struct ssp_device {
|
|
struct platform_device *pdev;
|
|
struct list_head node;
|
|
|
|
struct clk *clk;
|
|
void __iomem *mmio_base;
|
|
unsigned long phys_base;
|
|
|
|
const char *label;
|
|
int port_id;
|
|
int type;
|
|
int use_count;
|
|
int irq;
|
|
int drcmr_rx;
|
|
int drcmr_tx;
|
|
};
|
|
|
|
/**
|
|
* ssp_write_reg - Write to a SSP register
|
|
*
|
|
* @dev: SSP device to access
|
|
* @reg: Register to write to
|
|
* @val: Value to be written.
|
|
*/
|
|
static inline void ssp_write_reg(struct ssp_device *dev, u32 reg, u32 val)
|
|
{
|
|
__raw_writel(val, dev->mmio_base + reg);
|
|
}
|
|
|
|
/**
|
|
* ssp_read_reg - Read from a SSP register
|
|
*
|
|
* @dev: SSP device to access
|
|
* @reg: Register to read from
|
|
*/
|
|
static inline u32 ssp_read_reg(struct ssp_device *dev, u32 reg)
|
|
{
|
|
return __raw_readl(dev->mmio_base + reg);
|
|
}
|
|
|
|
struct ssp_device *ssp_request(int port, const char *label);
|
|
void ssp_free(struct ssp_device *);
|
|
#endif /* __ASM_ARCH_SSP_H */
|