- 23 3月, 2018 19 次提交
-
-
由 Bartosz Golaszewski 提交于
Align the broken line with the opening parenthesis to stay consistent with the rest of the driver code. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bartosz Golaszewski 提交于
Remove the newline between the nvmem registration and its return value check. This is consistent with the rest of the driver code. Add a missing newline between two pdata checks to stay consistent with all the others. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bartosz Golaszewski 提交于
The code in at24_probe() is pretty mangled. It can be cleaned up a bit by doing things one by one. Let's group the code by logic: parse and verify pdata, initialize the regmap, allocate and fill the fields of at24_data, allocate dummy i2c devices, initialize pm & register with nvmem. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bartosz Golaszewski 提交于
Not all fields from at24_platform_data are needed in at24_data. Let's keep just the ones we need and not carry the whole platform_data structure all the time. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bartosz Golaszewski 提交于
This driver can receive its device data from different sources depending on the system. Move the entire code processing platform data, device tree and acpi into a separate function. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bartosz Golaszewski 提交于
Use the new probe() style for i2c drivers. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bartosz Golaszewski 提交于
Use a helper function for accessing the device struct of the base i2c client. This routine is named in a way that reflects its purpose unlike the previously hand-coded dereferencing. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bartosz Golaszewski 提交于
Use a helper variable for the size we want to allocate with devm_kzalloc() and save an ugly line break. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bartosz Golaszewski 提交于
We use the &client->dev construct all over in at24_probe(). Use a helper variable which is more readable and allows to avoid a couple unnecessary line breaks. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bartosz Golaszewski 提交于
Reflect the purpose of this variable: it contains platform data so name it such. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bartosz Golaszewski 提交于
As preparation for at24_probe() refactoring: rename at24_get_pdata() to at24_properties_to_pdata(). We're doing it because we'll move the pdata parsing code into a separate function which will be called at24_get_pdata(). Current routine with that name actually parses the device properties so change its name to reflect its purpose. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bartosz Golaszewski 提交于
We support certain models the size of which is not a power of 2. This is not a reason to emit a warning. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bartosz Golaszewski 提交于
When zeroing structs, use "{ }" everywhere. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> -
由 Bartosz Golaszewski 提交于
We can reuse ret instead of defining a loop-local status variable. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bartosz Golaszewski 提交于
We can reuse ret instead of defining a loop-local status variable. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bartosz Golaszewski 提交于
These are just two left-overs from times when this driver was bigger. They are not really useful anymore. Remove them. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bartosz Golaszewski 提交于
Arrange declarations of local variables by line length as visually it's easier to read. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bartosz Golaszewski 提交于
This structure only needs to exist during the call to nvmem_register(). Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
由 Bartosz Golaszewski 提交于
We use our own mutex for locking. Disable the regmap-specific locking. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 03 1月, 2018 1 次提交
-
-
由 Bartosz Golaszewski 提交于
Add all supported at24 variants to the of_match table. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Reviewed-by: NJavier Martinez Canillas <javierm@redhat.com>
-
- 02 1月, 2018 14 次提交
-
-
由 Bartosz Golaszewski 提交于
AT24 EEPROMs have a write-protect pin, which - when pulled high - inhibits writes to the upper quadrant of memory (although it has been observed that on some chips it disables writing to the entire memory range). On some boards, this pin is connected to a GPIO and pulled high by default, which forces the user to manually change its state before writing. On linux this means that we either need to hog the line all the time, or set the GPIO value before writing from outside of the at24 driver. Make the driver check if the write-protect GPIO was defined in the device tree and pull it low whenever writing to the EEPROM. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
-
由 Sven Van Asbroeck 提交于
The chip size passed via devicetree, i2c, or acpi device ids is now no longer limited to a power of two. So the temporary fix can be removed. Signed-off-by: NSven Van Asbroeck <svendev@arcx.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Sven Van Asbroeck 提交于
Fundamental properties such as capacity and page size differ among at24-type chips. But these chips do not have an id register, so this can't be discovered at runtime. Traditionally, at24-type eeprom properties were determined in two ways: - by passing a 'struct at24_platform_data' via platform_data, or - by naming the chip type in the devicetree, which passes a 'magic number' to probe(), which is then converted to a 'struct at24_platform_data'. Recently a bug was discovered because the magic number rounds down all chip sizes to the lowest power of two. This was addressed by a work-around commit 5478e478 ("eeprom: at24: correctly set the size for at24mac402"), with the wish that magic numbers should over time be converted to structs. This patch replaces the magic numbers with 'struct at24_chip_data'. Signed-off-by: NSven Van Asbroeck <svendev@arcx.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Bartosz Golaszewski 提交于
A regmap_config struct is pretty big and declaring two of them statically just to tweak the reg_bits value adds unnecessary bloat. Declare the regmap config locally in at24_probe() instead. Bloat-o-meter output for ARM: add/remove: 0/2 grow/shrink: 1/0 up/down: 4/-272 (-268) Function old new delta at24_probe 1560 1564 +4 regmap_config_8 136 - -136 regmap_config_16 136 - -136 Total: Before=7012, After=6744, chg -3.82% Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> -
由 Bartosz Golaszewski 提交于
There are a couple symbols defined in the driver source file which are missing the at24_ prefix. This patch fixes that. For module params: use module_param_named() in order to not break userspace. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> -
由 Bartosz Golaszewski 提交于
Fix issues reported by checkpatch for at24.c. Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> -
由 Sven Van Asbroeck 提交于
Some multi-address eeproms in the at24 family may not automatically roll-over reads to the next slave address. On those eeproms, reads that straddle slave boundaries will not work correctly. Solution: Mark such eeproms with a flag that prevents reads straddling slave boundaries. Add the AT24_FLAG_NO_RDROL flag to the eeprom entry in the device_id table, or add 'no-read-rollover' to the eeprom devicetree entry. Note that I have not personally enountered an at24 chip that does not support read rollovers. They may or may not exist. However, my hardware requires this functionality because of a quirk. Signed-off-by: NSven Van Asbroeck <svendev@arcx.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Heiner Kallweit 提交于
Remove remaining now unneeded code dealing with SMBUS details. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Heiner Kallweit 提交于
Remove the old and now unused read functions. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Heiner Kallweit 提交于
Add regmap-based read function and instead of using three different read functions (standard, mac, serial) use just one and factor out the read offset adjustment for mac and serial to at24_adjust_read_offset. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Heiner Kallweit 提交于
Remove the old and now unused write functions. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Heiner Kallweit 提交于
Add a regmap-based write function. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Heiner Kallweit 提交于
Change return type of at24_translate_offset to *at24_client to make member regmap accessible for subsequent patches of this series. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Heiner Kallweit 提交于
This patch adds basic regmap support to be used by subsequent patches of this series. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 06 12月, 2017 1 次提交
-
-
由 David Lechner 提交于
Trying to read the MAC address from an eeprom that has an offset that is not a multiple of 4 causes an error currently. Fix it by changing the nvmem stride to 1. Cc: stable@vger.kernel.org Signed-off-by: NDavid Lechner <david@lechnology.com> [Bartosz: tweaked the commit message] Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 04 12月, 2017 1 次提交
-
-
由 Sakari Ailus 提交于
The at24 driver creates dummy I2C devices to access offsets in the chip that are outside the area supported using a single I2C address. It is not meaningful to use runtime PM to such devices; the system firmware (ACPI) does not know about these devices nor runtime PM was enabled for them. Always use the real device instead of the dummy ones. Fixes: 98e82010 ("eeprom: at24: enable runtime pm support") Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com> Tested-by: NSven Van Asbroeck on a 24AA16/24LC16B <svendev@arcx.com> [Bartosz: rebased on top of previous fixes for 4.15, tweaked the commit message] [Sven: fixed Bartosz's rebase] Signed-off-by: NSven Van Asbroeck <svendev@arcx.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
- 29 11月, 2017 3 次提交
-
-
由 Heiner Kallweit 提交于
So far we completely rely on the caller to provide valid arguments. To be on the safe side perform an own sanity check. Cc: stable@vger.kernel.org Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Heiner Kallweit 提交于
Chip datasheet mentions that word addresses other than the actual start position of the MAC delivers undefined results. So fix this. Current implementation doesn't work due to this wrong offset. Cc: stable@vger.kernel.org Fixes: 0b813658 ("eeprom: at24: add support for at24mac series") Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl>
-
由 Bartosz Golaszewski 提交于
There's an ilog2() expansion in AT24_DEVICE_MAGIC() which rounds down the actual size of EUI-48 byte array in at24mac402 eeproms to 4 from 6, making it impossible to read it all. Fix it by manually adjusting the value in probe(). This patch contains a temporary fix that is suitable for stable branches. Eventually we'll probably remove the call to ilog2() while converting the magic values to actual structs. Cc: stable@vger.kernel.org Fixes: 0b813658 ("eeprom: at24: add support for at24mac series") Signed-off-by: NBartosz Golaszewski <brgl@bgdev.pl> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
-
- 06 11月, 2017 1 次提交
-
-
由 Javier Martinez Canillas 提交于
The driver doesn't have a struct of_device_id table but supported devices are registered via Device Trees. This is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID and that the MODALIAS reported will always be of the form i2c:<device>. But this could change in the future so the correct approach is to have an OF device ID table if the devices are registered via OF. To maintain backward compatibility with old Device Trees, only use the OF device ID table .data if the device was registered via OF and the OF node compatible matches an entry in the OF device ID table. Suggested-by: NWolfram Sang <wsa@the-dreams.de> Signed-off-by: NJavier Martinez Canillas <javierm@redhat.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-