Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
fb2896a7
Commit
fb2896a7
authored
Jul 13, 2018
by
Wolfram Sang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'i2c/precise-locking-names_immutable' into i2c/for-4.19
parents
0bff2a86
3f3a89e1
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
70 additions
and
82 deletions
+70
-82
drivers/char/tpm/tpm_i2c_infineon.c
drivers/char/tpm/tpm_i2c_infineon.c
+4
-4
drivers/i2c/busses/i2c-brcmstb.c
drivers/i2c/busses/i2c-brcmstb.c
+4
-4
drivers/i2c/busses/i2c-davinci.c
drivers/i2c/busses/i2c-davinci.c
+2
-2
drivers/i2c/busses/i2c-gpio.c
drivers/i2c/busses/i2c-gpio.c
+20
-20
drivers/i2c/busses/i2c-s3c2410.c
drivers/i2c/busses/i2c-s3c2410.c
+2
-2
drivers/i2c/busses/i2c-sprd.c
drivers/i2c/busses/i2c-sprd.c
+4
-4
drivers/i2c/i2c-core-slave.c
drivers/i2c/i2c-core-slave.c
+4
-4
drivers/i2c/muxes/i2c-mux-pca9541.c
drivers/i2c/muxes/i2c-mux-pca9541.c
+3
-3
drivers/iio/temperature/mlx90614.c
drivers/iio/temperature/mlx90614.c
+2
-2
drivers/input/touchscreen/rohm_bu21023.c
drivers/input/touchscreen/rohm_bu21023.c
+2
-2
drivers/media/dvb-frontends/af9013.c
drivers/media/dvb-frontends/af9013.c
+4
-4
drivers/media/dvb-frontends/drxk_hard.c
drivers/media/dvb-frontends/drxk_hard.c
+2
-2
drivers/media/dvb-frontends/rtl2830.c
drivers/media/dvb-frontends/rtl2830.c
+6
-6
drivers/media/dvb-frontends/tda1004x.c
drivers/media/dvb-frontends/tda1004x.c
+3
-3
drivers/media/tuners/tda18271-common.c
drivers/media/tuners/tda18271-common.c
+4
-4
drivers/mfd/88pm860x-i2c.c
drivers/mfd/88pm860x-i2c.c
+4
-4
include/linux/i2c.h
include/linux/i2c.h
+0
-12
No files found.
drivers/char/tpm/tpm_i2c_infineon.c
View file @
fb2896a7
...
...
@@ -117,7 +117,7 @@ static int iic_tpm_read(u8 addr, u8 *buffer, size_t len)
/* Lock the adapter for the duration of the whole sequence. */
if
(
!
tpm_dev
.
client
->
adapter
->
algo
->
master_xfer
)
return
-
EOPNOTSUPP
;
i2c_lock_
adapter
(
tpm_dev
.
client
->
adapter
);
i2c_lock_
bus
(
tpm_dev
.
client
->
adapter
,
I2C_LOCK_SEGMENT
);
if
(
tpm_dev
.
chip_type
==
SLB9645
)
{
/* use a combined read for newer chips
...
...
@@ -192,7 +192,7 @@ static int iic_tpm_read(u8 addr, u8 *buffer, size_t len)
}
out:
i2c_unlock_
adapter
(
tpm_dev
.
client
->
adapter
);
i2c_unlock_
bus
(
tpm_dev
.
client
->
adapter
,
I2C_LOCK_SEGMENT
);
/* take care of 'guard time' */
usleep_range
(
SLEEP_DURATION_LOW
,
SLEEP_DURATION_HI
);
...
...
@@ -224,7 +224,7 @@ static int iic_tpm_write_generic(u8 addr, u8 *buffer, size_t len,
if
(
!
tpm_dev
.
client
->
adapter
->
algo
->
master_xfer
)
return
-
EOPNOTSUPP
;
i2c_lock_
adapter
(
tpm_dev
.
client
->
adapter
);
i2c_lock_
bus
(
tpm_dev
.
client
->
adapter
,
I2C_LOCK_SEGMENT
);
/* prepend the 'register address' to the buffer */
tpm_dev
.
buf
[
0
]
=
addr
;
...
...
@@ -243,7 +243,7 @@ static int iic_tpm_write_generic(u8 addr, u8 *buffer, size_t len,
usleep_range
(
sleep_low
,
sleep_hi
);
}
i2c_unlock_
adapter
(
tpm_dev
.
client
->
adapter
);
i2c_unlock_
bus
(
tpm_dev
.
client
->
adapter
,
I2C_LOCK_SEGMENT
);
/* take care of 'guard time' */
usleep_range
(
SLEEP_DURATION_LOW
,
SLEEP_DURATION_HI
);
...
...
drivers/i2c/busses/i2c-brcmstb.c
View file @
fb2896a7
...
...
@@ -689,9 +689,9 @@ static int brcmstb_i2c_suspend(struct device *dev)
{
struct
brcmstb_i2c_dev
*
i2c_dev
=
dev_get_drvdata
(
dev
);
i2c_lock_
adapter
(
&
i2c_dev
->
adapter
);
i2c_lock_
bus
(
&
i2c_dev
->
adapter
,
I2C_LOCK_ROOT_ADAPTER
);
i2c_dev
->
is_suspended
=
true
;
i2c_unlock_
adapter
(
&
i2c_dev
->
adapter
);
i2c_unlock_
bus
(
&
i2c_dev
->
adapter
,
I2C_LOCK_ROOT_ADAPTER
);
return
0
;
}
...
...
@@ -700,10 +700,10 @@ static int brcmstb_i2c_resume(struct device *dev)
{
struct
brcmstb_i2c_dev
*
i2c_dev
=
dev_get_drvdata
(
dev
);
i2c_lock_
adapter
(
&
i2c_dev
->
adapter
);
i2c_lock_
bus
(
&
i2c_dev
->
adapter
,
I2C_LOCK_ROOT_ADAPTER
);
brcmstb_i2c_set_bsc_reg_defaults
(
i2c_dev
);
i2c_dev
->
is_suspended
=
false
;
i2c_unlock_
adapter
(
&
i2c_dev
->
adapter
);
i2c_unlock_
bus
(
&
i2c_dev
->
adapter
,
I2C_LOCK_ROOT_ADAPTER
);
return
0
;
}
...
...
drivers/i2c/busses/i2c-davinci.c
View file @
fb2896a7
...
...
@@ -714,14 +714,14 @@ static int i2c_davinci_cpufreq_transition(struct notifier_block *nb,
dev
=
container_of
(
nb
,
struct
davinci_i2c_dev
,
freq_transition
);
i2c_lock_
adapter
(
&
dev
->
adapter
);
i2c_lock_
bus
(
&
dev
->
adapter
,
I2C_LOCK_ROOT_ADAPTER
);
if
(
val
==
CPUFREQ_PRECHANGE
)
{
davinci_i2c_reset_ctrl
(
dev
,
0
);
}
else
if
(
val
==
CPUFREQ_POSTCHANGE
)
{
i2c_davinci_calc_clk_dividers
(
dev
);
davinci_i2c_reset_ctrl
(
dev
,
1
);
}
i2c_unlock_
adapter
(
&
dev
->
adapter
);
i2c_unlock_
bus
(
&
dev
->
adapter
,
I2C_LOCK_ROOT_ADAPTER
);
return
0
;
}
...
...
drivers/i2c/busses/i2c-gpio.c
View file @
fb2896a7
...
...
@@ -78,24 +78,24 @@ static struct dentry *i2c_gpio_debug_dir;
#define getscl(bd) ((bd)->getscl((bd)->data))
#define WIRE_ATTRIBUTE(wire) \
static int fops_##wire##_get(void *data, u64 *val) \
{ \
struct i2c_gpio_private_data *priv = data; \
\
i2c_lock_
adapter(&priv->adap);
\
*val = get##wire(&priv->bit_data); \
i2c_unlock_
adapter(&priv->adap);
\
return 0; \
} \
static int fops_##wire##_set(void *data, u64 val) \
{ \
struct i2c_gpio_private_data *priv = data; \
\
i2c_lock_
adapter(&priv->adap);
\
set##wire(&priv->bit_data, val); \
i2c_unlock_
adapter(&priv->adap);
\
return 0; \
} \
static int fops_##wire##_get(void *data, u64 *val)
\
{
\
struct i2c_gpio_private_data *priv = data;
\
\
i2c_lock_
bus(&priv->adap, I2C_LOCK_ROOT_ADAPTER);
\
*val = get##wire(&priv->bit_data);
\
i2c_unlock_
bus(&priv->adap, I2C_LOCK_ROOT_ADAPTER);
\
return 0;
\
}
\
static int fops_##wire##_set(void *data, u64 val)
\
{
\
struct i2c_gpio_private_data *priv = data;
\
\
i2c_lock_
bus(&priv->adap, I2C_LOCK_ROOT_ADAPTER);
\
set##wire(&priv->bit_data, val);
\
i2c_unlock_
bus(&priv->adap, I2C_LOCK_ROOT_ADAPTER);
\
return 0;
\
}
\
DEFINE_DEBUGFS_ATTRIBUTE(fops_##wire, fops_##wire##_get, fops_##wire##_set, "%llu\n")
WIRE_ATTRIBUTE
(
scl
);
...
...
@@ -107,7 +107,7 @@ static void i2c_gpio_incomplete_transfer(struct i2c_gpio_private_data *priv,
struct
i2c_algo_bit_data
*
bit_data
=
&
priv
->
bit_data
;
int
i
;
i2c_lock_
adapter
(
&
priv
->
adap
);
i2c_lock_
bus
(
&
priv
->
adap
,
I2C_LOCK_ROOT_ADAPTER
);
/* START condition */
setsda
(
bit_data
,
0
);
...
...
@@ -123,7 +123,7 @@ static void i2c_gpio_incomplete_transfer(struct i2c_gpio_private_data *priv,
udelay
(
bit_data
->
udelay
);
}
i2c_unlock_
adapter
(
&
priv
->
adap
);
i2c_unlock_
bus
(
&
priv
->
adap
,
I2C_LOCK_ROOT_ADAPTER
);
}
static
int
fops_incomplete_addr_phase_set
(
void
*
data
,
u64
addr
)
...
...
drivers/i2c/busses/i2c-s3c2410.c
View file @
fb2896a7
...
...
@@ -919,9 +919,9 @@ static int s3c24xx_i2c_cpufreq_transition(struct notifier_block *nb,
if
((
val
==
CPUFREQ_POSTCHANGE
&&
delta_f
<
0
)
||
(
val
==
CPUFREQ_PRECHANGE
&&
delta_f
>
0
))
{
i2c_lock_
adapter
(
&
i2c
->
adap
);
i2c_lock_
bus
(
&
i2c
->
adap
,
I2C_LOCK_ROOT_ADAPTER
);
ret
=
s3c24xx_i2c_clockrate
(
i2c
,
&
got
);
i2c_unlock_
adapter
(
&
i2c
->
adap
);
i2c_unlock_
bus
(
&
i2c
->
adap
,
I2C_LOCK_ROOT_ADAPTER
);
if
(
ret
<
0
)
dev_err
(
i2c
->
dev
,
"cannot find frequency (%d)
\n
"
,
ret
);
...
...
drivers/i2c/busses/i2c-sprd.c
View file @
fb2896a7
...
...
@@ -590,9 +590,9 @@ static int __maybe_unused sprd_i2c_suspend_noirq(struct device *pdev)
{
struct
sprd_i2c
*
i2c_dev
=
dev_get_drvdata
(
pdev
);
i2c_lock_
adapter
(
&
i2c_dev
->
adap
);
i2c_lock_
bus
(
&
i2c_dev
->
adap
,
I2C_LOCK_ROOT_ADAPTER
);
i2c_dev
->
is_suspended
=
true
;
i2c_unlock_
adapter
(
&
i2c_dev
->
adap
);
i2c_unlock_
bus
(
&
i2c_dev
->
adap
,
I2C_LOCK_ROOT_ADAPTER
);
return
pm_runtime_force_suspend
(
pdev
);
}
...
...
@@ -601,9 +601,9 @@ static int __maybe_unused sprd_i2c_resume_noirq(struct device *pdev)
{
struct
sprd_i2c
*
i2c_dev
=
dev_get_drvdata
(
pdev
);
i2c_lock_
adapter
(
&
i2c_dev
->
adap
);
i2c_lock_
bus
(
&
i2c_dev
->
adap
,
I2C_LOCK_ROOT_ADAPTER
);
i2c_dev
->
is_suspended
=
false
;
i2c_unlock_
adapter
(
&
i2c_dev
->
adap
);
i2c_unlock_
bus
(
&
i2c_dev
->
adap
,
I2C_LOCK_ROOT_ADAPTER
);
return
pm_runtime_force_resume
(
pdev
);
}
...
...
drivers/i2c/i2c-core-slave.c
View file @
fb2896a7
...
...
@@ -47,9 +47,9 @@ int i2c_slave_register(struct i2c_client *client, i2c_slave_cb_t slave_cb)
client
->
slave_cb
=
slave_cb
;
i2c_lock_
adapter
(
client
->
adapter
);
i2c_lock_
bus
(
client
->
adapter
,
I2C_LOCK_ROOT_ADAPTER
);
ret
=
client
->
adapter
->
algo
->
reg_slave
(
client
);
i2c_unlock_
adapter
(
client
->
adapter
);
i2c_unlock_
bus
(
client
->
adapter
,
I2C_LOCK_ROOT_ADAPTER
);
if
(
ret
)
{
client
->
slave_cb
=
NULL
;
...
...
@@ -69,9 +69,9 @@ int i2c_slave_unregister(struct i2c_client *client)
return
-
EOPNOTSUPP
;
}
i2c_lock_
adapter
(
client
->
adapter
);
i2c_lock_
bus
(
client
->
adapter
,
I2C_LOCK_ROOT_ADAPTER
);
ret
=
client
->
adapter
->
algo
->
unreg_slave
(
client
);
i2c_unlock_
adapter
(
client
->
adapter
);
i2c_unlock_
bus
(
client
->
adapter
,
I2C_LOCK_ROOT_ADAPTER
);
if
(
ret
==
0
)
client
->
slave_cb
=
NULL
;
...
...
drivers/i2c/muxes/i2c-mux-pca9541.c
View file @
fb2896a7
...
...
@@ -298,11 +298,11 @@ static int pca9541_probe(struct i2c_client *client,
/*
* I2C accesses are unprotected here.
* We have to lock the
adapter
before releasing the bus.
* We have to lock the
I2C segment
before releasing the bus.
*/
i2c_lock_
adapter
(
adap
);
i2c_lock_
bus
(
adap
,
I2C_LOCK_SEGMENT
);
pca9541_release_bus
(
client
);
i2c_unlock_
adapter
(
adap
);
i2c_unlock_
bus
(
adap
,
I2C_LOCK_SEGMENT
);
/* Create mux adapter */
...
...
drivers/iio/temperature/mlx90614.c
View file @
fb2896a7
...
...
@@ -433,11 +433,11 @@ static int mlx90614_wakeup(struct mlx90614_data *data)
dev_dbg
(
&
data
->
client
->
dev
,
"Requesting wake-up"
);
i2c_lock_
adapter
(
data
->
client
->
adapter
);
i2c_lock_
bus
(
data
->
client
->
adapter
,
I2C_LOCK_ROOT_ADAPTER
);
gpiod_direction_output
(
data
->
wakeup_gpio
,
0
);
msleep
(
MLX90614_TIMING_WAKEUP
);
gpiod_direction_input
(
data
->
wakeup_gpio
);
i2c_unlock_
adapter
(
data
->
client
->
adapter
);
i2c_unlock_
bus
(
data
->
client
->
adapter
,
I2C_LOCK_ROOT_ADAPTER
);
data
->
ready_timestamp
=
jiffies
+
msecs_to_jiffies
(
MLX90614_TIMING_STARTUP
);
...
...
drivers/input/touchscreen/rohm_bu21023.c
View file @
fb2896a7
...
...
@@ -304,7 +304,7 @@ static int rohm_i2c_burst_read(struct i2c_client *client, u8 start, void *buf,
msg
[
1
].
len
=
len
;
msg
[
1
].
buf
=
buf
;
i2c_lock_
adapter
(
adap
);
i2c_lock_
bus
(
adap
,
I2C_LOCK_SEGMENT
);
for
(
i
=
0
;
i
<
2
;
i
++
)
{
if
(
__i2c_transfer
(
adap
,
&
msg
[
i
],
1
)
<
0
)
{
...
...
@@ -313,7 +313,7 @@ static int rohm_i2c_burst_read(struct i2c_client *client, u8 start, void *buf,
}
}
i2c_unlock_
adapter
(
adap
);
i2c_unlock_
bus
(
adap
,
I2C_LOCK_SEGMENT
);
return
ret
;
}
...
...
drivers/media/dvb-frontends/af9013.c
View file @
fb2896a7
...
...
@@ -1312,10 +1312,10 @@ static int af9013_wregs(struct i2c_client *client, u8 cmd, u16 reg,
memcpy
(
&
buf
[
3
],
val
,
len
);
if
(
lock
)
i2c_lock_
adapter
(
client
->
adapter
);
i2c_lock_
bus
(
client
->
adapter
,
I2C_LOCK_SEGMENT
);
ret
=
__i2c_transfer
(
client
->
adapter
,
msg
,
1
);
if
(
lock
)
i2c_unlock_
adapter
(
client
->
adapter
);
i2c_unlock_
bus
(
client
->
adapter
,
I2C_LOCK_SEGMENT
);
if
(
ret
<
0
)
{
goto
err
;
}
else
if
(
ret
!=
1
)
{
...
...
@@ -1353,10 +1353,10 @@ static int af9013_rregs(struct i2c_client *client, u8 cmd, u16 reg,
buf
[
2
]
=
cmd
;
if
(
lock
)
i2c_lock_
adapter
(
client
->
adapter
);
i2c_lock_
bus
(
client
->
adapter
,
I2C_LOCK_SEGMENT
);
ret
=
__i2c_transfer
(
client
->
adapter
,
msg
,
2
);
if
(
lock
)
i2c_unlock_
adapter
(
client
->
adapter
);
i2c_unlock_
bus
(
client
->
adapter
,
I2C_LOCK_SEGMENT
);
if
(
ret
<
0
)
{
goto
err
;
}
else
if
(
ret
!=
2
)
{
...
...
drivers/media/dvb-frontends/drxk_hard.c
View file @
fb2896a7
...
...
@@ -213,7 +213,7 @@ static inline u32 log10times100(u32 value)
static
int
drxk_i2c_lock
(
struct
drxk_state
*
state
)
{
i2c_lock_
adapter
(
state
->
i2c
);
i2c_lock_
bus
(
state
->
i2c
,
I2C_LOCK_SEGMENT
);
state
->
drxk_i2c_exclusive_lock
=
true
;
return
0
;
...
...
@@ -224,7 +224,7 @@ static void drxk_i2c_unlock(struct drxk_state *state)
if
(
!
state
->
drxk_i2c_exclusive_lock
)
return
;
i2c_unlock_
adapter
(
state
->
i2c
);
i2c_unlock_
bus
(
state
->
i2c
,
I2C_LOCK_SEGMENT
);
state
->
drxk_i2c_exclusive_lock
=
false
;
}
...
...
drivers/media/dvb-frontends/rtl2830.c
View file @
fb2896a7
...
...
@@ -24,9 +24,9 @@ static int rtl2830_bulk_write(struct i2c_client *client, unsigned int reg,
struct
rtl2830_dev
*
dev
=
i2c_get_clientdata
(
client
);
int
ret
;
i2c_lock_
adapter
(
client
->
adapter
);
i2c_lock_
bus
(
client
->
adapter
,
I2C_LOCK_SEGMENT
);
ret
=
regmap_bulk_write
(
dev
->
regmap
,
reg
,
val
,
val_count
);
i2c_unlock_
adapter
(
client
->
adapter
);
i2c_unlock_
bus
(
client
->
adapter
,
I2C_LOCK_SEGMENT
);
return
ret
;
}
...
...
@@ -36,9 +36,9 @@ static int rtl2830_update_bits(struct i2c_client *client, unsigned int reg,
struct
rtl2830_dev
*
dev
=
i2c_get_clientdata
(
client
);
int
ret
;
i2c_lock_
adapter
(
client
->
adapter
);
i2c_lock_
bus
(
client
->
adapter
,
I2C_LOCK_SEGMENT
);
ret
=
regmap_update_bits
(
dev
->
regmap
,
reg
,
mask
,
val
);
i2c_unlock_
adapter
(
client
->
adapter
);
i2c_unlock_
bus
(
client
->
adapter
,
I2C_LOCK_SEGMENT
);
return
ret
;
}
...
...
@@ -48,9 +48,9 @@ static int rtl2830_bulk_read(struct i2c_client *client, unsigned int reg,
struct
rtl2830_dev
*
dev
=
i2c_get_clientdata
(
client
);
int
ret
;
i2c_lock_
adapter
(
client
->
adapter
);
i2c_lock_
bus
(
client
->
adapter
,
I2C_LOCK_SEGMENT
);
ret
=
regmap_bulk_read
(
dev
->
regmap
,
reg
,
val
,
val_count
);
i2c_unlock_
adapter
(
client
->
adapter
);
i2c_unlock_
bus
(
client
->
adapter
,
I2C_LOCK_SEGMENT
);
return
ret
;
}
...
...
drivers/media/dvb-frontends/tda1004x.c
View file @
fb2896a7
...
...
@@ -329,7 +329,7 @@ static int tda1004x_do_upload(struct tda1004x_state *state,
tda1004x_write_byteI
(
state
,
dspCodeCounterReg
,
0
);
fw_msg
.
addr
=
state
->
config
->
demod_address
;
i2c_lock_
adapter
(
state
->
i2c
);
i2c_lock_
bus
(
state
->
i2c
,
I2C_LOCK_SEGMENT
);
buf
[
0
]
=
dspCodeInReg
;
while
(
pos
!=
len
)
{
// work out how much to send this time
...
...
@@ -342,14 +342,14 @@ static int tda1004x_do_upload(struct tda1004x_state *state,
fw_msg
.
len
=
tx_size
+
1
;
if
(
__i2c_transfer
(
state
->
i2c
,
&
fw_msg
,
1
)
!=
1
)
{
printk
(
KERN_ERR
"tda1004x: Error during firmware upload
\n
"
);
i2c_unlock_
adapter
(
state
->
i2c
);
i2c_unlock_
bus
(
state
->
i2c
,
I2C_LOCK_SEGMENT
);
return
-
EIO
;
}
pos
+=
tx_size
;
dprintk
(
"%s: fw_pos=0x%x
\n
"
,
__func__
,
pos
);
}
i2c_unlock_
adapter
(
state
->
i2c
);
i2c_unlock_
bus
(
state
->
i2c
,
I2C_LOCK_SEGMENT
);
/* give the DSP a chance to settle 03/10/05 Hac */
msleep
(
100
);
...
...
drivers/media/tuners/tda18271-common.c
View file @
fb2896a7
...
...
@@ -225,7 +225,7 @@ static int __tda18271_write_regs(struct dvb_frontend *fe, int idx, int len,
*/
if
(
lock_i2c
)
{
tda18271_i2c_gate_ctrl
(
fe
,
1
);
i2c_lock_
adapter
(
priv
->
i2c_props
.
adap
);
i2c_lock_
bus
(
priv
->
i2c_props
.
adap
,
I2C_LOCK_SEGMENT
);
}
while
(
len
)
{
if
(
max
>
len
)
...
...
@@ -246,7 +246,7 @@ static int __tda18271_write_regs(struct dvb_frontend *fe, int idx, int len,
len
-=
max
;
}
if
(
lock_i2c
)
{
i2c_unlock_
adapter
(
priv
->
i2c_props
.
adap
);
i2c_unlock_
bus
(
priv
->
i2c_props
.
adap
,
I2C_LOCK_SEGMENT
);
tda18271_i2c_gate_ctrl
(
fe
,
0
);
}
...
...
@@ -300,7 +300,7 @@ int tda18271_init_regs(struct dvb_frontend *fe)
* as those could cause bad things
*/
tda18271_i2c_gate_ctrl
(
fe
,
1
);
i2c_lock_
adapter
(
priv
->
i2c_props
.
adap
);
i2c_lock_
bus
(
priv
->
i2c_props
.
adap
,
I2C_LOCK_SEGMENT
);
/* initialize registers */
switch
(
priv
->
id
)
{
...
...
@@ -516,7 +516,7 @@ int tda18271_init_regs(struct dvb_frontend *fe)
/* synchronize */
__tda18271_write_regs
(
fe
,
R_EP1
,
1
,
false
);
i2c_unlock_
adapter
(
priv
->
i2c_props
.
adap
);
i2c_unlock_
bus
(
priv
->
i2c_props
.
adap
,
I2C_LOCK_SEGMENT
);
tda18271_i2c_gate_ctrl
(
fe
,
0
);
return
0
;
...
...
drivers/mfd/88pm860x-i2c.c
View file @
fb2896a7
...
...
@@ -146,14 +146,14 @@ int pm860x_page_reg_write(struct i2c_client *i2c, int reg,
unsigned
char
zero
;
int
ret
;
i2c_lock_
adapter
(
i2c
->
adapter
);
i2c_lock_
bus
(
i2c
->
adapter
,
I2C_LOCK_SEGMENT
);
read_device
(
i2c
,
0xFA
,
0
,
&
zero
);
read_device
(
i2c
,
0xFB
,
0
,
&
zero
);
read_device
(
i2c
,
0xFF
,
0
,
&
zero
);
ret
=
write_device
(
i2c
,
reg
,
1
,
&
data
);
read_device
(
i2c
,
0xFE
,
0
,
&
zero
);
read_device
(
i2c
,
0xFC
,
0
,
&
zero
);
i2c_unlock_
adapter
(
i2c
->
adapter
);
i2c_unlock_
bus
(
i2c
->
adapter
,
I2C_LOCK_SEGMENT
);
return
ret
;
}
EXPORT_SYMBOL
(
pm860x_page_reg_write
);
...
...
@@ -164,14 +164,14 @@ int pm860x_page_bulk_read(struct i2c_client *i2c, int reg,
unsigned
char
zero
=
0
;
int
ret
;
i2c_lock_
adapter
(
i2c
->
adapter
);
i2c_lock_
bus
(
i2c
->
adapter
,
I2C_LOCK_SEGMENT
);
read_device
(
i2c
,
0xfa
,
0
,
&
zero
);
read_device
(
i2c
,
0xfb
,
0
,
&
zero
);
read_device
(
i2c
,
0xff
,
0
,
&
zero
);
ret
=
read_device
(
i2c
,
reg
,
count
,
buf
);
read_device
(
i2c
,
0xFE
,
0
,
&
zero
);
read_device
(
i2c
,
0xFC
,
0
,
&
zero
);
i2c_unlock_
adapter
(
i2c
->
adapter
);
i2c_unlock_
bus
(
i2c
->
adapter
,
I2C_LOCK_SEGMENT
);
return
ret
;
}
EXPORT_SYMBOL
(
pm860x_page_bulk_read
);
include/linux/i2c.h
View file @
fb2896a7
...
...
@@ -759,18 +759,6 @@ i2c_unlock_bus(struct i2c_adapter *adapter, unsigned int flags)
adapter
->
lock_ops
->
unlock_bus
(
adapter
,
flags
);
}
static
inline
void
i2c_lock_adapter
(
struct
i2c_adapter
*
adapter
)
{
i2c_lock_bus
(
adapter
,
I2C_LOCK_ROOT_ADAPTER
);
}
static
inline
void
i2c_unlock_adapter
(
struct
i2c_adapter
*
adapter
)
{
i2c_unlock_bus
(
adapter
,
I2C_LOCK_ROOT_ADAPTER
);
}
/*flags for the client struct: */
#define I2C_CLIENT_PEC 0x04
/* Use Packet Error Checking */
#define I2C_CLIENT_TEN 0x10
/* we have a ten bit chip address */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment