Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06e23d51 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
  ...
parents dd967117 f37be01e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@ Required properties:

Optional properties, nodes:
- enable-active-high: To power on the twl6040 during boot.
- clocks: phandle to the clk32k clock provider
- clock-names: Must be "clk32k"
- clocks: phandle to the clk32k and/or to mclk clock provider
- clock-names: Must be "clk32k" for the 32K clock and "mclk" for the MCLK.

Vibra functionality
Required properties:
+11 −0
Original line number Diff line number Diff line
@@ -612,6 +612,13 @@ L: linux-gpio@vger.kernel.org
S:	Maintained
F:	drivers/gpio/gpio-altera.c

ALTERA SYSTEM RESOURCE DRIVER FOR ARRIA10 DEVKIT
M:	Thor Thayer <tthayer@opensource.altera.com>
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 <vbridger@opensource.altera.com>
L:	netdev@vger.kernel.org
@@ -3711,6 +3718,8 @@ M: Support Opensource <support.opensource@diasemi.com>
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]

+15 −2
Original line number Diff line number Diff line
@@ -18,6 +18,17 @@ config MFD_CS5535
	  This is the core driver for CS5535/CS5536 MFD functions.  This is
          necessary for using the board's GPIO and MFGPT functionality.

config MFD_ALTERA_A10SR
	bool "Altera Arria10 DevKit System Resource chip"
	depends on ARCH_SOCFPGA && SPI_MASTER=y && OF
	select REGMAP_SPI
	select MFD_CORE
	help
	  Support for the Altera Arria10 DevKit MAX5 System Resource chip
	  using the SPI interface. This driver provides common support for
	  accessing the external gpio extender (LEDs & buttons) and
	  power supply alarms (hwmon).

config MFD_ACT8945A
	tristate "Active-semi ACT8945A"
	select MFD_CORE
@@ -480,6 +491,8 @@ config MFD_KEMPLD
		* COMe-cDC2 (microETXexpress-DC)
		* COMe-cHL6
		* COMe-cPC2 (microETXexpress-PC)
		* COMe-cSL6
		* COMe-mAL10
		* COMe-mBT10
		* COMe-mCT10
		* COMe-mTT10 (nanoETXexpress-TT)
@@ -524,8 +537,8 @@ config MFD_88PM860X
	  battery-charger under the corresponding menus.

config MFD_MAX14577
	bool "Maxim Semiconductor MAX14577/77836 MUIC + Charger Support"
	depends on I2C=y
	tristate "Maxim Semiconductor MAX14577/77836 MUIC + Charger Support"
	depends on I2C
	select MFD_CORE
	select REGMAP_I2C
	select REGMAP_IRQ
+2 −0
Original line number Diff line number Diff line
@@ -205,3 +205,5 @@ intel-soc-pmic-objs := intel_soc_pmic_core.o intel_soc_pmic_crc.o
intel-soc-pmic-$(CONFIG_INTEL_PMC_IPC)	+= intel_soc_pmic_bxtwc.o
obj-$(CONFIG_INTEL_SOC_PMIC)	+= intel-soc-pmic.o
obj-$(CONFIG_MFD_MT6397)	+= mt6397-core.o

obj-$(CONFIG_MFD_ALTERA_A10SR)	+= altera-a10sr.o
+169 −0
Original line number Diff line number Diff line
/*
 * 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 <tthayer@opensource.altera.com>");
MODULE_DESCRIPTION("Altera Arria10 DevKit System Resource MFD Driver");
Loading