forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'mfd-for-linus-4.8' of git://git.kernel.org/pub/scm/linux/k…
…ernel/git/lee/mfd Pull MFD updates from Lee Jones: "Core Framework: - New API to call bespoke pre/post IRQ handlers; Regmap New Device Support: - Add support for RN5T567 to rn5t618 - Add support for COMe-cSL6 and COMe-mAL10 to kempld-core New Functionality: - Add support for USB Power Supply to axp20x - Add support for Power Key to hi655x-pmic Fix-ups: - Update MAINTAINERS; Dialog, Altera - Remove module support; max77843, max77620, max8998, max8997, max8925-i2c - Add module support; max14577 - Constifying; max77620 - Allow bespoke IRQ masking/unmasking; max77620 - Remove superfluous code; arizona, qcom_rpm, smsc-ece1099 - Power Management fixups; arizona-core - Error-path improvement; twl-core, dm355evm_msp, smsc-ece1099, hi655x - Clocking fixups; twl6040 - Trivial (spelling, headers, coding-style, whitespace, (re)naming); si476x-i2c, omap-usb-tll, ti_am335x_tscadc, tps6507, hi655x-pmic Bug Fixes: - Fix offset error for MSM8660; qcom_rpm - Fix possible spurious IRQs; arizona, hi655x-pmic" * tag 'mfd-for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (42 commits) mfd: qcom_rpm: Parametrize also ack selector size mfd: twl6040: Handle mclk used for HPPLL and optional internal clock source mfd: Add support for COMe-cSL6 and COMe-mAL10 to Kontron PLD driver mfd: hi655x: Fix return value check in hi655x_pmic_probe() mfd: smsc-ece1099: Return directly after a function failure in smsc_i2c_probe() mfd: smsc-ece1099: Delete an unnecessary variable initialisation in smsc_i2c_probe() mfd: dm355evm_msp: Return directly after a failed platform_device_alloc() in add_child() mfd: twl-core: Refactoring for add_numbered_child() mfd: twl-core: Return directly after a failed platform_device_alloc() in add_numbered_child() mfd: arizona: Add missing disable of PM runtime on probe error path mfd: stmpe: Move platform data into MFD driver mfd: max14577: Allow driver to be built as a module mfd: max14577: Use module_init() instead of subsys_initcall() mfd: arizona: Remove some duplicate defines mfd: qcom_rpm: Remove unused define mfd: hi655x-pmic: Add powerkey device to hi655x PMIC driver mfd: hi655x-pmic: Rename some interrupt macro names mfd: hi655x-pmic: Fixup issue with un-acked interrupts mfd: arizona: Check if AOD interrupts are pending before dispatching mfd: qcom_rpm: Fix offset error for msm8660 ...
- Loading branch information
Showing
32 changed files
with
635 additions
and
324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -612,6 +612,13 @@ L: [email protected] | |
S: Maintained | ||
F: drivers/gpio/gpio-altera.c | ||
|
||
ALTERA SYSTEM RESOURCE DRIVER FOR ARRIA10 DEVKIT | ||
M: Thor Thayer <[email protected]> | ||
S: Maintained | ||
F: drivers/gpio/gpio-altera-a10sr.c | ||
F: drivers/mfd/altera-a10sr.c | ||
F: include/linux/mfd/altera-a10sr.h | ||
|
||
ALTERA TRIPLE SPEED ETHERNET DRIVER | ||
M: Vince Bridgers <[email protected]> | ||
L: [email protected] | ||
|
@@ -3711,6 +3718,8 @@ M: Support Opensource <[email protected]> | |
W: http://www.dialog-semiconductor.com/products | ||
S: Supported | ||
F: Documentation/hwmon/da90?? | ||
F: Documentation/devicetree/bindings/mfd/da90*.txt | ||
F: Documentation/devicetree/bindings/regulator/da92*.txt | ||
F: Documentation/devicetree/bindings/sound/da[79]*.txt | ||
F: drivers/gpio/gpio-da90??.c | ||
F: drivers/hwmon/da90??-hwmon.c | ||
|
@@ -3731,8 +3740,10 @@ F: drivers/watchdog/da90??_wdt.c | |
F: include/linux/mfd/da903x.h | ||
F: include/linux/mfd/da9052/ | ||
F: include/linux/mfd/da9055/ | ||
F: include/linux/mfd/da9062/ | ||
F: include/linux/mfd/da9063/ | ||
F: include/linux/mfd/da9150/ | ||
F: include/linux/regulator/da9211.h | ||
F: include/sound/da[79]*.h | ||
F: sound/soc/codecs/da[79]*.[ch] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
/* | ||
* Copyright Intel Corporation (C) 2014-2016. All Rights Reserved | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms and conditions of the GNU General Public License, | ||
* version 2, as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
* more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with | ||
* this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* SPI access for Altera Arria10 MAX5 System Resource Chip | ||
* | ||
* Adapted from DA9052 | ||
*/ | ||
|
||
#include <linux/mfd/altera-a10sr.h> | ||
#include <linux/mfd/core.h> | ||
#include <linux/module.h> | ||
#include <linux/of.h> | ||
#include <linux/spi/spi.h> | ||
|
||
static const struct mfd_cell altr_a10sr_subdev_info[] = { | ||
{ | ||
.name = "altr_a10sr_gpio", | ||
.of_compatible = "altr,a10sr-gpio", | ||
}, | ||
}; | ||
|
||
static bool altr_a10sr_reg_readable(struct device *dev, unsigned int reg) | ||
{ | ||
switch (reg) { | ||
case ALTR_A10SR_VERSION_READ: | ||
case ALTR_A10SR_LED_REG: | ||
case ALTR_A10SR_PBDSW_REG: | ||
case ALTR_A10SR_PBDSW_IRQ_REG: | ||
case ALTR_A10SR_PWR_GOOD1_REG: | ||
case ALTR_A10SR_PWR_GOOD2_REG: | ||
case ALTR_A10SR_PWR_GOOD3_REG: | ||
case ALTR_A10SR_FMCAB_REG: | ||
case ALTR_A10SR_HPS_RST_REG: | ||
case ALTR_A10SR_USB_QSPI_REG: | ||
case ALTR_A10SR_SFPA_REG: | ||
case ALTR_A10SR_SFPB_REG: | ||
case ALTR_A10SR_I2C_M_REG: | ||
case ALTR_A10SR_WARM_RST_REG: | ||
case ALTR_A10SR_WR_KEY_REG: | ||
case ALTR_A10SR_PMBUS_REG: | ||
return true; | ||
default: | ||
return false; | ||
} | ||
} | ||
|
||
static bool altr_a10sr_reg_writeable(struct device *dev, unsigned int reg) | ||
{ | ||
switch (reg) { | ||
case ALTR_A10SR_LED_REG: | ||
case ALTR_A10SR_PBDSW_IRQ_REG: | ||
case ALTR_A10SR_FMCAB_REG: | ||
case ALTR_A10SR_HPS_RST_REG: | ||
case ALTR_A10SR_USB_QSPI_REG: | ||
case ALTR_A10SR_SFPA_REG: | ||
case ALTR_A10SR_SFPB_REG: | ||
case ALTR_A10SR_WARM_RST_REG: | ||
case ALTR_A10SR_WR_KEY_REG: | ||
case ALTR_A10SR_PMBUS_REG: | ||
return true; | ||
default: | ||
return false; | ||
} | ||
} | ||
|
||
static bool altr_a10sr_reg_volatile(struct device *dev, unsigned int reg) | ||
{ | ||
switch (reg) { | ||
case ALTR_A10SR_PBDSW_REG: | ||
case ALTR_A10SR_PBDSW_IRQ_REG: | ||
case ALTR_A10SR_PWR_GOOD1_REG: | ||
case ALTR_A10SR_PWR_GOOD2_REG: | ||
case ALTR_A10SR_PWR_GOOD3_REG: | ||
case ALTR_A10SR_HPS_RST_REG: | ||
case ALTR_A10SR_I2C_M_REG: | ||
case ALTR_A10SR_WARM_RST_REG: | ||
case ALTR_A10SR_WR_KEY_REG: | ||
case ALTR_A10SR_PMBUS_REG: | ||
return true; | ||
default: | ||
return false; | ||
} | ||
} | ||
|
||
const struct regmap_config altr_a10sr_regmap_config = { | ||
.reg_bits = 8, | ||
.val_bits = 8, | ||
|
||
.cache_type = REGCACHE_NONE, | ||
|
||
.use_single_rw = true, | ||
.read_flag_mask = 1, | ||
.write_flag_mask = 0, | ||
|
||
.max_register = ALTR_A10SR_WR_KEY_REG, | ||
.readable_reg = altr_a10sr_reg_readable, | ||
.writeable_reg = altr_a10sr_reg_writeable, | ||
.volatile_reg = altr_a10sr_reg_volatile, | ||
|
||
}; | ||
|
||
static int altr_a10sr_spi_probe(struct spi_device *spi) | ||
{ | ||
int ret; | ||
struct altr_a10sr *a10sr; | ||
|
||
a10sr = devm_kzalloc(&spi->dev, sizeof(*a10sr), | ||
GFP_KERNEL); | ||
if (!a10sr) | ||
return -ENOMEM; | ||
|
||
spi->mode = SPI_MODE_3; | ||
spi->bits_per_word = 8; | ||
spi_setup(spi); | ||
|
||
a10sr->dev = &spi->dev; | ||
|
||
spi_set_drvdata(spi, a10sr); | ||
|
||
a10sr->regmap = devm_regmap_init_spi(spi, &altr_a10sr_regmap_config); | ||
if (IS_ERR(a10sr->regmap)) { | ||
ret = PTR_ERR(a10sr->regmap); | ||
dev_err(&spi->dev, "Failed to allocate register map: %d\n", | ||
ret); | ||
return ret; | ||
} | ||
|
||
ret = devm_mfd_add_devices(a10sr->dev, PLATFORM_DEVID_AUTO, | ||
altr_a10sr_subdev_info, | ||
ARRAY_SIZE(altr_a10sr_subdev_info), | ||
NULL, 0, NULL); | ||
if (ret) | ||
dev_err(a10sr->dev, "Failed to register sub-devices: %d\n", | ||
ret); | ||
|
||
return ret; | ||
} | ||
|
||
static const struct of_device_id altr_a10sr_spi_of_match[] = { | ||
{ .compatible = "altr,a10sr" }, | ||
{ }, | ||
}; | ||
MODULE_DEVICE_TABLE(of, altr_a10sr_spi_of_match); | ||
|
||
static struct spi_driver altr_a10sr_spi_driver = { | ||
.probe = altr_a10sr_spi_probe, | ||
.driver = { | ||
.name = "altr_a10sr", | ||
.of_match_table = of_match_ptr(altr_a10sr_spi_of_match), | ||
}, | ||
}; | ||
|
||
module_spi_driver(altr_a10sr_spi_driver); | ||
|
||
MODULE_LICENSE("GPL v2"); | ||
MODULE_AUTHOR("Thor Thayer <[email protected]>"); | ||
MODULE_DESCRIPTION("Altera Arria10 DevKit System Resource MFD Driver"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.