mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 04:48:04 +09:00
Merge branch 'develop' of 10.10.10.29:/home/rockchip/kernel into develop
This commit is contained in:
@@ -507,7 +507,7 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = {
|
||||
#if defined (CONFIG_SENSORS_AK8975)
|
||||
{
|
||||
.type = "ak8975",
|
||||
.addr = 0x1d,
|
||||
.addr = 0x0d,
|
||||
.flags = 0,
|
||||
.irq = RK29_PIN0_PA4,
|
||||
},
|
||||
|
||||
@@ -159,6 +159,13 @@ struct it7260_platform_data {
|
||||
};
|
||||
|
||||
|
||||
struct akm8975_platform_data {
|
||||
char layouts[3][3];
|
||||
char project_name[64];
|
||||
int gpio_DRDY;
|
||||
};
|
||||
|
||||
|
||||
void __init rk29_map_common_io(void);
|
||||
void __init rk29_clock_init(void);
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
#include "rk2818-sdmmc.h"
|
||||
|
||||
#define RK29_SDMMC_DATA_ERROR_FLAGS (SDMMC_INT_DRTO | SDMMC_INT_DCRC | SDMMC_INT_HTO | SDMMC_INT_SBE | SDMMC_INT_EBE)
|
||||
#define RK29_SDMMC_DATA_ERROR_FLAGS (SDMMC_INT_DRTO | SDMMC_INT_DCRC | SDMMC_INT_HTO | SDMMC_INT_SBE | SDMMC_INT_EBE | SDMMC_INT_FRUN)
|
||||
#define RK29_SDMMC_CMD_ERROR_FLAGS (SDMMC_INT_RTO | SDMMC_INT_RCRC | SDMMC_INT_RE | SDMMC_INT_HLE)
|
||||
#define RK29_SDMMC_ERROR_FLAGS (RK29_SDMMC_DATA_ERROR_FLAGS | RK29_SDMMC_CMD_ERROR_FLAGS | SDMMC_INT_HLE)
|
||||
#define RK29_SDMMC_SEND_STATUS 1
|
||||
@@ -310,6 +310,8 @@ static u32 rk29_sdmmc_prepare_command(struct mmc_host *mmc,
|
||||
|
||||
if(cmdr == 12)
|
||||
cmdr |= SDMMC_CMD_STOP;
|
||||
else if(cmdr == 13)
|
||||
cmdr &= ~SDMMC_CMD_PRV_DAT_WAIT;
|
||||
else
|
||||
cmdr |= SDMMC_CMD_PRV_DAT_WAIT;
|
||||
|
||||
@@ -338,12 +340,15 @@ static void rk29_sdmmc_start_command(struct rk29_sdmmc *host,
|
||||
struct mmc_command *cmd, u32 cmd_flags)
|
||||
{
|
||||
int tmo = 5000;
|
||||
unsigned long flags;
|
||||
host->cmd = cmd;
|
||||
dev_vdbg(&host->pdev->dev,
|
||||
"start cmd:%d ARGR=0x%08x CMDR=0x%08x\n",
|
||||
cmd->opcode, cmd->arg, cmd_flags);
|
||||
local_irq_save(flags);
|
||||
rk29_sdmmc_write(host->regs, SDMMC_CMDARG, cmd->arg); // write to SDMMC_CMDARG register
|
||||
rk29_sdmmc_write(host->regs, SDMMC_CMD, cmd_flags | SDMMC_CMD_START); // write to SDMMC_CMD register
|
||||
local_irq_restore(flags);
|
||||
|
||||
/* wait until CIU accepts the command */
|
||||
while (--tmo && (rk29_sdmmc_read(host->regs, SDMMC_CMD) & SDMMC_CMD_START))
|
||||
@@ -374,10 +379,10 @@ static int rk29_sdmmc_wait_unbusy(struct rk29_sdmmc *host)
|
||||
time_out--;
|
||||
if (!time_out) {
|
||||
time_out = time_out_us;
|
||||
rk29_sdmmc_reset_fifo(host);
|
||||
time_out2--;
|
||||
rk29_sdmmc_reset_fifo(host);
|
||||
if (!time_out2)
|
||||
break;
|
||||
time_out2--;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -775,6 +780,8 @@ static void rk29_sdmmc_command_complete(struct rk29_sdmmc *host,
|
||||
cmd->error = -EILSEQ;
|
||||
else if (status & SDMMC_INT_RE)
|
||||
cmd->error = -EIO;
|
||||
else if(status & SDMMC_INT_HLE)
|
||||
cmd->error = -EIO;
|
||||
else
|
||||
cmd->error = 0;
|
||||
|
||||
@@ -869,8 +876,7 @@ static void rk29_sdmmc_tasklet_func(unsigned long priv)
|
||||
status);
|
||||
data->error = -EIO;
|
||||
}
|
||||
}
|
||||
else {
|
||||
}else {
|
||||
data->bytes_xfered = data->blocks * data->blksz;
|
||||
data->error = 0;
|
||||
}
|
||||
@@ -1133,16 +1139,17 @@ static irqreturn_t rk29_sdmmc_interrupt(int irq, void *dev_id)
|
||||
if (!pending)
|
||||
break;
|
||||
if(pending & SDMMC_INT_CD) {
|
||||
writel(SDMMC_INT_CD, host->regs + SDMMC_RINTSTS); // clear sd detect int
|
||||
rk29_sdmmc_write(host->regs, SDMMC_RINTSTS, SDMMC_INT_CD); // clear sd detect int
|
||||
present = rk29_sdmmc_get_cd(host->mmc);
|
||||
present_old = test_bit(RK29_SDMMC_CARD_PRESENT, &host->flags);
|
||||
if(present != present_old) {
|
||||
if (present != 0) {
|
||||
set_bit(RK29_SDMMC_CARD_PRESENT, &host->flags);
|
||||
} else {
|
||||
mod_timer(&host->detect_timer, jiffies + msecs_to_jiffies(200));
|
||||
} else {
|
||||
clear_bit(RK29_SDMMC_CARD_PRESENT, &host->flags);
|
||||
mod_timer(&host->detect_timer, jiffies + msecs_to_jiffies(10));
|
||||
}
|
||||
mod_timer(&host->detect_timer, jiffies + msecs_to_jiffies(100));
|
||||
}
|
||||
}
|
||||
if(pending & RK29_SDMMC_CMD_ERROR_FLAGS) {
|
||||
@@ -1161,7 +1168,6 @@ static irqreturn_t rk29_sdmmc_interrupt(int irq, void *dev_id)
|
||||
tasklet_schedule(&host->tasklet);
|
||||
}
|
||||
|
||||
|
||||
if(pending & SDMMC_INT_DTO) {
|
||||
rk29_sdmmc_write(host->regs, SDMMC_RINTSTS,SDMMC_INT_DTO); // clear interrupt
|
||||
if (!host->data_status)
|
||||
@@ -1209,7 +1215,7 @@ static irqreturn_t rk29_sdmmc_interrupt(int irq, void *dev_id)
|
||||
static void rk29_sdmmc_detect_change(unsigned long data)
|
||||
{
|
||||
struct mmc_request *mrq;
|
||||
struct rk29_sdmmc *host = (struct rk29_sdmmc *)data;;
|
||||
struct rk29_sdmmc *host = (struct rk29_sdmmc *)data;
|
||||
|
||||
smp_rmb();
|
||||
if (test_bit(RK29_SDMMC_SHUTDOWN, &host->flags))
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
86
drivers/staging/iio/magnetometer/ak8975.h
Normal file
86
drivers/staging/iio/magnetometer/ak8975.h
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Definitions for akm8975 compass chip.
|
||||
*/
|
||||
#ifndef AKM8975_H
|
||||
#define AKM8975_H
|
||||
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
#define AKM8975_I2C_NAME "ak8975"
|
||||
|
||||
/*! \name AK8975 operation mode
|
||||
\anchor AK8975_Mode
|
||||
Defines an operation mode of the AK8975.*/
|
||||
/*! @{*/
|
||||
#define AK8975_MODE_SNG_MEASURE 0x01
|
||||
#define AK8975_MODE_SELF_TEST 0x08
|
||||
#define AK8975_MODE_FUSE_ACCESS 0x0F
|
||||
#define AK8975_MODE_POWERDOWN 0x00
|
||||
/*! @}*/
|
||||
|
||||
#define SENSOR_DATA_SIZE 8 /* Rx buffer size, i.e from ST1 to ST2 */
|
||||
#define RWBUF_SIZE 16 /* Read/Write buffer size.*/
|
||||
|
||||
|
||||
/*! \name AK8975 register address
|
||||
\anchor AK8975_REG
|
||||
Defines a register address of the AK8975.*/
|
||||
/*! @{*/
|
||||
#define AK8975_REG_WIA 0x00
|
||||
#define AK8975_REG_INFO 0x01
|
||||
#define AK8975_REG_ST1 0x02
|
||||
#define AK8975_REG_HXL 0x03
|
||||
#define AK8975_REG_HXH 0x04
|
||||
#define AK8975_REG_HYL 0x05
|
||||
#define AK8975_REG_HYH 0x06
|
||||
#define AK8975_REG_HZL 0x07
|
||||
#define AK8975_REG_HZH 0x08
|
||||
#define AK8975_REG_ST2 0x09
|
||||
#define AK8975_REG_CNTL 0x0A
|
||||
#define AK8975_REG_RSV 0x0B
|
||||
#define AK8975_REG_ASTC 0x0C
|
||||
#define AK8975_REG_TS1 0x0D
|
||||
#define AK8975_REG_TS2 0x0E
|
||||
#define AK8975_REG_I2CDIS 0x0F
|
||||
/*! @}*/
|
||||
|
||||
/*! \name AK8975 fuse-rom address
|
||||
\anchor AK8975_FUSE
|
||||
Defines a read-only address of the fuse ROM of the AK8975.*/
|
||||
/*! @{*/
|
||||
#define AK8975_FUSE_ASAX 0x10
|
||||
#define AK8975_FUSE_ASAY 0x11
|
||||
#define AK8975_FUSE_ASAZ 0x12
|
||||
/*! @}*/
|
||||
|
||||
#define AKMIO 0xA1
|
||||
|
||||
/* IOCTLs for AKM library */
|
||||
#define ECS_IOCTL_WRITE _IOW(AKMIO, 0x01, char*)
|
||||
#define ECS_IOCTL_READ _IOWR(AKMIO, 0x02, char*)
|
||||
#define ECS_IOCTL_RESET _IO(AKMIO, 0x03) /* NOT used in AK8975 */
|
||||
#define ECS_IOCTL_SET_MODE _IOW(AKMIO, 0x04, short)
|
||||
#define ECS_IOCTL_GETDATA _IOR(AKMIO, 0x05, char[SENSOR_DATA_SIZE])
|
||||
#define ECS_IOCTL_SET_YPR _IOW(AKMIO, 0x06, short[12])
|
||||
#define ECS_IOCTL_GET_OPEN_STATUS _IOR(AKMIO, 0x07, int)
|
||||
#define ECS_IOCTL_GET_CLOSE_STATUS _IOR(AKMIO, 0x08, int)
|
||||
#define ECS_IOCTL_GET_DELAY _IOR(AKMIO, 0x30, short)
|
||||
#define ECS_IOCTL_GET_PROJECT_NAME _IOR(AKMIO, 0x0D, char[64])
|
||||
#define ECS_IOCTL_GET_MATRIX _IOR(AKMIO, 0x0E, short [4][3][3])
|
||||
|
||||
/* IOCTLs for APPs */
|
||||
#define ECS_IOCTL_APP_SET_MODE _IOW(AKMIO, 0x10, short)
|
||||
#define ECS_IOCTL_APP_SET_MFLAG _IOW(AKMIO, 0x11, short)
|
||||
#define ECS_IOCTL_APP_GET_MFLAG _IOW(AKMIO, 0x12, short)
|
||||
#define ECS_IOCTL_APP_SET_AFLAG _IOW(AKMIO, 0x13, short)
|
||||
#define ECS_IOCTL_APP_GET_AFLAG _IOR(AKMIO, 0x14, short)
|
||||
#define ECS_IOCTL_APP_SET_TFLAG _IOR(AKMIO, 0x15, short)/* NOT use */
|
||||
#define ECS_IOCTL_APP_GET_TFLAG _IOR(AKMIO, 0x16, short)/* NOT use */
|
||||
#define ECS_IOCTL_APP_RESET_PEDOMETER _IO(AKMIO, 0x17) /* NOT use */
|
||||
#define ECS_IOCTL_APP_SET_DELAY _IOW(AKMIO, 0x18, short)
|
||||
#define ECS_IOCTL_APP_GET_DELAY ECS_IOCTL_GET_DELAY
|
||||
#define ECS_IOCTL_APP_SET_MVFLAG _IOW(AKMIO, 0x19, short)
|
||||
#define ECS_IOCTL_APP_GET_MVFLAG _IOR(AKMIO, 0x1A, short)
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user