A documentation fix and driver fixes for piix4, tegra, and i801
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmNljWkACgkQFA3kzBSg Kbaf0Q//YcbcLeFMrQiXThfe9b18emmGX8Fvd3T4zftFkN8nY5Iww2uNmNcieAS2 M4Ws0iyFUiNp/56VIrq9m2DLJ7DToCEogbVqTa+PaLWhD8POgPM74sOtn9WcFKtF 5JEtTTLRW++ydn5X6KUNw3lgSvWY2vkdedvdsqWyOKB4vnUpp/e5Ii+SojkSbWxs 8hQSV8XyPyi8Xn7HkoPJmWRdzupy0ug03Xm+9U0hT5kgSCKhHz4SUSVZVfLOn0I/ X4mNuGG2mRC8ygxljBrNNtj4YlGFDc/zD0eQJSWCNzn20548PMUL/zzz74Vq9SdB tJahOFeTv+m9V8oyMGRYrQR92V1wPa9JUYKrDUJnw5sBp7958OKNvO95Cu8HfV97 pHZtewy+w74f9Jr68tn73dRGXNDeH267KmI8WSyr8mNYgKVWwSiQfkHswglOMwrA NgS80i50YKG2q9IZdr2bFOOEB4jMPMiWTtB6JK1uf3dUiWGkznHI0ka/5la3cqpG JYRMfTGvveJL4shezp5+Qo9txIzL9lJPRLSNbRxpbsSTfmbYsegxYKXHvxAp6AMZ eEvG3DhIVviz+pQWgTQnPKSfQWLXngk2oCaL/0/e5DFi0kVI6Hzb8OsCv70f8k4+ p88A3y10HJQNqg+285CgSVnBthp3oFEoaPq5MFqyz9it072fXeQ= =nS/x -----END PGP SIGNATURE----- Merge tag 'i2c-for-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "A documentation fix and driver fixes for piix4, tegra, and i801" * tag 'i2c-for-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: Documentation: devres: add missing I2C helper i2c: i801: add lis3lv02d's I2C address for Vostro 5568 i2c: tegra: Allocate DMA memory for DMA engine i2c: piix4: Fix adapter not be removed in piix4_remove()
This commit is contained in:
Коммит
74f3f1d79a
|
@ -279,6 +279,7 @@ GPIO
|
||||||
devm_gpio_request_one()
|
devm_gpio_request_one()
|
||||||
|
|
||||||
I2C
|
I2C
|
||||||
|
devm_i2c_add_adapter()
|
||||||
devm_i2c_new_dummy_device()
|
devm_i2c_new_dummy_device()
|
||||||
|
|
||||||
IIO
|
IIO
|
||||||
|
|
|
@ -1243,6 +1243,7 @@ static const struct {
|
||||||
*/
|
*/
|
||||||
{ "Latitude 5480", 0x29 },
|
{ "Latitude 5480", 0x29 },
|
||||||
{ "Vostro V131", 0x1d },
|
{ "Vostro V131", 0x1d },
|
||||||
|
{ "Vostro 5568", 0x29 },
|
||||||
};
|
};
|
||||||
|
|
||||||
static void register_dell_lis3lv02d_i2c_device(struct i801_priv *priv)
|
static void register_dell_lis3lv02d_i2c_device(struct i801_priv *priv)
|
||||||
|
|
|
@ -1080,6 +1080,7 @@ static int piix4_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
||||||
"", &piix4_main_adapters[0]);
|
"", &piix4_main_adapters[0]);
|
||||||
if (retval < 0)
|
if (retval < 0)
|
||||||
return retval;
|
return retval;
|
||||||
|
piix4_adapter_count = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for auxiliary SMBus on some AMD chipsets */
|
/* Check for auxiliary SMBus on some AMD chipsets */
|
||||||
|
|
|
@ -284,6 +284,7 @@ struct tegra_i2c_dev {
|
||||||
struct dma_chan *tx_dma_chan;
|
struct dma_chan *tx_dma_chan;
|
||||||
struct dma_chan *rx_dma_chan;
|
struct dma_chan *rx_dma_chan;
|
||||||
unsigned int dma_buf_size;
|
unsigned int dma_buf_size;
|
||||||
|
struct device *dma_dev;
|
||||||
dma_addr_t dma_phys;
|
dma_addr_t dma_phys;
|
||||||
void *dma_buf;
|
void *dma_buf;
|
||||||
|
|
||||||
|
@ -420,7 +421,7 @@ static int tegra_i2c_dma_submit(struct tegra_i2c_dev *i2c_dev, size_t len)
|
||||||
static void tegra_i2c_release_dma(struct tegra_i2c_dev *i2c_dev)
|
static void tegra_i2c_release_dma(struct tegra_i2c_dev *i2c_dev)
|
||||||
{
|
{
|
||||||
if (i2c_dev->dma_buf) {
|
if (i2c_dev->dma_buf) {
|
||||||
dma_free_coherent(i2c_dev->dev, i2c_dev->dma_buf_size,
|
dma_free_coherent(i2c_dev->dma_dev, i2c_dev->dma_buf_size,
|
||||||
i2c_dev->dma_buf, i2c_dev->dma_phys);
|
i2c_dev->dma_buf, i2c_dev->dma_phys);
|
||||||
i2c_dev->dma_buf = NULL;
|
i2c_dev->dma_buf = NULL;
|
||||||
}
|
}
|
||||||
|
@ -472,10 +473,13 @@ static int tegra_i2c_init_dma(struct tegra_i2c_dev *i2c_dev)
|
||||||
|
|
||||||
i2c_dev->tx_dma_chan = chan;
|
i2c_dev->tx_dma_chan = chan;
|
||||||
|
|
||||||
|
WARN_ON(i2c_dev->tx_dma_chan->device != i2c_dev->rx_dma_chan->device);
|
||||||
|
i2c_dev->dma_dev = chan->device->dev;
|
||||||
|
|
||||||
i2c_dev->dma_buf_size = i2c_dev->hw->quirks->max_write_len +
|
i2c_dev->dma_buf_size = i2c_dev->hw->quirks->max_write_len +
|
||||||
I2C_PACKET_HEADER_SIZE;
|
I2C_PACKET_HEADER_SIZE;
|
||||||
|
|
||||||
dma_buf = dma_alloc_coherent(i2c_dev->dev, i2c_dev->dma_buf_size,
|
dma_buf = dma_alloc_coherent(i2c_dev->dma_dev, i2c_dev->dma_buf_size,
|
||||||
&dma_phys, GFP_KERNEL | __GFP_NOWARN);
|
&dma_phys, GFP_KERNEL | __GFP_NOWARN);
|
||||||
if (!dma_buf) {
|
if (!dma_buf) {
|
||||||
dev_err(i2c_dev->dev, "failed to allocate DMA buffer\n");
|
dev_err(i2c_dev->dev, "failed to allocate DMA buffer\n");
|
||||||
|
@ -1272,7 +1276,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
|
||||||
|
|
||||||
if (i2c_dev->dma_mode) {
|
if (i2c_dev->dma_mode) {
|
||||||
if (i2c_dev->msg_read) {
|
if (i2c_dev->msg_read) {
|
||||||
dma_sync_single_for_device(i2c_dev->dev,
|
dma_sync_single_for_device(i2c_dev->dma_dev,
|
||||||
i2c_dev->dma_phys,
|
i2c_dev->dma_phys,
|
||||||
xfer_size, DMA_FROM_DEVICE);
|
xfer_size, DMA_FROM_DEVICE);
|
||||||
|
|
||||||
|
@ -1280,7 +1284,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
} else {
|
} else {
|
||||||
dma_sync_single_for_cpu(i2c_dev->dev,
|
dma_sync_single_for_cpu(i2c_dev->dma_dev,
|
||||||
i2c_dev->dma_phys,
|
i2c_dev->dma_phys,
|
||||||
xfer_size, DMA_TO_DEVICE);
|
xfer_size, DMA_TO_DEVICE);
|
||||||
}
|
}
|
||||||
|
@ -1293,7 +1297,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
|
||||||
memcpy(i2c_dev->dma_buf + I2C_PACKET_HEADER_SIZE,
|
memcpy(i2c_dev->dma_buf + I2C_PACKET_HEADER_SIZE,
|
||||||
msg->buf, msg->len);
|
msg->buf, msg->len);
|
||||||
|
|
||||||
dma_sync_single_for_device(i2c_dev->dev,
|
dma_sync_single_for_device(i2c_dev->dma_dev,
|
||||||
i2c_dev->dma_phys,
|
i2c_dev->dma_phys,
|
||||||
xfer_size, DMA_TO_DEVICE);
|
xfer_size, DMA_TO_DEVICE);
|
||||||
|
|
||||||
|
@ -1344,7 +1348,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i2c_dev->msg_read && i2c_dev->msg_err == I2C_ERR_NONE) {
|
if (i2c_dev->msg_read && i2c_dev->msg_err == I2C_ERR_NONE) {
|
||||||
dma_sync_single_for_cpu(i2c_dev->dev,
|
dma_sync_single_for_cpu(i2c_dev->dma_dev,
|
||||||
i2c_dev->dma_phys,
|
i2c_dev->dma_phys,
|
||||||
xfer_size, DMA_FROM_DEVICE);
|
xfer_size, DMA_FROM_DEVICE);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче