- 01 6月, 2017 2 次提交
-
-
由 Wolfram Sang 提交于
Also removes some ifdeffery. Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
The I2C core became quite huge and its monolithic structure makes maintenance hard. So, prepare to break out some functionality into separate files by renaming the source file. Note that we keep the resulting object name constant to avoid regressions. Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 23 5月, 2017 1 次提交
-
-
由 Jan Kiszka 提交于
We need to initializes those variables to 0 for platforms that do not provide ACPI parameters. Otherwise, we set sda_hold_time to random values, breaking e.g. Galileo and IOT2000 boards. Reported-and-tested-by: NLinus Torvalds <torvalds@linux-foundation.org> Reported-by: NTobias Klausmann <tobias.johannes.klausmann@mni.thm.de> Fixes: 9d640843 ("i2c: designware: don't infer timings described by ACPI from clock rate") Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com> Reviewed-by: NArd Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 22 5月, 2017 2 次提交
-
-
由 Jan Kiszka 提交于
We need to initializes those variables to 0 for platforms that do not provide ACPI parameters. Otherwise, we set sda_hold_time to random values, breaking e.g. Galileo and IOT2000 boards. Fixes: 9d640843 ("i2c: designware: don't infer timings described by ACPI from clock rate") Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com> Reviewed-by: NArd Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Sebastian Reichel 提交于
Since v4.9 i2c-tiny-usb generates the below call trace and longer works, since it can't communicate with the USB device. The reason is, that since v4.9 the USB stack checks, that the buffer it should transfer is DMA capable. This was a requirement since v2.2 days, but it usually worked nevertheless. [ 17.504959] ------------[ cut here ]------------ [ 17.505488] WARNING: CPU: 0 PID: 93 at drivers/usb/core/hcd.c:1587 usb_hcd_map_urb_for_dma+0x37c/0x570 [ 17.506545] transfer buffer not dma capable [ 17.507022] Modules linked in: [ 17.507370] CPU: 0 PID: 93 Comm: i2cdetect Not tainted 4.11.0-rc8+ #10 [ 17.508103] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014 [ 17.509039] Call Trace: [ 17.509320] ? dump_stack+0x5c/0x78 [ 17.509714] ? __warn+0xbe/0xe0 [ 17.510073] ? warn_slowpath_fmt+0x5a/0x80 [ 17.510532] ? nommu_map_sg+0xb0/0xb0 [ 17.510949] ? usb_hcd_map_urb_for_dma+0x37c/0x570 [ 17.511482] ? usb_hcd_submit_urb+0x336/0xab0 [ 17.511976] ? wait_for_completion_timeout+0x12f/0x1a0 [ 17.512549] ? wait_for_completion_timeout+0x65/0x1a0 [ 17.513125] ? usb_start_wait_urb+0x65/0x160 [ 17.513604] ? usb_control_msg+0xdc/0x130 [ 17.514061] ? usb_xfer+0xa4/0x2a0 [ 17.514445] ? __i2c_transfer+0x108/0x3c0 [ 17.514899] ? i2c_transfer+0x57/0xb0 [ 17.515310] ? i2c_smbus_xfer_emulated+0x12f/0x590 [ 17.515851] ? _raw_spin_unlock_irqrestore+0x11/0x20 [ 17.516408] ? i2c_smbus_xfer+0x125/0x330 [ 17.516876] ? i2c_smbus_xfer+0x125/0x330 [ 17.517329] ? i2cdev_ioctl_smbus+0x1c1/0x2b0 [ 17.517824] ? i2cdev_ioctl+0x75/0x1c0 [ 17.518248] ? do_vfs_ioctl+0x9f/0x600 [ 17.518671] ? vfs_write+0x144/0x190 [ 17.519078] ? SyS_ioctl+0x74/0x80 [ 17.519463] ? entry_SYSCALL_64_fastpath+0x1e/0xad [ 17.519959] ---[ end trace d047c04982f5ac50 ]--- Cc: <stable@vger.kernel.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk> Reviewed-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: NTill Harbaum <till@harbaum.org> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 19 5月, 2017 1 次提交
-
-
由 Ard Biesheuvel 提交于
Commit bd698d24 ("i2c: designware: Get selected speed mode sda-hold-time via ACPI") updated the logic that reads the timing parameters for various I2C bus rates from the DSDT, to only read the timing parameters for the currently selected mode. This causes a WARN_ON() splat on platforms that legally omit the clock frequency from the ACPI description, because in the new situation, the core I2C designware driver still accesses the fields in the driver struct that we no longer populate, and proceeds to calculate them from the clock frequency. Since the clock frequency is unspecified, the driver complains loudly using a WARN_ON(). So revert back to the old situation, where the struct fields for all timings are populated, but retain the new logic which chooses the SDA hold time from the timing mode that is currently in use. Fixes: bd698d24 ("i2c: designware: Get selected speed mode ...") Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org> Reported-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com> Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 17 5月, 2017 2 次提交
-
-
由 Tin Huynh 提交于
With ACPI, i2c-core requires ACPI companion to be set in order for it to create slave device. This patch sets the ACPI companion accordingly. Signed-off-by: NTin Huynh <tnhuynh@apm.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Thomas Petazzoni 提交于
There is no reason to use platform_get_irq() for non-DT probing and irq_of_parse_and_map() for DT probing. Indeed, platform_get_irq() works fine for both. In addition, using platform_get_irq() properly returns -EPROBE_DEFER when the interrupt controller is not yet available, so instead of inventing our own error code (-ENXIO), return the one provided by platform_get_irq(). Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 16 5月, 2017 3 次提交
-
-
由 Peter Rosin 提交于
As is, a failure message is printed unconditionally, which is confusing. And noisy. Fixes: 8d4d159f ("i2c: mux: provide more info on failure in i2c_mux_add_adapter") Signed-off-by: NPeter Rosin <peda@axentia.se>
-
由 Peter Rosin 提交于
That maintains sanity if it is ever called from some other spot, and also makes the label names coherent. Signed-off-by: NPeter Rosin <peda@axentia.se>
-
由 Peter Rosin 提交于
It is only prudent to let go of resources that are not used. Fixes: b3fdd327 ("i2c: mux: Add register-based mux i2c-mux-reg") Signed-off-by: NPeter Rosin <peda@axentia.se>
-
- 27 4月, 2017 1 次提交
-
-
由 Hanjun Guo 提交于
Add ACPI HID HISI02A1 and HISI02A2 for Hisilicon Hip07/08, which have different clock frequency. Signed-off-by: NHanjun Guo <hanjun.guo@linaro.org> Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
-
- 22 4月, 2017 1 次提交
-
-
由 Jan Glauber 提交于
Set I2C_CLASS_HWMON to enable automatic probing of BMC devices by the ipmi-ssif driver. Signed-off-by: NJan Glauber <jglauber@cavium.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 21 4月, 2017 7 次提交
-
-
由 Wolfram Sang 提交于
PM handling is correct but might be a bit subtle. Add some comments for clarification. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Wolfram Sang 提交于
Resume failed because of uninitialized registers. Instead of adding a resume callback, we simply initialize registers before every transfer. This lightweight change is more robust and will keep us safe if we ever need support for power domains or dynamic frequency changes. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Colin Ian King 提交于
trivial fix to spelling mistake in MODULE_DESCRIPTION text Signed-off-by: NColin Ian King <colin.king@canonical.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Andrzej Hajda 提交于
Driver core provides of_device_get_match_data which can be used to get driver data instead of custom helper. Signed-off-by: NAndrzej Hajda <a.hajda@samsung.com> Reviewed-by: NJavier Martinez Canillas <javier@osg.samsung.com> Tested-by: NJavier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Andrzej Hajda 提交于
In case of clock setup error it is enough to log it once. Moreover patch simplifies clock setup routines. Signed-off-by: NAndrzej Hajda <a.hajda@samsung.com> Reviewed-by: NJavier Martinez Canillas <javier@osg.samsung.com> Tested-by: NJavier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Andrzej Hajda 提交于
There is no need to keep separate settings for high and fast speed clock. Signed-off-by: NAndrzej Hajda <a.hajda@samsung.com> Reviewed-by: NJavier Martinez Canillas <javier@osg.samsung.com> Tested-by: NJavier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Andrzej Hajda 提交于
Instead of using cryptic loop direct calculation of timings can be used. Signed-off-by: NAndrzej Hajda <a.hajda@samsung.com> Tested-by: NJavier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: NAndi Shyti <andi.shyti@samsung.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 20 4月, 2017 3 次提交
-
-
由 David Howells 提交于
When the kernel is running in secure boot mode, we lock down the kernel to prevent userspace from modifying the running kernel image. Whilst this includes prohibiting access to things like /dev/mem, it must also prevent access by means of configuring driver modules in such a way as to cause a device to access or modify the kernel image. To this end, annotate module_param* statements that refer to hardware configuration and indicate for future reference what type of parameter they specify. The parameter parser in the core sees this information and can skip such parameters with an error message if the kernel is locked down. The module initialisation then runs as normal, but just sees whatever the default values for those parameters is. Note that we do still need to do the module initialisation because some drivers have viable defaults set in case parameters aren't specified and some drivers support automatic configuration (e.g. PNP or PCI) in addition to manually coded parameters. This patch annotates drivers in drivers/i2c/. Suggested-by: NAlan Cox <gnomes@lxorguk.ukuu.org.uk> Signed-off-by: NDavid Howells <dhowells@redhat.com> Acked-by: NWolfram Sang <wsa@the-dreams.de> Acked-by: NJean Delvare <jdelvare@suse.de> cc: linux-i2c@vger.kernel.org
-
由 Colin Ian King 提交于
The assignment to addr requires a call to get_sem_addr that dereferences dev, however, this dereference occurs before a null pointer check on dev. Move this assignment after the null check on dev to avoid a potential null pointer dereference. Detected by CoverityScan, CID#1419700 ("Dereference before null check") Fixes: fd476fa2 ("i2c: designware-baytrail: Add support for cherrytrail") Signed-off-by: NColin Ian King <colin.king@canonical.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 chin.yew.tan@intel.com 提交于
Sda-hold-time is an important parameter for tuning i2c to meet the electrical specification especially for high speed. I2C with incorrect sda-hold-time may cause lost arbitration error. Instead of loading all speed mode settings, only selected speed mode settings are loaded. Signed-off-by: NTan Chin Yew <chin.yew.tan@intel.com> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 17 4月, 2017 5 次提交
-
-
由 Hans de Goede 提交于
By default the i2c-core will try to get an irq with index 0 on ACPI / of instantiated devices. This is troublesome on some ACPI systems where the irq info at index 0 in the CRS table may contain nonsense and/or point to an irqchip for which there is no Linux driver. If this happens then before this commit the driver's probe method would never get called because i2c_device_probe will try to get an irq by calling acpi_dev_gpio_irq_get which will always return -EPROBE in this case, as it waits for a matching irqchip driver to load. Thus causing the driver to not get a chance to bind. This commit adds a new disable_i2c_core_irq_mapping flag to struct i2c_driver which a driver can set to tell the core to skip irq mapping. Signed-off-by: NHans de Goede <hdegoede@redhat.com> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Hans de Goede 提交于
By default the i2c subsys creates an i2c-client for the first I2cSerialBus resource of an acpi_device, but some acpi_devices have multiple I2cSerialBus resources and we may want to instantiate i2c-clients for the others. This commit adds a new i2c_acpi_new_device function which can be used to create an i2c-client for any I2cSerialBus resource of an acpi_device. Note that the other resources may even be on a different i2c bus, so just retrieving the client address is not enough. Here is an example DSDT excerpt from such a device: Device (WIDR) { Name (_HID, "INT33FE" /* XPOWER Battery Device */) Name (_CID, "INT33FE" /* XPOWER Battery Device */) Name (_DDN, "WC PMIC Battery Device") <snip> Name (RBUF, ResourceTemplate () { I2cSerialBusV2 (0x005E, ControllerInitiated, 0x000186A0, AddressingMode7Bit, "\\_SB.PCI0.I2C7", 0x00, ResourceConsumer, , Exclusive, ) I2cSerialBusV2 (0x0036, ControllerInitiated, 0x000186A0, AddressingMode7Bit, "\\_SB.PCI0.I2C1", 0x00, ResourceConsumer, , Exclusive, ) I2cSerialBusV2 (0x0022, ControllerInitiated, 0x00061A80, AddressingMode7Bit, "\\_SB.PCI0.I2C1", 0x00, ResourceConsumer, , Exclusive, ) I2cSerialBusV2 (0x0054, ControllerInitiated, 0x00061A80, AddressingMode7Bit, "\\_SB.PCI0.I2C1", 0x00, ResourceConsumer, , Exclusive, ) GpioInt (Level, ActiveLow, Exclusive, PullNone, 0x0000, "\\_SB.PCI0.I2C7.PMI5", 0x00, ResourceConsumer, , ) { // Pin list 0x0012 } GpioInt (Edge, ActiveLow, ExclusiveAndWake, PullNone, 0x0000, "\\_SB.GPO1", 0x00, ResourceConsumer, , ) { // Pin list 0x0005 } GpioInt (Level, ActiveLow, Exclusive, PullNone, 0x0000, "\\_SB.PCI0.I2C7.PMI5", 0x00, ResourceConsumer, , ) { // Pin list 0x0013 } }) Method (_CRS, 0, NotSerialized) // _CRS: Current Resource Settings { Return (RBUF) /* \_SB_.PCI0.I2C7.WIDR.RBUF */ } <snip> } Signed-off-by: NHans de Goede <hdegoede@redhat.com> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Hans de Goede 提交于
Modify struct i2c_acpi_lookup and i2c_acpi_fill_info() to allow using them to get the info from a certain index in the ACPI-resource list rather then taking the first I2cSerialBus resource. Signed-off-by: NHans de Goede <hdegoede@redhat.com> Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Geliang Tang 提交于
Use setup_timer() instead of init_timer() to simplify the code. Signed-off-by: NGeliang Tang <geliangtang@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Edgar Cherkasov 提交于
Description of the problem: - i2c-scmi driver contains only two identifiers "SMBUS01" and "SMBUSIBM"; - the fist HID (SMBUS01) is clearly defined in "SMBus Control Method Interface Specification, version 1.0": "Each device must specify 'SMBUS01' as its _HID and use a unique _UID value"; - unfortunately, BIOS vendors (like AMI) seem to ignore this requirement and implement "SMB0001" HID instead of "SMBUS01"; - I speculate that they do this because only "SMB0001" is hard coded in Windows SMBus driver produced by Microsoft. This leads to following situation: - SMBus works out of box in Windows but not in Linux; - board vendors are forced to add correct "SMBUS01" HID to BIOS to make SMBus work in Linux. Moreover the same board vendors complain that tools (3-rd party ASL compiler) do not like the "SMBUS01" identifier and produce errors. So they need to constantly patch the compiler for each new version of BIOS. As it is very unlikely that BIOS vendors implement a correct HID in future, I would propose to consider whether it is possible to work around the problem by adding MS HID to the Linux i2c-scmi driver. v2: move the definition of the new HID to the driver itself. Signed-off-by: NEdgar Cherkasov <echerkasov@dev.rtsoft.ru> Signed-off-by: NMichael Brunner <Michael.Brunner@kontron.com> Acked-by: NViktor Krasnov <vkrasnov@dev.rtsoft.ru> Reviewed-by: NJean Delvare <jdelvare@suse.de> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 12 4月, 2017 1 次提交
-
-
由 Michael Hennerich 提交于
This patch adds support for the Analog Devices / Linear Technology LTC4306 and LTC4305 4/2 Channel I2C Bus Multiplexer/Switches. The LTC4306 optionally provides two general purpose input/output pins (GPIOs) that can be configured as logic inputs, opendrain outputs or push-pull outputs via the generic GPIOLIB framework. Signed-off-by: NMichael Hennerich <michael.hennerich@analog.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NPeter Rosin <peda@axentia.se>
-
- 03 4月, 2017 7 次提交
-
-
由 Peter Rosin 提交于
i2c_mux_add_adapter already logs a message on failure. Reviewed-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NPeter Rosin <peda@axentia.se>
-
由 Peter Rosin 提交于
i2c_mux_add_adapter already logs a message on failure. Reviewed-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NPeter Rosin <peda@axentia.se>
-
由 Peter Rosin 提交于
i2c_mux_add_adapter already logs a message on failure. Reviewed-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NPeter Rosin <peda@axentia.se>
-
由 Peter Rosin 提交于
i2c_mux_add_adapter already logs a message on failure. Reviewed-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NPeter Rosin <peda@axentia.se>
-
由 Peter Rosin 提交于
i2c_mux_add_adapter already logs a message on failure. Reviewed-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NPeter Rosin <peda@axentia.se>
-
由 Peter Rosin 提交于
i2c_mux_add_adapter already logs a message on failure. Reviewed-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NPeter Rosin <peda@axentia.se>
-
由 Peter Rosin 提交于
No callers then need to report any further info, thus reducing both the amount of code and the log noise. Reviewed-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NPeter Rosin <peda@axentia.se>
-
- 02 4月, 2017 3 次提交
-
-
由 Dmitry Torokhov 提交于
Simple integer for interrupt number is not expressive enough, as it does not convey interrupt trigger type that should be used. Let's allow attaching array of resources to the board info and have i2c core parse first IRQ resource and set up interrupt trigger as needed. Reviewed-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
-
由 Dmitry Torokhov 提交于
This will allow marking device property lists as __initdata, the same as board info structures themselves. Reviewed-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
-
由 Dmitry Torokhov 提交于
i2c bus has 2 different types of device belonging to the same bus and bus notifiers use device type to distinguish between adapters and clients. Previously we only had i2c_adapter_type exported, which made code wanting to work with i2c_client devices test for type not equal to adapter type. This unfortunately is not safe if we ever add another type to the bus, so let's export i2c_client_type as well. Reviewed-by: NJean Delvare <jdelvare@suse.de> Acked-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
-
- 30 3月, 2017 1 次提交
-
-
由 Heiner Kallweit 提交于
The preceding changes in this patch series now allow to simplify the interrupt handler significantly. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-