mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 14:42:24 +00:00
Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: "Two bugfixes for the AT24 I2C eeprom driver and some minor corrections for I2C bus drivers" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: piix4: Fix port number check on release i2c: stm32: Fix copyrights i2c-cht-wc: constify platform_device_id eeprom: at24: change nvmem stride to 1 eeprom: at24: fix I2C device selection for runtime PM
This commit is contained in:
commit
f25e229560
@ -379,7 +379,7 @@ static int cht_wc_i2c_adap_i2c_remove(struct platform_device *pdev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct platform_device_id cht_wc_i2c_adap_id_table[] = {
|
static const struct platform_device_id cht_wc_i2c_adap_id_table[] = {
|
||||||
{ .name = "cht_wcove_ext_chgr" },
|
{ .name = "cht_wcove_ext_chgr" },
|
||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
|
@ -983,7 +983,7 @@ static void piix4_adap_remove(struct i2c_adapter *adap)
|
|||||||
|
|
||||||
if (adapdata->smba) {
|
if (adapdata->smba) {
|
||||||
i2c_del_adapter(adap);
|
i2c_del_adapter(adap);
|
||||||
if (adapdata->port == (0 << 1)) {
|
if (adapdata->port == (0 << piix4_port_shift_sb800)) {
|
||||||
release_region(adapdata->smba, SMBIOSIZE);
|
release_region(adapdata->smba, SMBIOSIZE);
|
||||||
if (adapdata->sb800_main)
|
if (adapdata->sb800_main)
|
||||||
release_region(SB800_PIIX4_SMB_IDX, 2);
|
release_region(SB800_PIIX4_SMB_IDX, 2);
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
/*
|
/*
|
||||||
* i2c-stm32.h
|
* i2c-stm32.h
|
||||||
*
|
*
|
||||||
* Copyright (C) M'boumba Cedric Madianga 2017
|
* Copyright (C) M'boumba Cedric Madianga 2017
|
||||||
|
* Copyright (C) STMicroelectronics 2017
|
||||||
* Author: M'boumba Cedric Madianga <cedric.madianga@gmail.com>
|
* Author: M'boumba Cedric Madianga <cedric.madianga@gmail.com>
|
||||||
*
|
*
|
||||||
* License terms: GNU General Public License (GPL), version 2
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _I2C_STM32_H
|
#ifndef _I2C_STM32_H
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
/*
|
/*
|
||||||
* Driver for STMicroelectronics STM32 I2C controller
|
* Driver for STMicroelectronics STM32 I2C controller
|
||||||
*
|
*
|
||||||
@ -6,11 +7,11 @@
|
|||||||
* http://www.st.com/resource/en/reference_manual/DM00031020.pdf
|
* http://www.st.com/resource/en/reference_manual/DM00031020.pdf
|
||||||
*
|
*
|
||||||
* Copyright (C) M'boumba Cedric Madianga 2016
|
* Copyright (C) M'boumba Cedric Madianga 2016
|
||||||
|
* Copyright (C) STMicroelectronics 2017
|
||||||
* Author: M'boumba Cedric Madianga <cedric.madianga@gmail.com>
|
* Author: M'boumba Cedric Madianga <cedric.madianga@gmail.com>
|
||||||
*
|
*
|
||||||
* This driver is based on i2c-st.c
|
* This driver is based on i2c-st.c
|
||||||
*
|
*
|
||||||
* License terms: GNU General Public License (GPL), version 2
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
/*
|
/*
|
||||||
* Driver for STMicroelectronics STM32F7 I2C controller
|
* Driver for STMicroelectronics STM32F7 I2C controller
|
||||||
*
|
*
|
||||||
@ -7,11 +8,11 @@
|
|||||||
* http://www.st.com/resource/en/reference_manual/dm00124865.pdf
|
* http://www.st.com/resource/en/reference_manual/dm00124865.pdf
|
||||||
*
|
*
|
||||||
* Copyright (C) M'boumba Cedric Madianga 2017
|
* Copyright (C) M'boumba Cedric Madianga 2017
|
||||||
|
* Copyright (C) STMicroelectronics 2017
|
||||||
* Author: M'boumba Cedric Madianga <cedric.madianga@gmail.com>
|
* Author: M'boumba Cedric Madianga <cedric.madianga@gmail.com>
|
||||||
*
|
*
|
||||||
* This driver is based on i2c-stm32f4.c
|
* This driver is based on i2c-stm32f4.c
|
||||||
*
|
*
|
||||||
* License terms: GNU General Public License (GPL), version 2
|
|
||||||
*/
|
*/
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
|
@ -562,7 +562,7 @@ static ssize_t at24_eeprom_write_i2c(struct at24_data *at24, const char *buf,
|
|||||||
static int at24_read(void *priv, unsigned int off, void *val, size_t count)
|
static int at24_read(void *priv, unsigned int off, void *val, size_t count)
|
||||||
{
|
{
|
||||||
struct at24_data *at24 = priv;
|
struct at24_data *at24 = priv;
|
||||||
struct i2c_client *client;
|
struct device *dev = &at24->client[0]->dev;
|
||||||
char *buf = val;
|
char *buf = val;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -572,11 +572,9 @@ static int at24_read(void *priv, unsigned int off, void *val, size_t count)
|
|||||||
if (off + count > at24->chip.byte_len)
|
if (off + count > at24->chip.byte_len)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
client = at24_translate_offset(at24, &off);
|
ret = pm_runtime_get_sync(dev);
|
||||||
|
|
||||||
ret = pm_runtime_get_sync(&client->dev);
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
pm_runtime_put_noidle(&client->dev);
|
pm_runtime_put_noidle(dev);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -592,7 +590,7 @@ static int at24_read(void *priv, unsigned int off, void *val, size_t count)
|
|||||||
status = at24->read_func(at24, buf, off, count);
|
status = at24->read_func(at24, buf, off, count);
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
mutex_unlock(&at24->lock);
|
mutex_unlock(&at24->lock);
|
||||||
pm_runtime_put(&client->dev);
|
pm_runtime_put(dev);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
buf += status;
|
buf += status;
|
||||||
@ -602,7 +600,7 @@ static int at24_read(void *priv, unsigned int off, void *val, size_t count)
|
|||||||
|
|
||||||
mutex_unlock(&at24->lock);
|
mutex_unlock(&at24->lock);
|
||||||
|
|
||||||
pm_runtime_put(&client->dev);
|
pm_runtime_put(dev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -610,7 +608,7 @@ static int at24_read(void *priv, unsigned int off, void *val, size_t count)
|
|||||||
static int at24_write(void *priv, unsigned int off, void *val, size_t count)
|
static int at24_write(void *priv, unsigned int off, void *val, size_t count)
|
||||||
{
|
{
|
||||||
struct at24_data *at24 = priv;
|
struct at24_data *at24 = priv;
|
||||||
struct i2c_client *client;
|
struct device *dev = &at24->client[0]->dev;
|
||||||
char *buf = val;
|
char *buf = val;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -620,11 +618,9 @@ static int at24_write(void *priv, unsigned int off, void *val, size_t count)
|
|||||||
if (off + count > at24->chip.byte_len)
|
if (off + count > at24->chip.byte_len)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
client = at24_translate_offset(at24, &off);
|
ret = pm_runtime_get_sync(dev);
|
||||||
|
|
||||||
ret = pm_runtime_get_sync(&client->dev);
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
pm_runtime_put_noidle(&client->dev);
|
pm_runtime_put_noidle(dev);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -640,7 +636,7 @@ static int at24_write(void *priv, unsigned int off, void *val, size_t count)
|
|||||||
status = at24->write_func(at24, buf, off, count);
|
status = at24->write_func(at24, buf, off, count);
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
mutex_unlock(&at24->lock);
|
mutex_unlock(&at24->lock);
|
||||||
pm_runtime_put(&client->dev);
|
pm_runtime_put(dev);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
buf += status;
|
buf += status;
|
||||||
@ -650,7 +646,7 @@ static int at24_write(void *priv, unsigned int off, void *val, size_t count)
|
|||||||
|
|
||||||
mutex_unlock(&at24->lock);
|
mutex_unlock(&at24->lock);
|
||||||
|
|
||||||
pm_runtime_put(&client->dev);
|
pm_runtime_put(dev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -880,7 +876,7 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
|
|||||||
at24->nvmem_config.reg_read = at24_read;
|
at24->nvmem_config.reg_read = at24_read;
|
||||||
at24->nvmem_config.reg_write = at24_write;
|
at24->nvmem_config.reg_write = at24_write;
|
||||||
at24->nvmem_config.priv = at24;
|
at24->nvmem_config.priv = at24;
|
||||||
at24->nvmem_config.stride = 4;
|
at24->nvmem_config.stride = 1;
|
||||||
at24->nvmem_config.word_size = 1;
|
at24->nvmem_config.word_size = 1;
|
||||||
at24->nvmem_config.size = chip.byte_len;
|
at24->nvmem_config.size = chip.byte_len;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user