Skip to content
Snippets Groups Projects
Commit 4d5e3790 authored by Gilad Avidov's avatar Gilad Avidov Committed by Michael Bohan
Browse files

i2c-msm-v2: Suport for long ptr and rid of pdata


Remove dependency on platfrom data which is declared
on the no longer exists arch/arm directory. Support for
longer pointers.

Change-Id: I453284211cb701f2e3f065f41652d8aaba571f08
Signed-off-by: default avatarGilad Avidov <gavidov@codeaurora.org>
parent 2606fcbd
No related branches found
No related tags found
No related merge requests found
/* Copyright (c) 2013, The Linux Foundation. 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.
*
*/
/*
* I2C driver for Qualcomm MSM platforms.
*/
#ifndef _MACH_MSM_I2C_MSM_H
#define _MACH_MSM_I2C_MSM_H
/**
* i2c_msm_v2_platform_data: i2c-msm-v2 driver configuration data
*
* @clk_freq_in core clock frequency in Hz
* @clk_freq_out bus clock frequency in Hz
* @bam_pipe_idx_cons index of BAM's consumer pipe
* @bam_pipe_idx_prod index of BAM's producer pipe
* @bam_disable disables DMA transfers.
* @noise_rjct_scl number of low samples on clock line to consider it low.
* @noise_rjct_sda number of low samples on data line to consider it low.
* @active_only when set, votes when system active and removes the vote when
* system goes idle (optimises for performance). When unset, voting using
* runtime pm (optimizes for power).
* @master_id master id number of the i2c core or its wrapper (BLSP/GSBI).
* When zero, clock path voting is disabled.
*/
struct i2c_msm_v2_platform_data {
int clk_freq_in;
int clk_freq_out;
u32 bam_pipe_idx_cons;
u32 bam_pipe_idx_prod;
bool bam_disable;
int noise_rjct_scl;
int noise_rjct_sda;
bool active_only;
u32 master_id;
};
#endif
This diff is collapsed.
......@@ -241,7 +241,7 @@ enum msm_spi_clk_path_vec_idx {
I2C_MSM_CLK_PATH_RESUME_VEC,
};
#define I2C_MSM_CLK_PATH_AVRG_BW(ctrl) (0)
#define I2C_MSM_CLK_PATH_BRST_BW(ctrl) (ctrl->pdata->clk_freq_in * 8)
#define I2C_MSM_CLK_PATH_BRST_BW(ctrl) (ctrl->rsrcs.clk_freq_in * 8)
static char const * const i2c_msm_gpio_names[] = {"i2c_clk", "i2c_sda"};
......@@ -371,7 +371,7 @@ struct i2c_msm_xfer_mode_bam {
struct resource *mem;
void __iomem *base;
u32 handle;
ulong handle;
u32 irq;
struct i2c_msm_bam_pipe pipe[2];
};
......@@ -475,17 +475,24 @@ struct i2c_msm_dbgfs {
/*
* qup_i2c_clk_path_vote: data to use bus scaling driver for clock path vote
*
* @mstr_id master id number of the i2c core or its wrapper (BLSP/GSBI).
* When zero, clock path voting is disabled.
* @client_hdl when zero, client is not registered with the bus scaling driver,
* and bus scaling functionality should not be used. When non zero, it
* is a bus scaling client id and may be used to vote for clock path.
* @reg_err when true, registration error was detected and an error message was
* logged. i2c will attempt to re-register but will log error only once.
* once registration succeed, the flag is set to false.
* @actv_only when set, votes when system active and removes the vote when
* system goes idle (optimises for performance). When unset, voting using
* runtime pm (optimizes for power).
*/
struct qup_i2c_clk_path_vote {
u32 mstr_id;
u32 client_hdl;
struct msm_bus_scale_pdata *pdata;
bool reg_err;
bool actv_only;
};
/*
......@@ -493,14 +500,23 @@ struct qup_i2c_clk_path_vote {
*
* @mem I2C controller memory resource from platform data.
* @base I2C controller virtual base address
* @clk_freq_in core clock frequency in Hz
* @clk_freq_out bus clock frequency in Hz
* @bam_pipe_idx_cons index of BAM's consumer pipe
* @bam_pipe_idx_prod index of BAM's producer pipe
*/
struct i2c_msm_resources {
struct resource *mem;
void __iomem *base; /* virtual */
struct clk *core_clk;
struct clk *iface_clk;
int clk_freq_in;
int clk_freq_out;
struct qup_i2c_clk_path_vote clk_path_vote;
int irq;
bool disable_dma;
u32 bam_pipe_idx_cons;
u32 bam_pipe_idx_prod;
struct pinctrl *pinctrl;
struct pinctrl_state *gpio_state_active;
struct pinctrl_state *gpio_state_suspend;
......@@ -552,7 +568,9 @@ typedef void (*i2c_msm_prof_dump_func_func_t)(struct i2c_msm_ctrl *,
struct i2c_msm_prof_event {
i2c_msm_prof_dump_func_func_t dump_func;
struct timespec time;
u32 data[3];
u64 data0;
u32 data1;
u32 data2;
u8 type;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment