i2c: QUP based bus driver for Qualcomm MSM chipsets
Subsystems (4)
v2 cover i2c: QUP based bus driver for Qualcomm MSM chipsets
Hi,
These patches incorporated requested changes from the v1 revision.
[PATCH 1/2] is for the header file that defines the platform data used by the driver. This patch can be picked up by the i2c maintainers but also needs to be acked by the msm maintainers (linux-arm-msm).
[PATCH 2/2] contains the QUP I2C driver.
Revision history:
v2: incorporated feedback from the following people:
[email protected] [email protected] [email protected]
Kenneth Heitke (2):
msm: i2c: Add msm_qup_i2c.h
i2c: QUP based bus driver for Qualcomm MSM chipsets
arch/arm/mach-msm/include/mach/msm_qup_i2c.h | 28 + drivers/i2c/busses/Kconfig | 12 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-qup.c | 1105 ++++++++++++++++++++++++++ 4 files changed, 1146 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-msm/include/mach/msm_qup_i2c.h create mode 100644 drivers/i2c/busses/i2c-qup.c
--
Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
PATCH v2 1/2 msm: i2c: Add msm_qup_i2c.h
Defines the platform data used by the MSM QUP I2C driver.
--- arch/arm/mach-msm/include/mach/msm_qup_i2c.h | 28 ++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-msm/include/mach/msm_qup_i2c.h
arch/arm/mach-msm/include/mach/msm_qup_i2c.h new file +28 -0
@@ -0,0 +1,28 @@ +/* +* Qualcomm MSM QUP i2c Controller Platform Data +* +* Copyright (c) 2010, Code Aurora Forum. 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 and +* only version 2 as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +* 02110-1301, USA. +*/ +#ifndef __MSM_QUP_I2C_MSM_H +#define __MSM_QUP_I2C_MSM_H + +struct msm_i2c_platform_data { +int bus_freq;/* I2C bus frequency (Hz) */ +int src_clk_rate;/* I2C controller clock rate (Hz) */ +}; + +#endif /* __MSM_QUP_I2C_MSM_H */
Signature · 5 lines
1.7.1.1 -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
PATCH v2 2/2 i2c: QUP based bus driver for Qualcomm MSM chipsets
In reply to Kenneth HeitkeThis bus driver supports the QUP i2c hardware controller in the Qualcomm MSM SOCs. The Qualcomm Universal Peripheral Engine (QUP) is a general purpose data path engine with input/output FIFOs and an embedded i2c mini-core. The driver supports FIFO mode (for low bandwidth applications) and block mode (interrupt generated for each block-size data transfer). The driver currently does not support DMA transfers.
--- drivers/i2c/busses/Kconfig | 12 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-qup.c | 1105 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1118 insertions(+), 0 deletions(-) create mode 100644 drivers/i2c/busses/i2c-qup.c
drivers/i2c/busses/Kconfig +12 -0
@@ -521,6 +521,18 @@ config I2C_PXA_SLAVE is necessary for systems where the PXA may be a target on the I2C bus. +config I2C_QUP + tristate "Qualcomm MSM QUP I2C Controller" + depends on (ARCH_MSM7X30 || ARCH_MSM8X60 || \ + (ARCH_QSD8X50 && MSM_SOC_REV_A)) + help + If you say yes to this option, support will be included for the + built-in QUP I2C interface on Qualcomm MSM family processors. + + The Qualcomm Universal Peripheral Engine (QUP) is a general + purpose data path engine with input/output FIFOs and an + embedded I2C mini-core. + config I2C_S3C2410 tristate "S3C2410 I2C Driver" depends on ARCH_S3C2410 || ARCH_S3C64XX
drivers/i2c/busses/Makefile +1 -0
@@ -50,6 +50,7 @@ obj-$(CONFIG_I2C_PCA_PLATFORM) += i2c-pca-platform.o obj-$(CONFIG_I2C_PMCMSP) += i2c-pmcmsp.o obj-$(CONFIG_I2C_PNX) += i2c-pnx.o obj-$(CONFIG_I2C_PXA) += i2c-pxa.o +obj-$(CONFIG_I2C_QUP) += i2c-qup.o obj-$(CONFIG_I2C_S3C2410) += i2c-s3c2410.o obj-$(CONFIG_I2C_S6000) += i2c-s6000.o obj-$(CONFIG_I2C_SH7760) += i2c-sh7760.o
drivers/i2c/busses/i2c-qup.c new file +1105 -0
1,105 lines not on this page · raw message
Signature · 5 lines
1.7.1.1 -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
[Kenneth]
drivers/i2c/busses/i2c-qup.c line 921
Quoted 5 lines
From: Kenneth Heitke [mailto:[email protected]]
Subject: [PATCH v2 2/2] i2c: QUP based bus driver for Qualcomm MSM chipsets
(...)drivers/i2c/busses/i2c-qup.c new file +1
-0+ dev->one_bit_t =USEC_PER_SEC /pdata->bus_freq;
Maybe you want to use DIV_ROUND_UP() from kernel.h here to be on the safe side?
Yours,
Linus Walleij