Commit fee61247 authored by Jarkko Nikula's avatar Jarkko Nikula Committed by Wolfram Sang

i2c: designware: Remove common i2c_dw_disable_int()

Commit 90312351 ("i2c: designware: MASTER mode as separated driver")
introduced disable_int pointer but there is no real use for it. Both
i2c-designware-master.c and i2c-designware-slave.c set it to the same
i2c_dw_disable_int() and scope is inside the same kernel module.

Since i2c_dw_disable_int() is just masking interrupts and the direct
DW_IC_INTR_MASK register write looks more clear in the code use that and
remove it from common code.
Signed-off-by: default avatarJarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent a92c3388
...@@ -625,10 +625,5 @@ void i2c_dw_disable(struct dw_i2c_dev *dev) ...@@ -625,10 +625,5 @@ void i2c_dw_disable(struct dw_i2c_dev *dev)
i2c_dw_release_lock(dev); i2c_dw_release_lock(dev);
} }
void i2c_dw_disable_int(struct dw_i2c_dev *dev)
{
regmap_write(dev->map, DW_IC_INTR_MASK, 0);
}
MODULE_DESCRIPTION("Synopsys DesignWare I2C bus adapter core"); MODULE_DESCRIPTION("Synopsys DesignWare I2C bus adapter core");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -232,7 +232,6 @@ struct reset_control; ...@@ -232,7 +232,6 @@ struct reset_control;
* -1 if there is no semaphore. * -1 if there is no semaphore.
* @shared_with_punit: true if this bus is shared with the SoCs PUNIT * @shared_with_punit: true if this bus is shared with the SoCs PUNIT
* @disable: function to disable the controller * @disable: function to disable the controller
* @disable_int: function to disable all interrupts
* @init: function to initialize the I2C hardware * @init: function to initialize the I2C hardware
* @set_sda_hold_time: callback to retrieve IP specific SDA hold timing * @set_sda_hold_time: callback to retrieve IP specific SDA hold timing
* @mode: operation mode - DW_IC_MASTER or DW_IC_SLAVE * @mode: operation mode - DW_IC_MASTER or DW_IC_SLAVE
...@@ -290,7 +289,6 @@ struct dw_i2c_dev { ...@@ -290,7 +289,6 @@ struct dw_i2c_dev {
int semaphore_idx; int semaphore_idx;
bool shared_with_punit; bool shared_with_punit;
void (*disable)(struct dw_i2c_dev *dev); void (*disable)(struct dw_i2c_dev *dev);
void (*disable_int)(struct dw_i2c_dev *dev);
int (*init)(struct dw_i2c_dev *dev); int (*init)(struct dw_i2c_dev *dev);
int (*set_sda_hold_time)(struct dw_i2c_dev *dev); int (*set_sda_hold_time)(struct dw_i2c_dev *dev);
int mode; int mode;
...@@ -331,7 +329,6 @@ int i2c_dw_handle_tx_abort(struct dw_i2c_dev *dev); ...@@ -331,7 +329,6 @@ int i2c_dw_handle_tx_abort(struct dw_i2c_dev *dev);
int i2c_dw_set_fifo_size(struct dw_i2c_dev *dev); int i2c_dw_set_fifo_size(struct dw_i2c_dev *dev);
u32 i2c_dw_func(struct i2c_adapter *adap); u32 i2c_dw_func(struct i2c_adapter *adap);
void i2c_dw_disable(struct dw_i2c_dev *dev); void i2c_dw_disable(struct dw_i2c_dev *dev);
void i2c_dw_disable_int(struct dw_i2c_dev *dev);
static inline void __i2c_dw_enable(struct dw_i2c_dev *dev) static inline void __i2c_dw_enable(struct dw_i2c_dev *dev)
{ {
......
...@@ -239,7 +239,7 @@ static void i2c_dw_xfer_init(struct dw_i2c_dev *dev) ...@@ -239,7 +239,7 @@ static void i2c_dw_xfer_init(struct dw_i2c_dev *dev)
msgs[dev->msg_write_idx].addr | ic_tar); msgs[dev->msg_write_idx].addr | ic_tar);
/* Enforce disabled interrupts (due to HW issues) */ /* Enforce disabled interrupts (due to HW issues) */
i2c_dw_disable_int(dev); regmap_write(dev->map, DW_IC_INTR_MASK, 0);
/* Enable the adapter */ /* Enable the adapter */
__i2c_dw_enable(dev); __i2c_dw_enable(dev);
...@@ -299,7 +299,7 @@ static int amd_i2c_dw_xfer_quirk(struct i2c_adapter *adap, struct i2c_msg *msgs, ...@@ -299,7 +299,7 @@ static int amd_i2c_dw_xfer_quirk(struct i2c_adapter *adap, struct i2c_msg *msgs,
dev->msgs = msgs; dev->msgs = msgs;
dev->msgs_num = num_msgs; dev->msgs_num = num_msgs;
i2c_dw_xfer_init(dev); i2c_dw_xfer_init(dev);
i2c_dw_disable_int(dev); regmap_write(dev->map, DW_IC_INTR_MASK, 0);
/* Initiate messages read/write transaction */ /* Initiate messages read/write transaction */
for (msg_wrt_idx = 0; msg_wrt_idx < num_msgs; msg_wrt_idx++) { for (msg_wrt_idx = 0; msg_wrt_idx < num_msgs; msg_wrt_idx++) {
...@@ -770,7 +770,7 @@ static irqreturn_t i2c_dw_isr(int this_irq, void *dev_id) ...@@ -770,7 +770,7 @@ static irqreturn_t i2c_dw_isr(int this_irq, void *dev_id)
else if (unlikely(dev->flags & ACCESS_INTR_MASK)) { else if (unlikely(dev->flags & ACCESS_INTR_MASK)) {
/* Workaround to trigger pending interrupt */ /* Workaround to trigger pending interrupt */
regmap_read(dev->map, DW_IC_INTR_MASK, &stat); regmap_read(dev->map, DW_IC_INTR_MASK, &stat);
i2c_dw_disable_int(dev); regmap_write(dev->map, DW_IC_INTR_MASK, 0);
regmap_write(dev->map, DW_IC_INTR_MASK, stat); regmap_write(dev->map, DW_IC_INTR_MASK, stat);
} }
...@@ -871,7 +871,6 @@ int i2c_dw_probe_master(struct dw_i2c_dev *dev) ...@@ -871,7 +871,6 @@ int i2c_dw_probe_master(struct dw_i2c_dev *dev)
dev->init = i2c_dw_init_master; dev->init = i2c_dw_init_master;
dev->disable = i2c_dw_disable; dev->disable = i2c_dw_disable;
dev->disable_int = i2c_dw_disable_int;
ret = i2c_dw_init_regmap(dev); ret = i2c_dw_init_regmap(dev);
if (ret) if (ret)
...@@ -910,7 +909,7 @@ int i2c_dw_probe_master(struct dw_i2c_dev *dev) ...@@ -910,7 +909,7 @@ int i2c_dw_probe_master(struct dw_i2c_dev *dev)
if (ret) if (ret)
return ret; return ret;
i2c_dw_disable_int(dev); regmap_write(dev->map, DW_IC_INTR_MASK, 0);
i2c_dw_release_lock(dev); i2c_dw_release_lock(dev);
ret = devm_request_irq(dev->dev, dev->irq, i2c_dw_isr, irq_flags, ret = devm_request_irq(dev->dev, dev->irq, i2c_dw_isr, irq_flags,
......
...@@ -87,7 +87,7 @@ static int i2c_dw_unreg_slave(struct i2c_client *slave) ...@@ -87,7 +87,7 @@ static int i2c_dw_unreg_slave(struct i2c_client *slave)
{ {
struct dw_i2c_dev *dev = i2c_get_adapdata(slave->adapter); struct dw_i2c_dev *dev = i2c_get_adapdata(slave->adapter);
dev->disable_int(dev); regmap_write(dev->map, DW_IC_INTR_MASK, 0);
dev->disable(dev); dev->disable(dev);
synchronize_irq(dev->irq); synchronize_irq(dev->irq);
dev->slave = NULL; dev->slave = NULL;
...@@ -232,7 +232,6 @@ int i2c_dw_probe_slave(struct dw_i2c_dev *dev) ...@@ -232,7 +232,6 @@ int i2c_dw_probe_slave(struct dw_i2c_dev *dev)
dev->init = i2c_dw_init_slave; dev->init = i2c_dw_init_slave;
dev->disable = i2c_dw_disable; dev->disable = i2c_dw_disable;
dev->disable_int = i2c_dw_disable_int;
ret = i2c_dw_init_regmap(dev); ret = i2c_dw_init_regmap(dev);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment