All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
@ 2014-08-27 17:51 ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-27 17:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: sameo, lee.jones, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

This patch set add support for the MEN 14F021P00 Board Management called BMC.

The BMC is a PIC Mikrocontroller which assembled on almost all of our
3U Compact PCI CPU board and a few Box PCs.
main part of the BMC is to start and monitor the board, but there are a
lot more features which can be accessed using an I2C Host interface

Features supported in this Patchset:
        - Watchdog
        - LEDs
        - HWMON

The Patchset includes a MFD Core driver, Watchdog, hwmon  and LEDs driver.

Changes in v6:
	- fixed some style issues (80 chars, whitespaces, alignment)
	- fixed error handling in update function of hwmon slave
	- fixed whitespace error in hwmon documentation
	- added module name in each of the Kconfigs

Changes in v5:
        - fixed I2C dependency in MFD Kconfig
        - added correct error handling in update function of the hwmon slave
          (Use of ERR_PTR)
        - add ATTRIBUTE_GROUP Macro in hwmon slave
          and deleted platform_set_drvdata

Changes in v4:
        - fixed some style issues
        - fixed GPL license version
        - added hwmon voltage monitoring slave driver

Changes in v3:
        - deleted i2c_smbus wrapper functions and use native one
        - some cosmentics and variable renaming to be more clear
        - renamed "leave production" mode to "exit production mode"

Changes in v2:
        - changed i2c_smbus_read wrapper function to return both, value
          and error.
        - moved "leave production mode" from Watchdog driver to mfd core.
        - fixed some return values in the watchdog driver to return the original
          error value instead of -EIO.

Andreas Werner (4):
  drivers/mfd/menf21bmc: introduce MEN 14F021P00 BMC MFD Core driver
  drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog
    driver
  drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver
  drivers/hwmon/menf21bmc_hwmon: introduce MEN14F021P00 BMC HWMON driver

 Documentation/hwmon/menf21bmc    |  50 +++++++++
 drivers/hwmon/Kconfig            |  10 ++
 drivers/hwmon/Makefile           |   1 +
 drivers/hwmon/menf21bmc_hwmon.c  | 230 +++++++++++++++++++++++++++++++++++++++
 drivers/leds/Kconfig             |   9 ++
 drivers/leds/Makefile            |   1 +
 drivers/leds/leds-menf21bmc.c    | 131 ++++++++++++++++++++++
 drivers/mfd/Kconfig              |  15 +++
 drivers/mfd/Makefile             |   1 +
 drivers/mfd/menf21bmc.c          | 132 ++++++++++++++++++++++
 drivers/watchdog/Kconfig         |  10 ++
 drivers/watchdog/Makefile        |   1 +
 drivers/watchdog/menf21bmc_wdt.c | 203 ++++++++++++++++++++++++++++++++++
 13 files changed, 794 insertions(+)
 create mode 100644 Documentation/hwmon/menf21bmc
 create mode 100644 drivers/hwmon/menf21bmc_hwmon.c
 create mode 100644 drivers/leds/leds-menf21bmc.c
 create mode 100644 drivers/mfd/menf21bmc.c
 create mode 100644 drivers/watchdog/menf21bmc_wdt.c

-- 
2.0.4

^ permalink raw reply	[flat|nested] 71+ messages in thread

* [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
@ 2014-08-27 17:51 ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-27 17:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: sameo, lee.jones, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

This patch set add support for the MEN 14F021P00 Board Management called BMC.

The BMC is a PIC Mikrocontroller which assembled on almost all of our
3U Compact PCI CPU board and a few Box PCs.
main part of the BMC is to start and monitor the board, but there are a
lot more features which can be accessed using an I2C Host interface

Features supported in this Patchset:
        - Watchdog
        - LEDs
        - HWMON

The Patchset includes a MFD Core driver, Watchdog, hwmon  and LEDs driver.

Changes in v6:
	- fixed some style issues (80 chars, whitespaces, alignment)
	- fixed error handling in update function of hwmon slave
	- fixed whitespace error in hwmon documentation
	- added module name in each of the Kconfigs

Changes in v5:
        - fixed I2C dependency in MFD Kconfig
        - added correct error handling in update function of the hwmon slave
          (Use of ERR_PTR)
        - add ATTRIBUTE_GROUP Macro in hwmon slave
          and deleted platform_set_drvdata

Changes in v4:
        - fixed some style issues
        - fixed GPL license version
        - added hwmon voltage monitoring slave driver

Changes in v3:
        - deleted i2c_smbus wrapper functions and use native one
        - some cosmentics and variable renaming to be more clear
        - renamed "leave production" mode to "exit production mode"

Changes in v2:
        - changed i2c_smbus_read wrapper function to return both, value
          and error.
        - moved "leave production mode" from Watchdog driver to mfd core.
        - fixed some return values in the watchdog driver to return the original
          error value instead of -EIO.

Andreas Werner (4):
  drivers/mfd/menf21bmc: introduce MEN 14F021P00 BMC MFD Core driver
  drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog
    driver
  drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver
  drivers/hwmon/menf21bmc_hwmon: introduce MEN14F021P00 BMC HWMON driver

 Documentation/hwmon/menf21bmc    |  50 +++++++++
 drivers/hwmon/Kconfig            |  10 ++
 drivers/hwmon/Makefile           |   1 +
 drivers/hwmon/menf21bmc_hwmon.c  | 230 +++++++++++++++++++++++++++++++++++++++
 drivers/leds/Kconfig             |   9 ++
 drivers/leds/Makefile            |   1 +
 drivers/leds/leds-menf21bmc.c    | 131 ++++++++++++++++++++++
 drivers/mfd/Kconfig              |  15 +++
 drivers/mfd/Makefile             |   1 +
 drivers/mfd/menf21bmc.c          | 132 ++++++++++++++++++++++
 drivers/watchdog/Kconfig         |  10 ++
 drivers/watchdog/Makefile        |   1 +
 drivers/watchdog/menf21bmc_wdt.c | 203 ++++++++++++++++++++++++++++++++++
 13 files changed, 794 insertions(+)
 create mode 100644 Documentation/hwmon/menf21bmc
 create mode 100644 drivers/hwmon/menf21bmc_hwmon.c
 create mode 100644 drivers/leds/leds-menf21bmc.c
 create mode 100644 drivers/mfd/menf21bmc.c
 create mode 100644 drivers/watchdog/menf21bmc_wdt.c

-- 
2.0.4


^ permalink raw reply	[flat|nested] 71+ messages in thread

* [lm-sensors] [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
@ 2014-08-27 17:51 ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-27 17:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: sameo, lee.jones, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

This patch set add support for the MEN 14F021P00 Board Management called BMC.

The BMC is a PIC Mikrocontroller which assembled on almost all of our
3U Compact PCI CPU board and a few Box PCs.
main part of the BMC is to start and monitor the board, but there are a
lot more features which can be accessed using an I2C Host interface

Features supported in this Patchset:
        - Watchdog
        - LEDs
        - HWMON

The Patchset includes a MFD Core driver, Watchdog, hwmon  and LEDs driver.

Changes in v6:
	- fixed some style issues (80 chars, whitespaces, alignment)
	- fixed error handling in update function of hwmon slave
	- fixed whitespace error in hwmon documentation
	- added module name in each of the Kconfigs

Changes in v5:
        - fixed I2C dependency in MFD Kconfig
        - added correct error handling in update function of the hwmon slave
          (Use of ERR_PTR)
        - add ATTRIBUTE_GROUP Macro in hwmon slave
          and deleted platform_set_drvdata

Changes in v4:
        - fixed some style issues
        - fixed GPL license version
        - added hwmon voltage monitoring slave driver

Changes in v3:
        - deleted i2c_smbus wrapper functions and use native one
        - some cosmentics and variable renaming to be more clear
        - renamed "leave production" mode to "exit production mode"

Changes in v2:
        - changed i2c_smbus_read wrapper function to return both, value
          and error.
        - moved "leave production mode" from Watchdog driver to mfd core.
        - fixed some return values in the watchdog driver to return the original
          error value instead of -EIO.

Andreas Werner (4):
  drivers/mfd/menf21bmc: introduce MEN 14F021P00 BMC MFD Core driver
  drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog
    driver
  drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver
  drivers/hwmon/menf21bmc_hwmon: introduce MEN14F021P00 BMC HWMON driver

 Documentation/hwmon/menf21bmc    |  50 +++++++++
 drivers/hwmon/Kconfig            |  10 ++
 drivers/hwmon/Makefile           |   1 +
 drivers/hwmon/menf21bmc_hwmon.c  | 230 +++++++++++++++++++++++++++++++++++++++
 drivers/leds/Kconfig             |   9 ++
 drivers/leds/Makefile            |   1 +
 drivers/leds/leds-menf21bmc.c    | 131 ++++++++++++++++++++++
 drivers/mfd/Kconfig              |  15 +++
 drivers/mfd/Makefile             |   1 +
 drivers/mfd/menf21bmc.c          | 132 ++++++++++++++++++++++
 drivers/watchdog/Kconfig         |  10 ++
 drivers/watchdog/Makefile        |   1 +
 drivers/watchdog/menf21bmc_wdt.c | 203 ++++++++++++++++++++++++++++++++++
 13 files changed, 794 insertions(+)
 create mode 100644 Documentation/hwmon/menf21bmc
 create mode 100644 drivers/hwmon/menf21bmc_hwmon.c
 create mode 100644 drivers/leds/leds-menf21bmc.c
 create mode 100644 drivers/mfd/menf21bmc.c
 create mode 100644 drivers/watchdog/menf21bmc_wdt.c

-- 
2.0.4


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 71+ messages in thread

* [PATCH v6 1/4] drivers/mfd/menf21bmc: introduce MEN 14F021P00 BMC MFD Core driver
  2014-08-27 17:51 ` Andreas Werner
  (?)
@ 2014-08-27 17:51   ` Andreas Werner
  -1 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-27 17:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: sameo, lee.jones, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

The MEN 14F021P00 Board Management Controller provides an
I2C interface to the host to access the feature implemented in the BMC.
The BMC is a PIC Microntroller assembled on CPCI Card from MEN Mikroelektronik
and on a few Box/Display Computer.

Added MFD Core driver, supporting the I2C communication to the device.

The MFD driver currently supports the following features:
 	- Watchdog
 	- LEDs
	- Hwmon (voltage monitoring)

Signed-off-by: Andreas Werner <andreas.werner@men.de>
---
 drivers/mfd/Kconfig     |  15 ++++++
 drivers/mfd/Makefile    |   1 +
 drivers/mfd/menf21bmc.c | 132 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 148 insertions(+)
 create mode 100644 drivers/mfd/menf21bmc.c

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index b8d9ca0..1020725 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -453,6 +453,21 @@ config MFD_MAX8998
 	  additional drivers must be enabled in order to use the functionality
 	  of the device.
 
+config MFD_MENF21BMC
+	tristate "MEN 14F021P00 Board Management Controller Support"
+	depends on I2C
+	select MFD_CORE
+	help
+	  Say yes here to add support for the MEN 14F021P00 BMC
+	  which is a Board Management Controller connected to the I2C bus.
+	  The device supports multiple sub-devices like LED, HWMON and WDT.
+	  This driver provides common support for accessing the devices;
+	  additional drivers must be enabled in order to use the
+	  functionality of the BMC device.
+
+	  This driver can also be built as a module. If so the module
+	  will be called menf21bmc.
+
 config EZX_PCAP
 	bool "Motorola EZXPCAP Support"
 	depends on SPI_MASTER
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 4e2bc25..37bf336 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -169,6 +169,7 @@ obj-$(CONFIG_MFD_AS3711)	+= as3711.o
 obj-$(CONFIG_MFD_AS3722)	+= as3722.o
 obj-$(CONFIG_MFD_STW481X)	+= stw481x.o
 obj-$(CONFIG_MFD_IPAQ_MICRO)	+= ipaq-micro.o
+obj-$(CONFIG_MFD_MENF21BMC)	+= menf21bmc.o
 
 intel-soc-pmic-objs		:= intel_soc_pmic_core.o intel_soc_pmic_crc.o
 obj-$(CONFIG_INTEL_SOC_PMIC)	+= intel-soc-pmic.o
diff --git a/drivers/mfd/menf21bmc.c b/drivers/mfd/menf21bmc.c
new file mode 100644
index 0000000..1c27434
--- /dev/null
+++ b/drivers/mfd/menf21bmc.c
@@ -0,0 +1,132 @@
+/*
+ *  MEN 14F021P00 Board Management Controller (BMC) MFD Core Driver.
+ *
+ *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/module.h>
+#include <linux/i2c.h>
+#include <linux/mfd/core.h>
+
+#define BMC_CMD_WDT_EXIT_PROD	0x18
+#define BMC_CMD_WDT_PROD_STAT	0x19
+#define BMC_CMD_REV_MAJOR	0x80
+#define BMC_CMD_REV_MINOR	0x81
+#define BMC_CMD_REV_MAIN	0x82
+
+static struct mfd_cell menf21bmc_cell[] = {
+	{ .name = "menf21bmc_wdt", },
+	{ .name = "menf21bmc_led", },
+	{ .name = "menf21bmc_hwmon", }
+};
+
+static int menf21bmc_wdt_exit_prod_mode(struct i2c_client *client)
+{
+	int val, ret;
+
+	val = i2c_smbus_read_byte_data(client, BMC_CMD_WDT_PROD_STAT);
+	if (val < 0)
+		return val;
+
+	/*
+	 * Production mode should be not active after delivery of the Board.
+	 * To be sure we check it, inform the user and exit the mode
+	 * if active.
+	 */
+	if (val == 0x00) {
+		dev_info(&client->dev,
+			"BMC in production mode. Exit production mode\n");
+
+		ret = i2c_smbus_write_byte(client, BMC_CMD_WDT_EXIT_PROD);
+		if (ret < 0)
+			return ret;
+	}
+
+	return 0;
+}
+
+static int
+menf21bmc_probe(struct i2c_client *client, const struct i2c_device_id *ids)
+{
+	int rev_major, rev_minor, rev_main;
+	int ret;
+
+	ret = i2c_check_functionality(client->adapter,
+				      I2C_FUNC_SMBUS_BYTE_DATA |
+				      I2C_FUNC_SMBUS_WORD_DATA |
+				      I2C_FUNC_SMBUS_BYTE);
+	if (!ret)
+		return -ENODEV;
+
+	rev_major = i2c_smbus_read_word_data(client, BMC_CMD_REV_MAJOR);
+	if (rev_major < 0) {
+		dev_err(&client->dev, "failed to get BMC major revision\n");
+		return rev_major;
+	}
+
+	rev_minor = i2c_smbus_read_word_data(client, BMC_CMD_REV_MINOR);
+	if (rev_minor < 0) {
+		dev_err(&client->dev, "failed to get BMC minor revision\n");
+		return rev_minor;
+	}
+
+	rev_main = i2c_smbus_read_word_data(client, BMC_CMD_REV_MAIN);
+	if (rev_main < 0) {
+		dev_err(&client->dev, "failed to get BMC main revision\n");
+		return rev_main;
+	}
+
+	dev_info(&client->dev, "FW Revision: %02d.%02d.%02d\n",
+		 rev_major, rev_minor, rev_main);
+
+	/*
+	 * We have to exit the Production Mode of the BMC to activate the
+	 * Watchdog functionality and the BIOS life sign monitoring.
+	 */
+	ret = menf21bmc_wdt_exit_prod_mode(client);
+	if (ret < 0) {
+		dev_err(&client->dev, "failed to leave production mode\n");
+		return ret;
+	}
+
+	ret = mfd_add_devices(&client->dev, 0, menf21bmc_cell,
+			      ARRAY_SIZE(menf21bmc_cell), NULL, 0, NULL);
+	if (ret < 0) {
+		dev_err(&client->dev, "failed to add BMC sub-devices\n");
+		return ret;
+	}
+
+	return 0;
+}
+
+static int menf21bmc_remove(struct i2c_client *client)
+{
+	mfd_remove_devices(&client->dev);
+	return 0;
+}
+
+static const struct i2c_device_id menf21bmc_id_table[] = {
+	{ "menf21bmc" },
+	{ }
+};
+MODULE_DEVICE_TABLE(i2c, menf21bmc_id_table);
+
+static struct i2c_driver menf21bmc_driver = {
+	.driver.name	= "menf21bmc",
+	.id_table	= menf21bmc_id_table,
+	.probe		= menf21bmc_probe,
+	.remove		= menf21bmc_remove,
+};
+
+module_i2c_driver(menf21bmc_driver);
+
+MODULE_DESCRIPTION("MEN 14F021P00 BMC mfd core driver");
+MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
+MODULE_LICENSE("GPL v2");
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 71+ messages in thread

* [PATCH v6 1/4] drivers/mfd/menf21bmc: introduce MEN 14F021P00 BMC MFD Core driver
@ 2014-08-27 17:51   ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-27 17:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: sameo, lee.jones, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

The MEN 14F021P00 Board Management Controller provides an
I2C interface to the host to access the feature implemented in the BMC.
The BMC is a PIC Microntroller assembled on CPCI Card from MEN Mikroelektronik
and on a few Box/Display Computer.

Added MFD Core driver, supporting the I2C communication to the device.

The MFD driver currently supports the following features:
 	- Watchdog
 	- LEDs
	- Hwmon (voltage monitoring)

Signed-off-by: Andreas Werner <andreas.werner@men.de>
---
 drivers/mfd/Kconfig     |  15 ++++++
 drivers/mfd/Makefile    |   1 +
 drivers/mfd/menf21bmc.c | 132 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 148 insertions(+)
 create mode 100644 drivers/mfd/menf21bmc.c

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index b8d9ca0..1020725 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -453,6 +453,21 @@ config MFD_MAX8998
 	  additional drivers must be enabled in order to use the functionality
 	  of the device.
 
+config MFD_MENF21BMC
+	tristate "MEN 14F021P00 Board Management Controller Support"
+	depends on I2C
+	select MFD_CORE
+	help
+	  Say yes here to add support for the MEN 14F021P00 BMC
+	  which is a Board Management Controller connected to the I2C bus.
+	  The device supports multiple sub-devices like LED, HWMON and WDT.
+	  This driver provides common support for accessing the devices;
+	  additional drivers must be enabled in order to use the
+	  functionality of the BMC device.
+
+	  This driver can also be built as a module. If so the module
+	  will be called menf21bmc.
+
 config EZX_PCAP
 	bool "Motorola EZXPCAP Support"
 	depends on SPI_MASTER
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 4e2bc25..37bf336 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -169,6 +169,7 @@ obj-$(CONFIG_MFD_AS3711)	+= as3711.o
 obj-$(CONFIG_MFD_AS3722)	+= as3722.o
 obj-$(CONFIG_MFD_STW481X)	+= stw481x.o
 obj-$(CONFIG_MFD_IPAQ_MICRO)	+= ipaq-micro.o
+obj-$(CONFIG_MFD_MENF21BMC)	+= menf21bmc.o
 
 intel-soc-pmic-objs		:= intel_soc_pmic_core.o intel_soc_pmic_crc.o
 obj-$(CONFIG_INTEL_SOC_PMIC)	+= intel-soc-pmic.o
diff --git a/drivers/mfd/menf21bmc.c b/drivers/mfd/menf21bmc.c
new file mode 100644
index 0000000..1c27434
--- /dev/null
+++ b/drivers/mfd/menf21bmc.c
@@ -0,0 +1,132 @@
+/*
+ *  MEN 14F021P00 Board Management Controller (BMC) MFD Core Driver.
+ *
+ *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/module.h>
+#include <linux/i2c.h>
+#include <linux/mfd/core.h>
+
+#define BMC_CMD_WDT_EXIT_PROD	0x18
+#define BMC_CMD_WDT_PROD_STAT	0x19
+#define BMC_CMD_REV_MAJOR	0x80
+#define BMC_CMD_REV_MINOR	0x81
+#define BMC_CMD_REV_MAIN	0x82
+
+static struct mfd_cell menf21bmc_cell[] = {
+	{ .name = "menf21bmc_wdt", },
+	{ .name = "menf21bmc_led", },
+	{ .name = "menf21bmc_hwmon", }
+};
+
+static int menf21bmc_wdt_exit_prod_mode(struct i2c_client *client)
+{
+	int val, ret;
+
+	val = i2c_smbus_read_byte_data(client, BMC_CMD_WDT_PROD_STAT);
+	if (val < 0)
+		return val;
+
+	/*
+	 * Production mode should be not active after delivery of the Board.
+	 * To be sure we check it, inform the user and exit the mode
+	 * if active.
+	 */
+	if (val == 0x00) {
+		dev_info(&client->dev,
+			"BMC in production mode. Exit production mode\n");
+
+		ret = i2c_smbus_write_byte(client, BMC_CMD_WDT_EXIT_PROD);
+		if (ret < 0)
+			return ret;
+	}
+
+	return 0;
+}
+
+static int
+menf21bmc_probe(struct i2c_client *client, const struct i2c_device_id *ids)
+{
+	int rev_major, rev_minor, rev_main;
+	int ret;
+
+	ret = i2c_check_functionality(client->adapter,
+				      I2C_FUNC_SMBUS_BYTE_DATA |
+				      I2C_FUNC_SMBUS_WORD_DATA |
+				      I2C_FUNC_SMBUS_BYTE);
+	if (!ret)
+		return -ENODEV;
+
+	rev_major = i2c_smbus_read_word_data(client, BMC_CMD_REV_MAJOR);
+	if (rev_major < 0) {
+		dev_err(&client->dev, "failed to get BMC major revision\n");
+		return rev_major;
+	}
+
+	rev_minor = i2c_smbus_read_word_data(client, BMC_CMD_REV_MINOR);
+	if (rev_minor < 0) {
+		dev_err(&client->dev, "failed to get BMC minor revision\n");
+		return rev_minor;
+	}
+
+	rev_main = i2c_smbus_read_word_data(client, BMC_CMD_REV_MAIN);
+	if (rev_main < 0) {
+		dev_err(&client->dev, "failed to get BMC main revision\n");
+		return rev_main;
+	}
+
+	dev_info(&client->dev, "FW Revision: %02d.%02d.%02d\n",
+		 rev_major, rev_minor, rev_main);
+
+	/*
+	 * We have to exit the Production Mode of the BMC to activate the
+	 * Watchdog functionality and the BIOS life sign monitoring.
+	 */
+	ret = menf21bmc_wdt_exit_prod_mode(client);
+	if (ret < 0) {
+		dev_err(&client->dev, "failed to leave production mode\n");
+		return ret;
+	}
+
+	ret = mfd_add_devices(&client->dev, 0, menf21bmc_cell,
+			      ARRAY_SIZE(menf21bmc_cell), NULL, 0, NULL);
+	if (ret < 0) {
+		dev_err(&client->dev, "failed to add BMC sub-devices\n");
+		return ret;
+	}
+
+	return 0;
+}
+
+static int menf21bmc_remove(struct i2c_client *client)
+{
+	mfd_remove_devices(&client->dev);
+	return 0;
+}
+
+static const struct i2c_device_id menf21bmc_id_table[] = {
+	{ "menf21bmc" },
+	{ }
+};
+MODULE_DEVICE_TABLE(i2c, menf21bmc_id_table);
+
+static struct i2c_driver menf21bmc_driver = {
+	.driver.name	= "menf21bmc",
+	.id_table	= menf21bmc_id_table,
+	.probe		= menf21bmc_probe,
+	.remove		= menf21bmc_remove,
+};
+
+module_i2c_driver(menf21bmc_driver);
+
+MODULE_DESCRIPTION("MEN 14F021P00 BMC mfd core driver");
+MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
+MODULE_LICENSE("GPL v2");
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 71+ messages in thread

* [lm-sensors] [PATCH v6 1/4] drivers/mfd/menf21bmc: introduce MEN 14F021P00 BMC MFD Core driver
@ 2014-08-27 17:51   ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-27 17:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: sameo, lee.jones, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

The MEN 14F021P00 Board Management Controller provides an
I2C interface to the host to access the feature implemented in the BMC.
The BMC is a PIC Microntroller assembled on CPCI Card from MEN Mikroelektronik
and on a few Box/Display Computer.

Added MFD Core driver, supporting the I2C communication to the device.

The MFD driver currently supports the following features:
 	- Watchdog
 	- LEDs
	- Hwmon (voltage monitoring)

Signed-off-by: Andreas Werner <andreas.werner@men.de>
---
 drivers/mfd/Kconfig     |  15 ++++++
 drivers/mfd/Makefile    |   1 +
 drivers/mfd/menf21bmc.c | 132 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 148 insertions(+)
 create mode 100644 drivers/mfd/menf21bmc.c

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index b8d9ca0..1020725 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -453,6 +453,21 @@ config MFD_MAX8998
 	  additional drivers must be enabled in order to use the functionality
 	  of the device.
 
+config MFD_MENF21BMC
+	tristate "MEN 14F021P00 Board Management Controller Support"
+	depends on I2C
+	select MFD_CORE
+	help
+	  Say yes here to add support for the MEN 14F021P00 BMC
+	  which is a Board Management Controller connected to the I2C bus.
+	  The device supports multiple sub-devices like LED, HWMON and WDT.
+	  This driver provides common support for accessing the devices;
+	  additional drivers must be enabled in order to use the
+	  functionality of the BMC device.
+
+	  This driver can also be built as a module. If so the module
+	  will be called menf21bmc.
+
 config EZX_PCAP
 	bool "Motorola EZXPCAP Support"
 	depends on SPI_MASTER
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 4e2bc25..37bf336 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -169,6 +169,7 @@ obj-$(CONFIG_MFD_AS3711)	+= as3711.o
 obj-$(CONFIG_MFD_AS3722)	+= as3722.o
 obj-$(CONFIG_MFD_STW481X)	+= stw481x.o
 obj-$(CONFIG_MFD_IPAQ_MICRO)	+= ipaq-micro.o
+obj-$(CONFIG_MFD_MENF21BMC)	+= menf21bmc.o
 
 intel-soc-pmic-objs		:= intel_soc_pmic_core.o intel_soc_pmic_crc.o
 obj-$(CONFIG_INTEL_SOC_PMIC)	+= intel-soc-pmic.o
diff --git a/drivers/mfd/menf21bmc.c b/drivers/mfd/menf21bmc.c
new file mode 100644
index 0000000..1c27434
--- /dev/null
+++ b/drivers/mfd/menf21bmc.c
@@ -0,0 +1,132 @@
+/*
+ *  MEN 14F021P00 Board Management Controller (BMC) MFD Core Driver.
+ *
+ *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/module.h>
+#include <linux/i2c.h>
+#include <linux/mfd/core.h>
+
+#define BMC_CMD_WDT_EXIT_PROD	0x18
+#define BMC_CMD_WDT_PROD_STAT	0x19
+#define BMC_CMD_REV_MAJOR	0x80
+#define BMC_CMD_REV_MINOR	0x81
+#define BMC_CMD_REV_MAIN	0x82
+
+static struct mfd_cell menf21bmc_cell[] = {
+	{ .name = "menf21bmc_wdt", },
+	{ .name = "menf21bmc_led", },
+	{ .name = "menf21bmc_hwmon", }
+};
+
+static int menf21bmc_wdt_exit_prod_mode(struct i2c_client *client)
+{
+	int val, ret;
+
+	val = i2c_smbus_read_byte_data(client, BMC_CMD_WDT_PROD_STAT);
+	if (val < 0)
+		return val;
+
+	/*
+	 * Production mode should be not active after delivery of the Board.
+	 * To be sure we check it, inform the user and exit the mode
+	 * if active.
+	 */
+	if (val = 0x00) {
+		dev_info(&client->dev,
+			"BMC in production mode. Exit production mode\n");
+
+		ret = i2c_smbus_write_byte(client, BMC_CMD_WDT_EXIT_PROD);
+		if (ret < 0)
+			return ret;
+	}
+
+	return 0;
+}
+
+static int
+menf21bmc_probe(struct i2c_client *client, const struct i2c_device_id *ids)
+{
+	int rev_major, rev_minor, rev_main;
+	int ret;
+
+	ret = i2c_check_functionality(client->adapter,
+				      I2C_FUNC_SMBUS_BYTE_DATA |
+				      I2C_FUNC_SMBUS_WORD_DATA |
+				      I2C_FUNC_SMBUS_BYTE);
+	if (!ret)
+		return -ENODEV;
+
+	rev_major = i2c_smbus_read_word_data(client, BMC_CMD_REV_MAJOR);
+	if (rev_major < 0) {
+		dev_err(&client->dev, "failed to get BMC major revision\n");
+		return rev_major;
+	}
+
+	rev_minor = i2c_smbus_read_word_data(client, BMC_CMD_REV_MINOR);
+	if (rev_minor < 0) {
+		dev_err(&client->dev, "failed to get BMC minor revision\n");
+		return rev_minor;
+	}
+
+	rev_main = i2c_smbus_read_word_data(client, BMC_CMD_REV_MAIN);
+	if (rev_main < 0) {
+		dev_err(&client->dev, "failed to get BMC main revision\n");
+		return rev_main;
+	}
+
+	dev_info(&client->dev, "FW Revision: %02d.%02d.%02d\n",
+		 rev_major, rev_minor, rev_main);
+
+	/*
+	 * We have to exit the Production Mode of the BMC to activate the
+	 * Watchdog functionality and the BIOS life sign monitoring.
+	 */
+	ret = menf21bmc_wdt_exit_prod_mode(client);
+	if (ret < 0) {
+		dev_err(&client->dev, "failed to leave production mode\n");
+		return ret;
+	}
+
+	ret = mfd_add_devices(&client->dev, 0, menf21bmc_cell,
+			      ARRAY_SIZE(menf21bmc_cell), NULL, 0, NULL);
+	if (ret < 0) {
+		dev_err(&client->dev, "failed to add BMC sub-devices\n");
+		return ret;
+	}
+
+	return 0;
+}
+
+static int menf21bmc_remove(struct i2c_client *client)
+{
+	mfd_remove_devices(&client->dev);
+	return 0;
+}
+
+static const struct i2c_device_id menf21bmc_id_table[] = {
+	{ "menf21bmc" },
+	{ }
+};
+MODULE_DEVICE_TABLE(i2c, menf21bmc_id_table);
+
+static struct i2c_driver menf21bmc_driver = {
+	.driver.name	= "menf21bmc",
+	.id_table	= menf21bmc_id_table,
+	.probe		= menf21bmc_probe,
+	.remove		= menf21bmc_remove,
+};
+
+module_i2c_driver(menf21bmc_driver);
+
+MODULE_DESCRIPTION("MEN 14F021P00 BMC mfd core driver");
+MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
+MODULE_LICENSE("GPL v2");
-- 
2.0.4


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply related	[flat|nested] 71+ messages in thread

* [PATCH v6 2/4] drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog driver
  2014-08-27 17:51 ` Andreas Werner
  (?)
@ 2014-08-27 17:52   ` Andreas Werner
  -1 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-27 17:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: sameo, lee.jones, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

Added driver to support the 14F021P00 BMC Watchdog.
The BMC is a Board Management Controller including watchdog functionality.

Signed-off-by: Andreas Werner <andreas.werner@men.de>
---
 drivers/watchdog/Kconfig         |  10 ++
 drivers/watchdog/Makefile        |   1 +
 drivers/watchdog/menf21bmc_wdt.c | 203 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 214 insertions(+)
 create mode 100644 drivers/watchdog/menf21bmc_wdt.c

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 76dd541..96d72c2 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -95,6 +95,16 @@ config GPIO_WATCHDOG
 	  If you say yes here you get support for watchdog device
 	  controlled through GPIO-line.
 
+config MENF21BMC_WATCHDOG
+	tristate "MEN 14F021P00 BMC Watchdog"
+	depends on MFD_MENF21BMC
+	select WATCHDOG_CORE
+	help
+	  Say Y here to include support for the MEN 14F021P00 BMC Watchdog.
+
+	  This driver can also be built as a module. If so the module
+	  will be called menf21bmc_wdt.
+
 config WM831X_WATCHDOG
 	tristate "WM831x watchdog"
 	depends on MFD_WM831X
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 468c320..de17014 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -178,3 +178,4 @@ obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o
 obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o
 obj-$(CONFIG_MAX63XX_WATCHDOG) += max63xx_wdt.o
 obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
+obj-$(CONFIG_MENF21BMC_WATCHDOG) += menf21bmc_wdt.o
diff --git a/drivers/watchdog/menf21bmc_wdt.c b/drivers/watchdog/menf21bmc_wdt.c
new file mode 100644
index 0000000..2042874
--- /dev/null
+++ b/drivers/watchdog/menf21bmc_wdt.c
@@ -0,0 +1,203 @@
+/*
+ *  MEN 14F021P00 Board Management Controller (BMC) Watchdog Driver.
+ *
+ *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/module.h>
+#include <linux/watchdog.h>
+#include <linux/platform_device.h>
+#include <linux/i2c.h>
+
+#define DEVNAME "menf21bmc_wdt"
+
+#define BMC_CMD_WD_ON		0x11
+#define BMC_CMD_WD_OFF		0x12
+#define BMC_CMD_WD_TRIG		0x13
+#define BMC_CMD_WD_TIME		0x14
+#define BMC_CMD_WD_STATE	0x17
+#define BMC_WD_OFF_VAL		0x69
+#define BMC_CMD_RST_RSN		0x92
+
+#define BMC_WD_TIMEOUT_MIN	1	/* in sec */
+#define BMC_WD_TIMEOUT_MAX	6553	/* in sec */
+
+static bool nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, bool, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
+				__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+struct menf21bmc_wdt {
+	struct watchdog_device wdt;
+	struct i2c_client *i2c_client;
+};
+
+static int menf21bmc_wdt_set_bootstatus(struct menf21bmc_wdt *data)
+{
+	int rst_rsn;
+
+	rst_rsn = i2c_smbus_read_byte_data(data->i2c_client, BMC_CMD_RST_RSN);
+	if (rst_rsn < 0)
+		return rst_rsn;
+
+	if (rst_rsn == 0x02)
+		data->wdt.bootstatus |= WDIOF_CARDRESET;
+	else if (rst_rsn == 0x05)
+		data->wdt.bootstatus |= WDIOF_EXTERN1;
+	else if (rst_rsn == 0x06)
+		data->wdt.bootstatus |= WDIOF_EXTERN2;
+	else if (rst_rsn == 0x0A)
+		data->wdt.bootstatus |= WDIOF_POWERUNDER;
+
+	return 0;
+}
+
+static int menf21bmc_wdt_start(struct watchdog_device *wdt)
+{
+	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
+
+	return i2c_smbus_write_byte(drv_data->i2c_client, BMC_CMD_WD_ON);
+}
+
+static int menf21bmc_wdt_stop(struct watchdog_device *wdt)
+{
+	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
+
+	return i2c_smbus_write_byte_data(drv_data->i2c_client,
+					 BMC_CMD_WD_OFF, BMC_WD_OFF_VAL);
+}
+
+static int
+menf21bmc_wdt_settimeout(struct watchdog_device *wdt, unsigned int timeout)
+{
+	int ret;
+	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
+
+	/*
+	 *  BMC Watchdog does have a resolution of 100ms.
+	 *  Watchdog API defines the timeout in seconds, so we have to
+	 *  multiply the value.
+	 */
+	ret = i2c_smbus_write_word_data(drv_data->i2c_client,
+					BMC_CMD_WD_TIME, timeout * 10);
+	if (ret < 0)
+		return ret;
+
+	wdt->timeout = timeout;
+
+	return 0;
+}
+
+static int menf21bmc_wdt_ping(struct watchdog_device *wdt)
+{
+	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
+
+	return i2c_smbus_write_byte(drv_data->i2c_client, BMC_CMD_WD_TRIG);
+}
+
+static const struct watchdog_info menf21bmc_wdt_info = {
+	.options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
+	.identity = DEVNAME,
+};
+
+static const struct watchdog_ops menf21bmc_wdt_ops = {
+	.owner		= THIS_MODULE,
+	.start		= menf21bmc_wdt_start,
+	.stop		= menf21bmc_wdt_stop,
+	.ping		= menf21bmc_wdt_ping,
+	.set_timeout	= menf21bmc_wdt_settimeout,
+};
+
+static int menf21bmc_wdt_probe(struct platform_device *pdev)
+{
+	int ret, bmc_timeout;
+	struct menf21bmc_wdt *drv_data;
+	struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
+
+	drv_data = devm_kzalloc(&pdev->dev,
+				sizeof(struct menf21bmc_wdt), GFP_KERNEL);
+	if (!drv_data)
+		return -ENOMEM;
+
+	drv_data->wdt.ops = &menf21bmc_wdt_ops;
+	drv_data->wdt.info = &menf21bmc_wdt_info;
+	drv_data->wdt.min_timeout = BMC_WD_TIMEOUT_MIN;
+	drv_data->wdt.max_timeout = BMC_WD_TIMEOUT_MAX;
+	drv_data->i2c_client = i2c_client;
+
+	/*
+	 * Get the current wdt timeout value from the BMC because
+	 * the BMC will save the value set before if the system restarts.
+	 */
+	bmc_timeout = i2c_smbus_read_word_data(drv_data->i2c_client,
+					       BMC_CMD_WD_TIME);
+	if (bmc_timeout < 0) {
+		dev_err(&pdev->dev, "failed to get current WDT timeout\n");
+		return bmc_timeout;
+	}
+
+	watchdog_init_timeout(&drv_data->wdt, bmc_timeout / 10, &pdev->dev);
+	watchdog_set_nowayout(&drv_data->wdt, nowayout);
+	watchdog_set_drvdata(&drv_data->wdt, drv_data);
+	platform_set_drvdata(pdev, drv_data);
+
+	ret = menf21bmc_wdt_set_bootstatus(drv_data);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "failed to set Watchdog bootstatus\n");
+		return ret;
+	}
+
+	ret = watchdog_register_device(&drv_data->wdt);
+	if (ret) {
+		dev_err(&pdev->dev, "failed to register Watchdog device\n");
+		return ret;
+	}
+
+	dev_info(&pdev->dev, "MEN 14F021P00 BMC Watchdog device enabled\n");
+
+	return 0;
+}
+
+static int menf21bmc_wdt_remove(struct platform_device *pdev)
+{
+	struct menf21bmc_wdt *drv_data = platform_get_drvdata(pdev);
+
+	dev_warn(&pdev->dev,
+		 "Unregister MEN 14F021P00 BMC Watchdog device, board may reset\n");
+
+	watchdog_unregister_device(&drv_data->wdt);
+
+	return 0;
+}
+
+static void menf21bmc_wdt_shutdown(struct platform_device *pdev)
+{
+	struct menf21bmc_wdt *drv_data = platform_get_drvdata(pdev);
+
+	i2c_smbus_write_word_data(drv_data->i2c_client,
+				  BMC_CMD_WD_OFF, BMC_WD_OFF_VAL);
+}
+
+static struct  platform_driver menf21bmc_wdt = {
+	.driver		= {
+		.owner = THIS_MODULE,
+		.name	= DEVNAME,
+	},
+	.probe		= menf21bmc_wdt_probe,
+	.remove		= menf21bmc_wdt_remove,
+	.shutdown	= menf21bmc_wdt_shutdown,
+};
+
+module_platform_driver(menf21bmc_wdt);
+
+MODULE_DESCRIPTION("MEN 14F021P00 BMC Watchdog driver");
+MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:menf21bmc_wdt");
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 71+ messages in thread

* [PATCH v6 2/4] drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog driver
@ 2014-08-27 17:52   ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-27 17:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: sameo, lee.jones, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

Added driver to support the 14F021P00 BMC Watchdog.
The BMC is a Board Management Controller including watchdog functionality.

Signed-off-by: Andreas Werner <andreas.werner@men.de>
---
 drivers/watchdog/Kconfig         |  10 ++
 drivers/watchdog/Makefile        |   1 +
 drivers/watchdog/menf21bmc_wdt.c | 203 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 214 insertions(+)
 create mode 100644 drivers/watchdog/menf21bmc_wdt.c

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 76dd541..96d72c2 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -95,6 +95,16 @@ config GPIO_WATCHDOG
 	  If you say yes here you get support for watchdog device
 	  controlled through GPIO-line.
 
+config MENF21BMC_WATCHDOG
+	tristate "MEN 14F021P00 BMC Watchdog"
+	depends on MFD_MENF21BMC
+	select WATCHDOG_CORE
+	help
+	  Say Y here to include support for the MEN 14F021P00 BMC Watchdog.
+
+	  This driver can also be built as a module. If so the module
+	  will be called menf21bmc_wdt.
+
 config WM831X_WATCHDOG
 	tristate "WM831x watchdog"
 	depends on MFD_WM831X
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 468c320..de17014 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -178,3 +178,4 @@ obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o
 obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o
 obj-$(CONFIG_MAX63XX_WATCHDOG) += max63xx_wdt.o
 obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
+obj-$(CONFIG_MENF21BMC_WATCHDOG) += menf21bmc_wdt.o
diff --git a/drivers/watchdog/menf21bmc_wdt.c b/drivers/watchdog/menf21bmc_wdt.c
new file mode 100644
index 0000000..2042874
--- /dev/null
+++ b/drivers/watchdog/menf21bmc_wdt.c
@@ -0,0 +1,203 @@
+/*
+ *  MEN 14F021P00 Board Management Controller (BMC) Watchdog Driver.
+ *
+ *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/module.h>
+#include <linux/watchdog.h>
+#include <linux/platform_device.h>
+#include <linux/i2c.h>
+
+#define DEVNAME "menf21bmc_wdt"
+
+#define BMC_CMD_WD_ON		0x11
+#define BMC_CMD_WD_OFF		0x12
+#define BMC_CMD_WD_TRIG		0x13
+#define BMC_CMD_WD_TIME		0x14
+#define BMC_CMD_WD_STATE	0x17
+#define BMC_WD_OFF_VAL		0x69
+#define BMC_CMD_RST_RSN		0x92
+
+#define BMC_WD_TIMEOUT_MIN	1	/* in sec */
+#define BMC_WD_TIMEOUT_MAX	6553	/* in sec */
+
+static bool nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, bool, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
+				__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+struct menf21bmc_wdt {
+	struct watchdog_device wdt;
+	struct i2c_client *i2c_client;
+};
+
+static int menf21bmc_wdt_set_bootstatus(struct menf21bmc_wdt *data)
+{
+	int rst_rsn;
+
+	rst_rsn = i2c_smbus_read_byte_data(data->i2c_client, BMC_CMD_RST_RSN);
+	if (rst_rsn < 0)
+		return rst_rsn;
+
+	if (rst_rsn == 0x02)
+		data->wdt.bootstatus |= WDIOF_CARDRESET;
+	else if (rst_rsn == 0x05)
+		data->wdt.bootstatus |= WDIOF_EXTERN1;
+	else if (rst_rsn == 0x06)
+		data->wdt.bootstatus |= WDIOF_EXTERN2;
+	else if (rst_rsn == 0x0A)
+		data->wdt.bootstatus |= WDIOF_POWERUNDER;
+
+	return 0;
+}
+
+static int menf21bmc_wdt_start(struct watchdog_device *wdt)
+{
+	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
+
+	return i2c_smbus_write_byte(drv_data->i2c_client, BMC_CMD_WD_ON);
+}
+
+static int menf21bmc_wdt_stop(struct watchdog_device *wdt)
+{
+	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
+
+	return i2c_smbus_write_byte_data(drv_data->i2c_client,
+					 BMC_CMD_WD_OFF, BMC_WD_OFF_VAL);
+}
+
+static int
+menf21bmc_wdt_settimeout(struct watchdog_device *wdt, unsigned int timeout)
+{
+	int ret;
+	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
+
+	/*
+	 *  BMC Watchdog does have a resolution of 100ms.
+	 *  Watchdog API defines the timeout in seconds, so we have to
+	 *  multiply the value.
+	 */
+	ret = i2c_smbus_write_word_data(drv_data->i2c_client,
+					BMC_CMD_WD_TIME, timeout * 10);
+	if (ret < 0)
+		return ret;
+
+	wdt->timeout = timeout;
+
+	return 0;
+}
+
+static int menf21bmc_wdt_ping(struct watchdog_device *wdt)
+{
+	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
+
+	return i2c_smbus_write_byte(drv_data->i2c_client, BMC_CMD_WD_TRIG);
+}
+
+static const struct watchdog_info menf21bmc_wdt_info = {
+	.options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
+	.identity = DEVNAME,
+};
+
+static const struct watchdog_ops menf21bmc_wdt_ops = {
+	.owner		= THIS_MODULE,
+	.start		= menf21bmc_wdt_start,
+	.stop		= menf21bmc_wdt_stop,
+	.ping		= menf21bmc_wdt_ping,
+	.set_timeout	= menf21bmc_wdt_settimeout,
+};
+
+static int menf21bmc_wdt_probe(struct platform_device *pdev)
+{
+	int ret, bmc_timeout;
+	struct menf21bmc_wdt *drv_data;
+	struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
+
+	drv_data = devm_kzalloc(&pdev->dev,
+				sizeof(struct menf21bmc_wdt), GFP_KERNEL);
+	if (!drv_data)
+		return -ENOMEM;
+
+	drv_data->wdt.ops = &menf21bmc_wdt_ops;
+	drv_data->wdt.info = &menf21bmc_wdt_info;
+	drv_data->wdt.min_timeout = BMC_WD_TIMEOUT_MIN;
+	drv_data->wdt.max_timeout = BMC_WD_TIMEOUT_MAX;
+	drv_data->i2c_client = i2c_client;
+
+	/*
+	 * Get the current wdt timeout value from the BMC because
+	 * the BMC will save the value set before if the system restarts.
+	 */
+	bmc_timeout = i2c_smbus_read_word_data(drv_data->i2c_client,
+					       BMC_CMD_WD_TIME);
+	if (bmc_timeout < 0) {
+		dev_err(&pdev->dev, "failed to get current WDT timeout\n");
+		return bmc_timeout;
+	}
+
+	watchdog_init_timeout(&drv_data->wdt, bmc_timeout / 10, &pdev->dev);
+	watchdog_set_nowayout(&drv_data->wdt, nowayout);
+	watchdog_set_drvdata(&drv_data->wdt, drv_data);
+	platform_set_drvdata(pdev, drv_data);
+
+	ret = menf21bmc_wdt_set_bootstatus(drv_data);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "failed to set Watchdog bootstatus\n");
+		return ret;
+	}
+
+	ret = watchdog_register_device(&drv_data->wdt);
+	if (ret) {
+		dev_err(&pdev->dev, "failed to register Watchdog device\n");
+		return ret;
+	}
+
+	dev_info(&pdev->dev, "MEN 14F021P00 BMC Watchdog device enabled\n");
+
+	return 0;
+}
+
+static int menf21bmc_wdt_remove(struct platform_device *pdev)
+{
+	struct menf21bmc_wdt *drv_data = platform_get_drvdata(pdev);
+
+	dev_warn(&pdev->dev,
+		 "Unregister MEN 14F021P00 BMC Watchdog device, board may reset\n");
+
+	watchdog_unregister_device(&drv_data->wdt);
+
+	return 0;
+}
+
+static void menf21bmc_wdt_shutdown(struct platform_device *pdev)
+{
+	struct menf21bmc_wdt *drv_data = platform_get_drvdata(pdev);
+
+	i2c_smbus_write_word_data(drv_data->i2c_client,
+				  BMC_CMD_WD_OFF, BMC_WD_OFF_VAL);
+}
+
+static struct  platform_driver menf21bmc_wdt = {
+	.driver		= {
+		.owner = THIS_MODULE,
+		.name	= DEVNAME,
+	},
+	.probe		= menf21bmc_wdt_probe,
+	.remove		= menf21bmc_wdt_remove,
+	.shutdown	= menf21bmc_wdt_shutdown,
+};
+
+module_platform_driver(menf21bmc_wdt);
+
+MODULE_DESCRIPTION("MEN 14F021P00 BMC Watchdog driver");
+MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:menf21bmc_wdt");
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 71+ messages in thread

* [lm-sensors] [PATCH v6 2/4] drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog dri
@ 2014-08-27 17:52   ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-27 17:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: sameo, lee.jones, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

Added driver to support the 14F021P00 BMC Watchdog.
The BMC is a Board Management Controller including watchdog functionality.

Signed-off-by: Andreas Werner <andreas.werner@men.de>
---
 drivers/watchdog/Kconfig         |  10 ++
 drivers/watchdog/Makefile        |   1 +
 drivers/watchdog/menf21bmc_wdt.c | 203 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 214 insertions(+)
 create mode 100644 drivers/watchdog/menf21bmc_wdt.c

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 76dd541..96d72c2 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -95,6 +95,16 @@ config GPIO_WATCHDOG
 	  If you say yes here you get support for watchdog device
 	  controlled through GPIO-line.
 
+config MENF21BMC_WATCHDOG
+	tristate "MEN 14F021P00 BMC Watchdog"
+	depends on MFD_MENF21BMC
+	select WATCHDOG_CORE
+	help
+	  Say Y here to include support for the MEN 14F021P00 BMC Watchdog.
+
+	  This driver can also be built as a module. If so the module
+	  will be called menf21bmc_wdt.
+
 config WM831X_WATCHDOG
 	tristate "WM831x watchdog"
 	depends on MFD_WM831X
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 468c320..de17014 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -178,3 +178,4 @@ obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o
 obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o
 obj-$(CONFIG_MAX63XX_WATCHDOG) += max63xx_wdt.o
 obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
+obj-$(CONFIG_MENF21BMC_WATCHDOG) += menf21bmc_wdt.o
diff --git a/drivers/watchdog/menf21bmc_wdt.c b/drivers/watchdog/menf21bmc_wdt.c
new file mode 100644
index 0000000..2042874
--- /dev/null
+++ b/drivers/watchdog/menf21bmc_wdt.c
@@ -0,0 +1,203 @@
+/*
+ *  MEN 14F021P00 Board Management Controller (BMC) Watchdog Driver.
+ *
+ *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/module.h>
+#include <linux/watchdog.h>
+#include <linux/platform_device.h>
+#include <linux/i2c.h>
+
+#define DEVNAME "menf21bmc_wdt"
+
+#define BMC_CMD_WD_ON		0x11
+#define BMC_CMD_WD_OFF		0x12
+#define BMC_CMD_WD_TRIG		0x13
+#define BMC_CMD_WD_TIME		0x14
+#define BMC_CMD_WD_STATE	0x17
+#define BMC_WD_OFF_VAL		0x69
+#define BMC_CMD_RST_RSN		0x92
+
+#define BMC_WD_TIMEOUT_MIN	1	/* in sec */
+#define BMC_WD_TIMEOUT_MAX	6553	/* in sec */
+
+static bool nowayout = WATCHDOG_NOWAYOUT;
+module_param(nowayout, bool, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
+				__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
+
+struct menf21bmc_wdt {
+	struct watchdog_device wdt;
+	struct i2c_client *i2c_client;
+};
+
+static int menf21bmc_wdt_set_bootstatus(struct menf21bmc_wdt *data)
+{
+	int rst_rsn;
+
+	rst_rsn = i2c_smbus_read_byte_data(data->i2c_client, BMC_CMD_RST_RSN);
+	if (rst_rsn < 0)
+		return rst_rsn;
+
+	if (rst_rsn = 0x02)
+		data->wdt.bootstatus |= WDIOF_CARDRESET;
+	else if (rst_rsn = 0x05)
+		data->wdt.bootstatus |= WDIOF_EXTERN1;
+	else if (rst_rsn = 0x06)
+		data->wdt.bootstatus |= WDIOF_EXTERN2;
+	else if (rst_rsn = 0x0A)
+		data->wdt.bootstatus |= WDIOF_POWERUNDER;
+
+	return 0;
+}
+
+static int menf21bmc_wdt_start(struct watchdog_device *wdt)
+{
+	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
+
+	return i2c_smbus_write_byte(drv_data->i2c_client, BMC_CMD_WD_ON);
+}
+
+static int menf21bmc_wdt_stop(struct watchdog_device *wdt)
+{
+	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
+
+	return i2c_smbus_write_byte_data(drv_data->i2c_client,
+					 BMC_CMD_WD_OFF, BMC_WD_OFF_VAL);
+}
+
+static int
+menf21bmc_wdt_settimeout(struct watchdog_device *wdt, unsigned int timeout)
+{
+	int ret;
+	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
+
+	/*
+	 *  BMC Watchdog does have a resolution of 100ms.
+	 *  Watchdog API defines the timeout in seconds, so we have to
+	 *  multiply the value.
+	 */
+	ret = i2c_smbus_write_word_data(drv_data->i2c_client,
+					BMC_CMD_WD_TIME, timeout * 10);
+	if (ret < 0)
+		return ret;
+
+	wdt->timeout = timeout;
+
+	return 0;
+}
+
+static int menf21bmc_wdt_ping(struct watchdog_device *wdt)
+{
+	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
+
+	return i2c_smbus_write_byte(drv_data->i2c_client, BMC_CMD_WD_TRIG);
+}
+
+static const struct watchdog_info menf21bmc_wdt_info = {
+	.options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
+	.identity = DEVNAME,
+};
+
+static const struct watchdog_ops menf21bmc_wdt_ops = {
+	.owner		= THIS_MODULE,
+	.start		= menf21bmc_wdt_start,
+	.stop		= menf21bmc_wdt_stop,
+	.ping		= menf21bmc_wdt_ping,
+	.set_timeout	= menf21bmc_wdt_settimeout,
+};
+
+static int menf21bmc_wdt_probe(struct platform_device *pdev)
+{
+	int ret, bmc_timeout;
+	struct menf21bmc_wdt *drv_data;
+	struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
+
+	drv_data = devm_kzalloc(&pdev->dev,
+				sizeof(struct menf21bmc_wdt), GFP_KERNEL);
+	if (!drv_data)
+		return -ENOMEM;
+
+	drv_data->wdt.ops = &menf21bmc_wdt_ops;
+	drv_data->wdt.info = &menf21bmc_wdt_info;
+	drv_data->wdt.min_timeout = BMC_WD_TIMEOUT_MIN;
+	drv_data->wdt.max_timeout = BMC_WD_TIMEOUT_MAX;
+	drv_data->i2c_client = i2c_client;
+
+	/*
+	 * Get the current wdt timeout value from the BMC because
+	 * the BMC will save the value set before if the system restarts.
+	 */
+	bmc_timeout = i2c_smbus_read_word_data(drv_data->i2c_client,
+					       BMC_CMD_WD_TIME);
+	if (bmc_timeout < 0) {
+		dev_err(&pdev->dev, "failed to get current WDT timeout\n");
+		return bmc_timeout;
+	}
+
+	watchdog_init_timeout(&drv_data->wdt, bmc_timeout / 10, &pdev->dev);
+	watchdog_set_nowayout(&drv_data->wdt, nowayout);
+	watchdog_set_drvdata(&drv_data->wdt, drv_data);
+	platform_set_drvdata(pdev, drv_data);
+
+	ret = menf21bmc_wdt_set_bootstatus(drv_data);
+	if (ret < 0) {
+		dev_err(&pdev->dev, "failed to set Watchdog bootstatus\n");
+		return ret;
+	}
+
+	ret = watchdog_register_device(&drv_data->wdt);
+	if (ret) {
+		dev_err(&pdev->dev, "failed to register Watchdog device\n");
+		return ret;
+	}
+
+	dev_info(&pdev->dev, "MEN 14F021P00 BMC Watchdog device enabled\n");
+
+	return 0;
+}
+
+static int menf21bmc_wdt_remove(struct platform_device *pdev)
+{
+	struct menf21bmc_wdt *drv_data = platform_get_drvdata(pdev);
+
+	dev_warn(&pdev->dev,
+		 "Unregister MEN 14F021P00 BMC Watchdog device, board may reset\n");
+
+	watchdog_unregister_device(&drv_data->wdt);
+
+	return 0;
+}
+
+static void menf21bmc_wdt_shutdown(struct platform_device *pdev)
+{
+	struct menf21bmc_wdt *drv_data = platform_get_drvdata(pdev);
+
+	i2c_smbus_write_word_data(drv_data->i2c_client,
+				  BMC_CMD_WD_OFF, BMC_WD_OFF_VAL);
+}
+
+static struct  platform_driver menf21bmc_wdt = {
+	.driver		= {
+		.owner = THIS_MODULE,
+		.name	= DEVNAME,
+	},
+	.probe		= menf21bmc_wdt_probe,
+	.remove		= menf21bmc_wdt_remove,
+	.shutdown	= menf21bmc_wdt_shutdown,
+};
+
+module_platform_driver(menf21bmc_wdt);
+
+MODULE_DESCRIPTION("MEN 14F021P00 BMC Watchdog driver");
+MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:menf21bmc_wdt");
-- 
2.0.4


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply related	[flat|nested] 71+ messages in thread

* [PATCH v6 3/4] drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver
  2014-08-27 17:51 ` Andreas Werner
  (?)
@ 2014-08-27 17:52   ` Andreas Werner
  -1 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-27 17:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: sameo, lee.jones, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

Added driver to support the 14F021P00 BMC LEDs.
The BMC is a Board Management Controller including four LEDs which
can be switched on and off.

Signed-off-by: Andreas Werner <andreas.werner@men.de>
---
 drivers/leds/Kconfig          |   9 +++
 drivers/leds/Makefile         |   1 +
 drivers/leds/leds-menf21bmc.c | 131 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 141 insertions(+)
 create mode 100644 drivers/leds/leds-menf21bmc.c

diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 27cf0cd..ec03457 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -458,6 +458,15 @@ config LEDS_OT200
 	  This option enables support for the LEDs on the Bachmann OT200.
 	  Say Y to enable LEDs on the Bachmann OT200.
 
+config LEDS_MENF21BMC
+	tristate "LED support for the MEN 14F021P00 BMC"
+	depends on LEDS_CLASS && MFD_MENF21BMC
+	help
+	  Say Y here to include support for the MEN 14F021P00 BMC LEDs.
+
+	  This driver can also be built as a module. If so the module
+	  will be called leds-menf21bmc.
+
 comment "LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)"
 
 config LEDS_BLINKM
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index 3c03666..cadc433 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -53,6 +53,7 @@ obj-$(CONFIG_LEDS_MAX8997)		+= leds-max8997.o
 obj-$(CONFIG_LEDS_LM355x)		+= leds-lm355x.o
 obj-$(CONFIG_LEDS_BLINKM)		+= leds-blinkm.o
 obj-$(CONFIG_LEDS_VERSATILE)		+= leds-versatile.o
+obj-$(CONFIG_LEDS_MENF21BMC)		+= leds-menf21bmc.o
 
 # LED SPI Drivers
 obj-$(CONFIG_LEDS_DAC124S085)		+= leds-dac124s085.o
diff --git a/drivers/leds/leds-menf21bmc.c b/drivers/leds/leds-menf21bmc.c
new file mode 100644
index 0000000..89dd577
--- /dev/null
+++ b/drivers/leds/leds-menf21bmc.c
@@ -0,0 +1,131 @@
+/*
+ *  MEN 14F021P00 Board Management Controller (BMC) LEDs Driver.
+ *
+ *  This is the core LED driver of the MEN 14F021P00 BMC.
+ *  There are four LEDs available which can be switched on and off.
+ *  STATUS LED, HOT SWAP LED, USER LED 1, USER LED 2
+ *
+ *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/leds.h>
+#include <linux/i2c.h>
+
+#define BMC_CMD_LED_GET_SET	0xA0
+#define BMC_BIT_LED_STATUS	BIT(0)
+#define BMC_BIT_LED_HOTSWAP	BIT(1)
+#define BMC_BIT_LED_USER1	BIT(2)
+#define BMC_BIT_LED_USER2	BIT(3)
+
+struct menf21bmc_led {
+	struct led_classdev cdev;
+	u8 led_bit;
+	const char *name;
+	struct i2c_client *i2c_client;
+};
+
+static struct menf21bmc_led leds[] = {
+	{
+		.name = "menf21bmc:led_status",
+		.led_bit = BMC_BIT_LED_STATUS,
+	},
+	{
+		.name = "menf21bmc:led_hotswap",
+		.led_bit = BMC_BIT_LED_HOTSWAP,
+	},
+	{
+		.name = "menf21bmc:led_user1",
+		.led_bit = BMC_BIT_LED_USER1,
+	},
+	{
+		.name = "menf21bmc:led_user2",
+		.led_bit = BMC_BIT_LED_USER2,
+	}
+};
+
+static DEFINE_MUTEX(led_lock);
+
+static void
+menf21bmc_led_set(struct led_classdev *led_cdev, enum led_brightness value)
+{
+	int led_val;
+	struct menf21bmc_led *led = container_of(led_cdev,
+					struct menf21bmc_led, cdev);
+
+	mutex_lock(&led_lock);
+	led_val = i2c_smbus_read_byte_data(led->i2c_client,
+					   BMC_CMD_LED_GET_SET);
+	if (led_val < 0)
+		goto err_out;
+
+	if (value == LED_OFF)
+		led_val &= ~led->led_bit;
+	else
+		led_val |= led->led_bit;
+
+	i2c_smbus_write_byte_data(led->i2c_client,
+				  BMC_CMD_LED_GET_SET, led_val);
+err_out:
+	mutex_unlock(&led_lock);
+}
+
+static int menf21bmc_led_probe(struct platform_device *pdev)
+{
+	int i;
+	int ret;
+	struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
+
+	for (i = 0; i < ARRAY_SIZE(leds); i++) {
+		leds[i].cdev.name = leds[i].name;
+		leds[i].cdev.brightness_set = menf21bmc_led_set;
+		leds[i].i2c_client = i2c_client;
+		ret = led_classdev_register(&pdev->dev, &leds[i].cdev);
+		if (ret < 0)
+			goto err_free_leds;
+	}
+	dev_info(&pdev->dev, "MEN 140F21P00 BMC LED device enabled\n");
+
+	return 0;
+
+err_free_leds:
+	dev_err(&pdev->dev, "failed to register LED device\n");
+
+	for (i = i - 1; i >= 0; i--)
+		led_classdev_unregister(&leds[i].cdev);
+
+	return ret;
+}
+
+static int menf21bmc_led_remove(struct platform_device *pdev)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(leds); i++)
+		led_classdev_unregister(&leds[i].cdev);
+
+	return 0;
+}
+
+static struct platform_driver menf21bmc_led = {
+	.probe		= menf21bmc_led_probe,
+	.remove		= menf21bmc_led_remove,
+	.driver		= {
+		.name		= "menf21bmc_led",
+		.owner		= THIS_MODULE,
+	},
+};
+
+module_platform_driver(menf21bmc_led);
+
+MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
+MODULE_DESCRIPTION("MEN 14F021P00 BMC led driver");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:menf21bmc_led");
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 71+ messages in thread

* [PATCH v6 3/4] drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver
@ 2014-08-27 17:52   ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-27 17:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: sameo, lee.jones, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

Added driver to support the 14F021P00 BMC LEDs.
The BMC is a Board Management Controller including four LEDs which
can be switched on and off.

Signed-off-by: Andreas Werner <andreas.werner@men.de>
---
 drivers/leds/Kconfig          |   9 +++
 drivers/leds/Makefile         |   1 +
 drivers/leds/leds-menf21bmc.c | 131 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 141 insertions(+)
 create mode 100644 drivers/leds/leds-menf21bmc.c

diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 27cf0cd..ec03457 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -458,6 +458,15 @@ config LEDS_OT200
 	  This option enables support for the LEDs on the Bachmann OT200.
 	  Say Y to enable LEDs on the Bachmann OT200.
 
+config LEDS_MENF21BMC
+	tristate "LED support for the MEN 14F021P00 BMC"
+	depends on LEDS_CLASS && MFD_MENF21BMC
+	help
+	  Say Y here to include support for the MEN 14F021P00 BMC LEDs.
+
+	  This driver can also be built as a module. If so the module
+	  will be called leds-menf21bmc.
+
 comment "LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)"
 
 config LEDS_BLINKM
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index 3c03666..cadc433 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -53,6 +53,7 @@ obj-$(CONFIG_LEDS_MAX8997)		+= leds-max8997.o
 obj-$(CONFIG_LEDS_LM355x)		+= leds-lm355x.o
 obj-$(CONFIG_LEDS_BLINKM)		+= leds-blinkm.o
 obj-$(CONFIG_LEDS_VERSATILE)		+= leds-versatile.o
+obj-$(CONFIG_LEDS_MENF21BMC)		+= leds-menf21bmc.o
 
 # LED SPI Drivers
 obj-$(CONFIG_LEDS_DAC124S085)		+= leds-dac124s085.o
diff --git a/drivers/leds/leds-menf21bmc.c b/drivers/leds/leds-menf21bmc.c
new file mode 100644
index 0000000..89dd577
--- /dev/null
+++ b/drivers/leds/leds-menf21bmc.c
@@ -0,0 +1,131 @@
+/*
+ *  MEN 14F021P00 Board Management Controller (BMC) LEDs Driver.
+ *
+ *  This is the core LED driver of the MEN 14F021P00 BMC.
+ *  There are four LEDs available which can be switched on and off.
+ *  STATUS LED, HOT SWAP LED, USER LED 1, USER LED 2
+ *
+ *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/leds.h>
+#include <linux/i2c.h>
+
+#define BMC_CMD_LED_GET_SET	0xA0
+#define BMC_BIT_LED_STATUS	BIT(0)
+#define BMC_BIT_LED_HOTSWAP	BIT(1)
+#define BMC_BIT_LED_USER1	BIT(2)
+#define BMC_BIT_LED_USER2	BIT(3)
+
+struct menf21bmc_led {
+	struct led_classdev cdev;
+	u8 led_bit;
+	const char *name;
+	struct i2c_client *i2c_client;
+};
+
+static struct menf21bmc_led leds[] = {
+	{
+		.name = "menf21bmc:led_status",
+		.led_bit = BMC_BIT_LED_STATUS,
+	},
+	{
+		.name = "menf21bmc:led_hotswap",
+		.led_bit = BMC_BIT_LED_HOTSWAP,
+	},
+	{
+		.name = "menf21bmc:led_user1",
+		.led_bit = BMC_BIT_LED_USER1,
+	},
+	{
+		.name = "menf21bmc:led_user2",
+		.led_bit = BMC_BIT_LED_USER2,
+	}
+};
+
+static DEFINE_MUTEX(led_lock);
+
+static void
+menf21bmc_led_set(struct led_classdev *led_cdev, enum led_brightness value)
+{
+	int led_val;
+	struct menf21bmc_led *led = container_of(led_cdev,
+					struct menf21bmc_led, cdev);
+
+	mutex_lock(&led_lock);
+	led_val = i2c_smbus_read_byte_data(led->i2c_client,
+					   BMC_CMD_LED_GET_SET);
+	if (led_val < 0)
+		goto err_out;
+
+	if (value == LED_OFF)
+		led_val &= ~led->led_bit;
+	else
+		led_val |= led->led_bit;
+
+	i2c_smbus_write_byte_data(led->i2c_client,
+				  BMC_CMD_LED_GET_SET, led_val);
+err_out:
+	mutex_unlock(&led_lock);
+}
+
+static int menf21bmc_led_probe(struct platform_device *pdev)
+{
+	int i;
+	int ret;
+	struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
+
+	for (i = 0; i < ARRAY_SIZE(leds); i++) {
+		leds[i].cdev.name = leds[i].name;
+		leds[i].cdev.brightness_set = menf21bmc_led_set;
+		leds[i].i2c_client = i2c_client;
+		ret = led_classdev_register(&pdev->dev, &leds[i].cdev);
+		if (ret < 0)
+			goto err_free_leds;
+	}
+	dev_info(&pdev->dev, "MEN 140F21P00 BMC LED device enabled\n");
+
+	return 0;
+
+err_free_leds:
+	dev_err(&pdev->dev, "failed to register LED device\n");
+
+	for (i = i - 1; i >= 0; i--)
+		led_classdev_unregister(&leds[i].cdev);
+
+	return ret;
+}
+
+static int menf21bmc_led_remove(struct platform_device *pdev)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(leds); i++)
+		led_classdev_unregister(&leds[i].cdev);
+
+	return 0;
+}
+
+static struct platform_driver menf21bmc_led = {
+	.probe		= menf21bmc_led_probe,
+	.remove		= menf21bmc_led_remove,
+	.driver		= {
+		.name		= "menf21bmc_led",
+		.owner		= THIS_MODULE,
+	},
+};
+
+module_platform_driver(menf21bmc_led);
+
+MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
+MODULE_DESCRIPTION("MEN 14F021P00 BMC led driver");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:menf21bmc_led");
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 71+ messages in thread

* [lm-sensors] [PATCH v6 3/4] drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver
@ 2014-08-27 17:52   ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-27 17:52 UTC (permalink / raw)
  To: linux-kernel
  Cc: sameo, lee.jones, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

Added driver to support the 14F021P00 BMC LEDs.
The BMC is a Board Management Controller including four LEDs which
can be switched on and off.

Signed-off-by: Andreas Werner <andreas.werner@men.de>
---
 drivers/leds/Kconfig          |   9 +++
 drivers/leds/Makefile         |   1 +
 drivers/leds/leds-menf21bmc.c | 131 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 141 insertions(+)
 create mode 100644 drivers/leds/leds-menf21bmc.c

diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 27cf0cd..ec03457 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -458,6 +458,15 @@ config LEDS_OT200
 	  This option enables support for the LEDs on the Bachmann OT200.
 	  Say Y to enable LEDs on the Bachmann OT200.
 
+config LEDS_MENF21BMC
+	tristate "LED support for the MEN 14F021P00 BMC"
+	depends on LEDS_CLASS && MFD_MENF21BMC
+	help
+	  Say Y here to include support for the MEN 14F021P00 BMC LEDs.
+
+	  This driver can also be built as a module. If so the module
+	  will be called leds-menf21bmc.
+
 comment "LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)"
 
 config LEDS_BLINKM
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index 3c03666..cadc433 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -53,6 +53,7 @@ obj-$(CONFIG_LEDS_MAX8997)		+= leds-max8997.o
 obj-$(CONFIG_LEDS_LM355x)		+= leds-lm355x.o
 obj-$(CONFIG_LEDS_BLINKM)		+= leds-blinkm.o
 obj-$(CONFIG_LEDS_VERSATILE)		+= leds-versatile.o
+obj-$(CONFIG_LEDS_MENF21BMC)		+= leds-menf21bmc.o
 
 # LED SPI Drivers
 obj-$(CONFIG_LEDS_DAC124S085)		+= leds-dac124s085.o
diff --git a/drivers/leds/leds-menf21bmc.c b/drivers/leds/leds-menf21bmc.c
new file mode 100644
index 0000000..89dd577
--- /dev/null
+++ b/drivers/leds/leds-menf21bmc.c
@@ -0,0 +1,131 @@
+/*
+ *  MEN 14F021P00 Board Management Controller (BMC) LEDs Driver.
+ *
+ *  This is the core LED driver of the MEN 14F021P00 BMC.
+ *  There are four LEDs available which can be switched on and off.
+ *  STATUS LED, HOT SWAP LED, USER LED 1, USER LED 2
+ *
+ *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/leds.h>
+#include <linux/i2c.h>
+
+#define BMC_CMD_LED_GET_SET	0xA0
+#define BMC_BIT_LED_STATUS	BIT(0)
+#define BMC_BIT_LED_HOTSWAP	BIT(1)
+#define BMC_BIT_LED_USER1	BIT(2)
+#define BMC_BIT_LED_USER2	BIT(3)
+
+struct menf21bmc_led {
+	struct led_classdev cdev;
+	u8 led_bit;
+	const char *name;
+	struct i2c_client *i2c_client;
+};
+
+static struct menf21bmc_led leds[] = {
+	{
+		.name = "menf21bmc:led_status",
+		.led_bit = BMC_BIT_LED_STATUS,
+	},
+	{
+		.name = "menf21bmc:led_hotswap",
+		.led_bit = BMC_BIT_LED_HOTSWAP,
+	},
+	{
+		.name = "menf21bmc:led_user1",
+		.led_bit = BMC_BIT_LED_USER1,
+	},
+	{
+		.name = "menf21bmc:led_user2",
+		.led_bit = BMC_BIT_LED_USER2,
+	}
+};
+
+static DEFINE_MUTEX(led_lock);
+
+static void
+menf21bmc_led_set(struct led_classdev *led_cdev, enum led_brightness value)
+{
+	int led_val;
+	struct menf21bmc_led *led = container_of(led_cdev,
+					struct menf21bmc_led, cdev);
+
+	mutex_lock(&led_lock);
+	led_val = i2c_smbus_read_byte_data(led->i2c_client,
+					   BMC_CMD_LED_GET_SET);
+	if (led_val < 0)
+		goto err_out;
+
+	if (value = LED_OFF)
+		led_val &= ~led->led_bit;
+	else
+		led_val |= led->led_bit;
+
+	i2c_smbus_write_byte_data(led->i2c_client,
+				  BMC_CMD_LED_GET_SET, led_val);
+err_out:
+	mutex_unlock(&led_lock);
+}
+
+static int menf21bmc_led_probe(struct platform_device *pdev)
+{
+	int i;
+	int ret;
+	struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
+
+	for (i = 0; i < ARRAY_SIZE(leds); i++) {
+		leds[i].cdev.name = leds[i].name;
+		leds[i].cdev.brightness_set = menf21bmc_led_set;
+		leds[i].i2c_client = i2c_client;
+		ret = led_classdev_register(&pdev->dev, &leds[i].cdev);
+		if (ret < 0)
+			goto err_free_leds;
+	}
+	dev_info(&pdev->dev, "MEN 140F21P00 BMC LED device enabled\n");
+
+	return 0;
+
+err_free_leds:
+	dev_err(&pdev->dev, "failed to register LED device\n");
+
+	for (i = i - 1; i >= 0; i--)
+		led_classdev_unregister(&leds[i].cdev);
+
+	return ret;
+}
+
+static int menf21bmc_led_remove(struct platform_device *pdev)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(leds); i++)
+		led_classdev_unregister(&leds[i].cdev);
+
+	return 0;
+}
+
+static struct platform_driver menf21bmc_led = {
+	.probe		= menf21bmc_led_probe,
+	.remove		= menf21bmc_led_remove,
+	.driver		= {
+		.name		= "menf21bmc_led",
+		.owner		= THIS_MODULE,
+	},
+};
+
+module_platform_driver(menf21bmc_led);
+
+MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
+MODULE_DESCRIPTION("MEN 14F021P00 BMC led driver");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:menf21bmc_led");
-- 
2.0.4


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply related	[flat|nested] 71+ messages in thread

* [PATCH v6 4/4] drivers/hwmon/menf21bmc_hwmon: introduce MEN14F021P00 BMC HWMON driver
  2014-08-27 17:51 ` Andreas Werner
  (?)
@ 2014-08-27 17:53   ` Andreas Werner
  -1 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-27 17:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: sameo, lee.jones, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

Added driver to support the 14F021P00 BMC Hardware Monitoring.
The BMC is a Board Management Controller including monitoring of the
board voltages.

Signed-off-by: Andreas Werner <andreas.werner@men.de>
---
 Documentation/hwmon/menf21bmc   |  50 +++++++++
 drivers/hwmon/Kconfig           |  10 ++
 drivers/hwmon/Makefile          |   1 +
 drivers/hwmon/menf21bmc_hwmon.c | 230 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 291 insertions(+)
 create mode 100644 Documentation/hwmon/menf21bmc
 create mode 100644 drivers/hwmon/menf21bmc_hwmon.c

diff --git a/Documentation/hwmon/menf21bmc b/Documentation/hwmon/menf21bmc
new file mode 100644
index 0000000..2a273a0
--- /dev/null
+++ b/Documentation/hwmon/menf21bmc
@@ -0,0 +1,50 @@
+Kernel driver menf21bmc_hwmon
+=============================
+
+Supported chips:
+	* MEN 14F021P00
+	  Prefix: 'menf21bmc_hwmon'
+	  Adresses scanned: -
+
+Author: Andreas Werner <andreas.werner@men.de>
+
+Description
+-----------
+
+The menf21bmc is a Board Management Controller (BMC) which provides an I2C
+interface to the host to access the features implemented in the BMC.
+
+This driver gives access to the voltage monitoring feature of the main
+voltages of the board.
+The voltage sensors are connected to the ADC inputs of the BMC which is
+a PIC16F917 Mikrocontroller.
+
+Usage Notes
+-----------
+
+This driver is part of the MFD driver named "menf21bmc" and does
+not auto-detect devices.
+You will have to instantiate the MFD driver explicitly.
+Please see Documentation/i2c/instantiating-devices for
+details.
+
+Sysfs entries
+-------------
+
+The following attributes are supported. All attributes are read only
+The Limits are read once by the driver.
+
+in0_input	+3.3V input voltage
+in1_input	+5.0V input voltage
+in2_input	+12.0V input voltage
+in3_input	+5V Standby input voltage
+in4_input	VBAT (on board battery)
+
+in[0-4]_min	Minimum voltage limit
+in[0-4]_max	Maximum voltage limit
+
+in0_label	"MON_3_3V"
+in1_label	"MON_5V"
+in2_label	"MON_12V"
+in3_label	"5V_STANDBY"
+in4_label	"VBAT"
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 37908ff..1063d73 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -828,6 +828,16 @@ config SENSORS_MCP3021
 	  This driver can also be built as a module.  If so, the module
 	  will be called mcp3021.
 
+config SENSORS_MENF21BMC_HWMON
+	tristate "MEN 14F021P00 BMC Hardware Monitoring"
+	depends on MFD_MENF21BMC
+	help
+	  Say Y here to include support for the MEN 14F021P00 BMC
+	  hardware monitoring.
+
+	  This driver can also be built as a module. If so the module
+	  will be called menf21bmc_hwmon.
+
 config SENSORS_ADCXX
 	tristate "National Semiconductor ADCxxxSxxx"
 	depends on SPI_MASTER
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
index 1362382..56ab872 100644
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
@@ -114,6 +114,7 @@ obj-$(CONFIG_SENSORS_MAX6650)	+= max6650.o
 obj-$(CONFIG_SENSORS_MAX6697)	+= max6697.o
 obj-$(CONFIG_SENSORS_MC13783_ADC)+= mc13783-adc.o
 obj-$(CONFIG_SENSORS_MCP3021)	+= mcp3021.o
+obj-$(CONFIG_SENSORS_MENF21BMC_HWMON) += menf21bmc_hwmon.o
 obj-$(CONFIG_SENSORS_NCT6683)	+= nct6683.o
 obj-$(CONFIG_SENSORS_NCT6775)	+= nct6775.o
 obj-$(CONFIG_SENSORS_NTC_THERMISTOR)	+= ntc_thermistor.o
diff --git a/drivers/hwmon/menf21bmc_hwmon.c b/drivers/hwmon/menf21bmc_hwmon.c
new file mode 100644
index 0000000..c92229d
--- /dev/null
+++ b/drivers/hwmon/menf21bmc_hwmon.c
@@ -0,0 +1,230 @@
+/*
+ *  MEN 14F021P00 Board Management Controller (BMC) hwmon driver.
+ *
+ *  This is the core hwmon driver of the MEN 14F021P00 BMC.
+ *  The BMC monitors the board voltages which can be access with this
+ *  driver through sysfs.
+ *
+ *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/hwmon.h>
+#include <linux/hwmon-sysfs.h>
+#include <linux/jiffies.h>
+#include <linux/slab.h>
+#include <linux/i2c.h>
+
+#define DRV_NAME  "menf21bmc_hwmon"
+
+#define BMC_VOLT_COUNT	5
+#define MENF21BMC_V33	0
+#define MENF21BMC_V5	1
+#define MENF21BMC_V12	2
+#define MENF21BMC_V5_SB	3
+#define MENF21BMC_VBAT	4
+
+#define IDX_TO_VOLT_MIN_CMD(idx) (0x40 + idx)
+#define IDX_TO_VOLT_MAX_CMD(idx) (0x50 + idx)
+#define IDX_TO_VOLT_INP_CMD(idx) (0x60 + idx)
+
+struct menf21bmc_hwmon {
+	bool valid;
+	struct i2c_client *i2c_client;
+	unsigned long last_update;
+	int in_val[BMC_VOLT_COUNT];
+	int in_min[BMC_VOLT_COUNT];
+	int in_max[BMC_VOLT_COUNT];
+};
+
+static const char *const input_names[] = {
+	[MENF21BMC_V33]		= "MON_3_3V",
+	[MENF21BMC_V5]		= "MON_5V",
+	[MENF21BMC_V12]		= "MON_12V",
+	[MENF21BMC_V5_SB]	= "5V_STANDBY",
+	[MENF21BMC_VBAT]	= "VBAT"
+};
+
+static struct menf21bmc_hwmon *menf21bmc_hwmon_update(struct device *dev)
+{
+	int i;
+	int val;
+	struct menf21bmc_hwmon *drv_data = dev_get_drvdata(dev);
+	struct menf21bmc_hwmon *data_ret = drv_data;
+
+	if (time_after(jiffies, drv_data->last_update + HZ)
+	    || !drv_data->valid) {
+		for (i = 0; i < BMC_VOLT_COUNT; i++) {
+			val = i2c_smbus_read_word_data(drv_data->i2c_client,
+						       IDX_TO_VOLT_INP_CMD(i));
+			if (val < 0) {
+				data_ret = ERR_PTR(val);
+				goto abort;
+			}
+			drv_data->in_val[i] = val;
+		}
+		drv_data->last_update = jiffies;
+		drv_data->valid = true;
+	}
+abort:
+	return data_ret;
+}
+
+static int menf21bmc_hwmon_get_volt_limits(struct menf21bmc_hwmon *drv_data)
+{
+	int i, val;
+
+	for (i = 0; i < BMC_VOLT_COUNT; i++) {
+		val = i2c_smbus_read_word_data(drv_data->i2c_client,
+					       IDX_TO_VOLT_MIN_CMD(i));
+		if (val < 0)
+			return val;
+
+		drv_data->in_min[i] = val;
+
+		val = i2c_smbus_read_word_data(drv_data->i2c_client,
+					       IDX_TO_VOLT_MAX_CMD(i));
+		if (val < 0)
+			return val;
+
+		drv_data->in_max[i] = val;
+	}
+	return 0;
+}
+
+static ssize_t
+show_label(struct device *dev, struct device_attribute *devattr, char *buf)
+{
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+
+	return sprintf(buf, "%s\n", input_names[attr->index]);
+}
+
+static ssize_t
+show_in(struct device *dev, struct device_attribute *devattr, char *buf)
+{
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+	struct menf21bmc_hwmon *drv_data = menf21bmc_hwmon_update(dev);
+
+	if (IS_ERR(drv_data))
+		return PTR_ERR(drv_data);
+
+	return sprintf(buf, "%d\n", drv_data->in_val[attr->index]);
+}
+
+static ssize_t
+show_min(struct device *dev, struct device_attribute *devattr, char *buf)
+{
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+	struct menf21bmc_hwmon *drv_data = dev_get_drvdata(dev);
+
+	return sprintf(buf, "%d\n", drv_data->in_min[attr->index]);
+}
+
+static ssize_t
+show_max(struct device *dev, struct device_attribute *devattr, char *buf)
+{
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+	struct menf21bmc_hwmon *drv_data = dev_get_drvdata(dev);
+
+	return sprintf(buf, "%d\n", drv_data->in_max[attr->index]);
+}
+
+#define create_voltage_sysfs(idx)			\
+static SENSOR_DEVICE_ATTR(in##idx##_input, S_IRUGO,	\
+			show_in, NULL, idx);		\
+static SENSOR_DEVICE_ATTR(in##idx##_min, S_IRUGO,	\
+			show_min, NULL, idx);		\
+static SENSOR_DEVICE_ATTR(in##idx##_max, S_IRUGO,	\
+			show_max, NULL, idx);		\
+static SENSOR_DEVICE_ATTR(in##idx##_label, S_IRUGO,	\
+			show_label, NULL, idx);
+
+create_voltage_sysfs(0);
+create_voltage_sysfs(1);
+create_voltage_sysfs(2);
+create_voltage_sysfs(3);
+create_voltage_sysfs(4);
+
+static struct attribute *menf21bmc_hwmon_attrs[] = {
+	&sensor_dev_attr_in0_input.dev_attr.attr,
+	&sensor_dev_attr_in0_min.dev_attr.attr,
+	&sensor_dev_attr_in0_max.dev_attr.attr,
+	&sensor_dev_attr_in0_label.dev_attr.attr,
+
+	&sensor_dev_attr_in1_input.dev_attr.attr,
+	&sensor_dev_attr_in1_min.dev_attr.attr,
+	&sensor_dev_attr_in1_max.dev_attr.attr,
+	&sensor_dev_attr_in1_label.dev_attr.attr,
+
+	&sensor_dev_attr_in2_input.dev_attr.attr,
+	&sensor_dev_attr_in2_min.dev_attr.attr,
+	&sensor_dev_attr_in2_max.dev_attr.attr,
+	&sensor_dev_attr_in2_label.dev_attr.attr,
+
+	&sensor_dev_attr_in3_input.dev_attr.attr,
+	&sensor_dev_attr_in3_min.dev_attr.attr,
+	&sensor_dev_attr_in3_max.dev_attr.attr,
+	&sensor_dev_attr_in3_label.dev_attr.attr,
+
+	&sensor_dev_attr_in4_input.dev_attr.attr,
+	&sensor_dev_attr_in4_min.dev_attr.attr,
+	&sensor_dev_attr_in4_max.dev_attr.attr,
+	&sensor_dev_attr_in4_label.dev_attr.attr,
+	NULL
+};
+
+ATTRIBUTE_GROUPS(menf21bmc_hwmon);
+
+static int menf21bmc_hwmon_probe(struct platform_device *pdev)
+{
+	int ret;
+	struct menf21bmc_hwmon *drv_data;
+	struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
+	struct device *hwmon_dev;
+
+	drv_data = devm_kzalloc(&pdev->dev, sizeof(struct menf21bmc_hwmon),
+				GFP_KERNEL);
+	if (!drv_data)
+		return -ENOMEM;
+
+	drv_data->i2c_client = i2c_client;
+
+	ret = menf21bmc_hwmon_get_volt_limits(drv_data);
+	if (ret) {
+		dev_err(&pdev->dev, "failed to read sensor limits");
+		return ret;
+	}
+
+	hwmon_dev = devm_hwmon_device_register_with_groups(&pdev->dev,
+						   "menf21bmc", drv_data,
+						   menf21bmc_hwmon_groups);
+	if (IS_ERR(hwmon_dev))
+		return PTR_ERR(hwmon_dev);
+
+	dev_info(&pdev->dev, "MEN 14F021P00 BMC hwmon device enabled");
+
+	return 0;
+}
+
+static struct platform_driver menf21bmc_hwmon = {
+	.probe		= menf21bmc_hwmon_probe,
+	.driver		= {
+		.name		= DRV_NAME,
+		.owner		= THIS_MODULE,
+	},
+};
+
+module_platform_driver(menf21bmc_hwmon);
+
+MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
+MODULE_DESCRIPTION("MEN 14F021P00 BMC hwmon");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:menf21bmc_hwmon");
-- 
2.0.4

^ permalink raw reply related	[flat|nested] 71+ messages in thread

* [PATCH v6 4/4] drivers/hwmon/menf21bmc_hwmon: introduce MEN14F021P00 BMC HWMON driver
@ 2014-08-27 17:53   ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-27 17:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: sameo, lee.jones, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

Added driver to support the 14F021P00 BMC Hardware Monitoring.
The BMC is a Board Management Controller including monitoring of the
board voltages.

Signed-off-by: Andreas Werner <andreas.werner@men.de>
---
 Documentation/hwmon/menf21bmc   |  50 +++++++++
 drivers/hwmon/Kconfig           |  10 ++
 drivers/hwmon/Makefile          |   1 +
 drivers/hwmon/menf21bmc_hwmon.c | 230 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 291 insertions(+)
 create mode 100644 Documentation/hwmon/menf21bmc
 create mode 100644 drivers/hwmon/menf21bmc_hwmon.c

diff --git a/Documentation/hwmon/menf21bmc b/Documentation/hwmon/menf21bmc
new file mode 100644
index 0000000..2a273a0
--- /dev/null
+++ b/Documentation/hwmon/menf21bmc
@@ -0,0 +1,50 @@
+Kernel driver menf21bmc_hwmon
+=============================
+
+Supported chips:
+	* MEN 14F021P00
+	  Prefix: 'menf21bmc_hwmon'
+	  Adresses scanned: -
+
+Author: Andreas Werner <andreas.werner@men.de>
+
+Description
+-----------
+
+The menf21bmc is a Board Management Controller (BMC) which provides an I2C
+interface to the host to access the features implemented in the BMC.
+
+This driver gives access to the voltage monitoring feature of the main
+voltages of the board.
+The voltage sensors are connected to the ADC inputs of the BMC which is
+a PIC16F917 Mikrocontroller.
+
+Usage Notes
+-----------
+
+This driver is part of the MFD driver named "menf21bmc" and does
+not auto-detect devices.
+You will have to instantiate the MFD driver explicitly.
+Please see Documentation/i2c/instantiating-devices for
+details.
+
+Sysfs entries
+-------------
+
+The following attributes are supported. All attributes are read only
+The Limits are read once by the driver.
+
+in0_input	+3.3V input voltage
+in1_input	+5.0V input voltage
+in2_input	+12.0V input voltage
+in3_input	+5V Standby input voltage
+in4_input	VBAT (on board battery)
+
+in[0-4]_min	Minimum voltage limit
+in[0-4]_max	Maximum voltage limit
+
+in0_label	"MON_3_3V"
+in1_label	"MON_5V"
+in2_label	"MON_12V"
+in3_label	"5V_STANDBY"
+in4_label	"VBAT"
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 37908ff..1063d73 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -828,6 +828,16 @@ config SENSORS_MCP3021
 	  This driver can also be built as a module.  If so, the module
 	  will be called mcp3021.
 
+config SENSORS_MENF21BMC_HWMON
+	tristate "MEN 14F021P00 BMC Hardware Monitoring"
+	depends on MFD_MENF21BMC
+	help
+	  Say Y here to include support for the MEN 14F021P00 BMC
+	  hardware monitoring.
+
+	  This driver can also be built as a module. If so the module
+	  will be called menf21bmc_hwmon.
+
 config SENSORS_ADCXX
 	tristate "National Semiconductor ADCxxxSxxx"
 	depends on SPI_MASTER
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
index 1362382..56ab872 100644
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
@@ -114,6 +114,7 @@ obj-$(CONFIG_SENSORS_MAX6650)	+= max6650.o
 obj-$(CONFIG_SENSORS_MAX6697)	+= max6697.o
 obj-$(CONFIG_SENSORS_MC13783_ADC)+= mc13783-adc.o
 obj-$(CONFIG_SENSORS_MCP3021)	+= mcp3021.o
+obj-$(CONFIG_SENSORS_MENF21BMC_HWMON) += menf21bmc_hwmon.o
 obj-$(CONFIG_SENSORS_NCT6683)	+= nct6683.o
 obj-$(CONFIG_SENSORS_NCT6775)	+= nct6775.o
 obj-$(CONFIG_SENSORS_NTC_THERMISTOR)	+= ntc_thermistor.o
diff --git a/drivers/hwmon/menf21bmc_hwmon.c b/drivers/hwmon/menf21bmc_hwmon.c
new file mode 100644
index 0000000..c92229d
--- /dev/null
+++ b/drivers/hwmon/menf21bmc_hwmon.c
@@ -0,0 +1,230 @@
+/*
+ *  MEN 14F021P00 Board Management Controller (BMC) hwmon driver.
+ *
+ *  This is the core hwmon driver of the MEN 14F021P00 BMC.
+ *  The BMC monitors the board voltages which can be access with this
+ *  driver through sysfs.
+ *
+ *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/hwmon.h>
+#include <linux/hwmon-sysfs.h>
+#include <linux/jiffies.h>
+#include <linux/slab.h>
+#include <linux/i2c.h>
+
+#define DRV_NAME  "menf21bmc_hwmon"
+
+#define BMC_VOLT_COUNT	5
+#define MENF21BMC_V33	0
+#define MENF21BMC_V5	1
+#define MENF21BMC_V12	2
+#define MENF21BMC_V5_SB	3
+#define MENF21BMC_VBAT	4
+
+#define IDX_TO_VOLT_MIN_CMD(idx) (0x40 + idx)
+#define IDX_TO_VOLT_MAX_CMD(idx) (0x50 + idx)
+#define IDX_TO_VOLT_INP_CMD(idx) (0x60 + idx)
+
+struct menf21bmc_hwmon {
+	bool valid;
+	struct i2c_client *i2c_client;
+	unsigned long last_update;
+	int in_val[BMC_VOLT_COUNT];
+	int in_min[BMC_VOLT_COUNT];
+	int in_max[BMC_VOLT_COUNT];
+};
+
+static const char *const input_names[] = {
+	[MENF21BMC_V33]		= "MON_3_3V",
+	[MENF21BMC_V5]		= "MON_5V",
+	[MENF21BMC_V12]		= "MON_12V",
+	[MENF21BMC_V5_SB]	= "5V_STANDBY",
+	[MENF21BMC_VBAT]	= "VBAT"
+};
+
+static struct menf21bmc_hwmon *menf21bmc_hwmon_update(struct device *dev)
+{
+	int i;
+	int val;
+	struct menf21bmc_hwmon *drv_data = dev_get_drvdata(dev);
+	struct menf21bmc_hwmon *data_ret = drv_data;
+
+	if (time_after(jiffies, drv_data->last_update + HZ)
+	    || !drv_data->valid) {
+		for (i = 0; i < BMC_VOLT_COUNT; i++) {
+			val = i2c_smbus_read_word_data(drv_data->i2c_client,
+						       IDX_TO_VOLT_INP_CMD(i));
+			if (val < 0) {
+				data_ret = ERR_PTR(val);
+				goto abort;
+			}
+			drv_data->in_val[i] = val;
+		}
+		drv_data->last_update = jiffies;
+		drv_data->valid = true;
+	}
+abort:
+	return data_ret;
+}
+
+static int menf21bmc_hwmon_get_volt_limits(struct menf21bmc_hwmon *drv_data)
+{
+	int i, val;
+
+	for (i = 0; i < BMC_VOLT_COUNT; i++) {
+		val = i2c_smbus_read_word_data(drv_data->i2c_client,
+					       IDX_TO_VOLT_MIN_CMD(i));
+		if (val < 0)
+			return val;
+
+		drv_data->in_min[i] = val;
+
+		val = i2c_smbus_read_word_data(drv_data->i2c_client,
+					       IDX_TO_VOLT_MAX_CMD(i));
+		if (val < 0)
+			return val;
+
+		drv_data->in_max[i] = val;
+	}
+	return 0;
+}
+
+static ssize_t
+show_label(struct device *dev, struct device_attribute *devattr, char *buf)
+{
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+
+	return sprintf(buf, "%s\n", input_names[attr->index]);
+}
+
+static ssize_t
+show_in(struct device *dev, struct device_attribute *devattr, char *buf)
+{
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+	struct menf21bmc_hwmon *drv_data = menf21bmc_hwmon_update(dev);
+
+	if (IS_ERR(drv_data))
+		return PTR_ERR(drv_data);
+
+	return sprintf(buf, "%d\n", drv_data->in_val[attr->index]);
+}
+
+static ssize_t
+show_min(struct device *dev, struct device_attribute *devattr, char *buf)
+{
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+	struct menf21bmc_hwmon *drv_data = dev_get_drvdata(dev);
+
+	return sprintf(buf, "%d\n", drv_data->in_min[attr->index]);
+}
+
+static ssize_t
+show_max(struct device *dev, struct device_attribute *devattr, char *buf)
+{
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+	struct menf21bmc_hwmon *drv_data = dev_get_drvdata(dev);
+
+	return sprintf(buf, "%d\n", drv_data->in_max[attr->index]);
+}
+
+#define create_voltage_sysfs(idx)			\
+static SENSOR_DEVICE_ATTR(in##idx##_input, S_IRUGO,	\
+			show_in, NULL, idx);		\
+static SENSOR_DEVICE_ATTR(in##idx##_min, S_IRUGO,	\
+			show_min, NULL, idx);		\
+static SENSOR_DEVICE_ATTR(in##idx##_max, S_IRUGO,	\
+			show_max, NULL, idx);		\
+static SENSOR_DEVICE_ATTR(in##idx##_label, S_IRUGO,	\
+			show_label, NULL, idx);
+
+create_voltage_sysfs(0);
+create_voltage_sysfs(1);
+create_voltage_sysfs(2);
+create_voltage_sysfs(3);
+create_voltage_sysfs(4);
+
+static struct attribute *menf21bmc_hwmon_attrs[] = {
+	&sensor_dev_attr_in0_input.dev_attr.attr,
+	&sensor_dev_attr_in0_min.dev_attr.attr,
+	&sensor_dev_attr_in0_max.dev_attr.attr,
+	&sensor_dev_attr_in0_label.dev_attr.attr,
+
+	&sensor_dev_attr_in1_input.dev_attr.attr,
+	&sensor_dev_attr_in1_min.dev_attr.attr,
+	&sensor_dev_attr_in1_max.dev_attr.attr,
+	&sensor_dev_attr_in1_label.dev_attr.attr,
+
+	&sensor_dev_attr_in2_input.dev_attr.attr,
+	&sensor_dev_attr_in2_min.dev_attr.attr,
+	&sensor_dev_attr_in2_max.dev_attr.attr,
+	&sensor_dev_attr_in2_label.dev_attr.attr,
+
+	&sensor_dev_attr_in3_input.dev_attr.attr,
+	&sensor_dev_attr_in3_min.dev_attr.attr,
+	&sensor_dev_attr_in3_max.dev_attr.attr,
+	&sensor_dev_attr_in3_label.dev_attr.attr,
+
+	&sensor_dev_attr_in4_input.dev_attr.attr,
+	&sensor_dev_attr_in4_min.dev_attr.attr,
+	&sensor_dev_attr_in4_max.dev_attr.attr,
+	&sensor_dev_attr_in4_label.dev_attr.attr,
+	NULL
+};
+
+ATTRIBUTE_GROUPS(menf21bmc_hwmon);
+
+static int menf21bmc_hwmon_probe(struct platform_device *pdev)
+{
+	int ret;
+	struct menf21bmc_hwmon *drv_data;
+	struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
+	struct device *hwmon_dev;
+
+	drv_data = devm_kzalloc(&pdev->dev, sizeof(struct menf21bmc_hwmon),
+				GFP_KERNEL);
+	if (!drv_data)
+		return -ENOMEM;
+
+	drv_data->i2c_client = i2c_client;
+
+	ret = menf21bmc_hwmon_get_volt_limits(drv_data);
+	if (ret) {
+		dev_err(&pdev->dev, "failed to read sensor limits");
+		return ret;
+	}
+
+	hwmon_dev = devm_hwmon_device_register_with_groups(&pdev->dev,
+						   "menf21bmc", drv_data,
+						   menf21bmc_hwmon_groups);
+	if (IS_ERR(hwmon_dev))
+		return PTR_ERR(hwmon_dev);
+
+	dev_info(&pdev->dev, "MEN 14F021P00 BMC hwmon device enabled");
+
+	return 0;
+}
+
+static struct platform_driver menf21bmc_hwmon = {
+	.probe		= menf21bmc_hwmon_probe,
+	.driver		= {
+		.name		= DRV_NAME,
+		.owner		= THIS_MODULE,
+	},
+};
+
+module_platform_driver(menf21bmc_hwmon);
+
+MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
+MODULE_DESCRIPTION("MEN 14F021P00 BMC hwmon");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:menf21bmc_hwmon");
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 71+ messages in thread

* [lm-sensors] [PATCH v6 4/4] drivers/hwmon/menf21bmc_hwmon: introduce MEN14F021P00 BMC HWMON driver
@ 2014-08-27 17:53   ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-27 17:53 UTC (permalink / raw)
  To: linux-kernel
  Cc: sameo, lee.jones, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

Added driver to support the 14F021P00 BMC Hardware Monitoring.
The BMC is a Board Management Controller including monitoring of the
board voltages.

Signed-off-by: Andreas Werner <andreas.werner@men.de>
---
 Documentation/hwmon/menf21bmc   |  50 +++++++++
 drivers/hwmon/Kconfig           |  10 ++
 drivers/hwmon/Makefile          |   1 +
 drivers/hwmon/menf21bmc_hwmon.c | 230 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 291 insertions(+)
 create mode 100644 Documentation/hwmon/menf21bmc
 create mode 100644 drivers/hwmon/menf21bmc_hwmon.c

diff --git a/Documentation/hwmon/menf21bmc b/Documentation/hwmon/menf21bmc
new file mode 100644
index 0000000..2a273a0
--- /dev/null
+++ b/Documentation/hwmon/menf21bmc
@@ -0,0 +1,50 @@
+Kernel driver menf21bmc_hwmon
+==============+
+Supported chips:
+	* MEN 14F021P00
+	  Prefix: 'menf21bmc_hwmon'
+	  Adresses scanned: -
+
+Author: Andreas Werner <andreas.werner@men.de>
+
+Description
+-----------
+
+The menf21bmc is a Board Management Controller (BMC) which provides an I2C
+interface to the host to access the features implemented in the BMC.
+
+This driver gives access to the voltage monitoring feature of the main
+voltages of the board.
+The voltage sensors are connected to the ADC inputs of the BMC which is
+a PIC16F917 Mikrocontroller.
+
+Usage Notes
+-----------
+
+This driver is part of the MFD driver named "menf21bmc" and does
+not auto-detect devices.
+You will have to instantiate the MFD driver explicitly.
+Please see Documentation/i2c/instantiating-devices for
+details.
+
+Sysfs entries
+-------------
+
+The following attributes are supported. All attributes are read only
+The Limits are read once by the driver.
+
+in0_input	+3.3V input voltage
+in1_input	+5.0V input voltage
+in2_input	+12.0V input voltage
+in3_input	+5V Standby input voltage
+in4_input	VBAT (on board battery)
+
+in[0-4]_min	Minimum voltage limit
+in[0-4]_max	Maximum voltage limit
+
+in0_label	"MON_3_3V"
+in1_label	"MON_5V"
+in2_label	"MON_12V"
+in3_label	"5V_STANDBY"
+in4_label	"VBAT"
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 37908ff..1063d73 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -828,6 +828,16 @@ config SENSORS_MCP3021
 	  This driver can also be built as a module.  If so, the module
 	  will be called mcp3021.
 
+config SENSORS_MENF21BMC_HWMON
+	tristate "MEN 14F021P00 BMC Hardware Monitoring"
+	depends on MFD_MENF21BMC
+	help
+	  Say Y here to include support for the MEN 14F021P00 BMC
+	  hardware monitoring.
+
+	  This driver can also be built as a module. If so the module
+	  will be called menf21bmc_hwmon.
+
 config SENSORS_ADCXX
 	tristate "National Semiconductor ADCxxxSxxx"
 	depends on SPI_MASTER
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
index 1362382..56ab872 100644
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
@@ -114,6 +114,7 @@ obj-$(CONFIG_SENSORS_MAX6650)	+= max6650.o
 obj-$(CONFIG_SENSORS_MAX6697)	+= max6697.o
 obj-$(CONFIG_SENSORS_MC13783_ADC)+= mc13783-adc.o
 obj-$(CONFIG_SENSORS_MCP3021)	+= mcp3021.o
+obj-$(CONFIG_SENSORS_MENF21BMC_HWMON) += menf21bmc_hwmon.o
 obj-$(CONFIG_SENSORS_NCT6683)	+= nct6683.o
 obj-$(CONFIG_SENSORS_NCT6775)	+= nct6775.o
 obj-$(CONFIG_SENSORS_NTC_THERMISTOR)	+= ntc_thermistor.o
diff --git a/drivers/hwmon/menf21bmc_hwmon.c b/drivers/hwmon/menf21bmc_hwmon.c
new file mode 100644
index 0000000..c92229d
--- /dev/null
+++ b/drivers/hwmon/menf21bmc_hwmon.c
@@ -0,0 +1,230 @@
+/*
+ *  MEN 14F021P00 Board Management Controller (BMC) hwmon driver.
+ *
+ *  This is the core hwmon driver of the MEN 14F021P00 BMC.
+ *  The BMC monitors the board voltages which can be access with this
+ *  driver through sysfs.
+ *
+ *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/hwmon.h>
+#include <linux/hwmon-sysfs.h>
+#include <linux/jiffies.h>
+#include <linux/slab.h>
+#include <linux/i2c.h>
+
+#define DRV_NAME  "menf21bmc_hwmon"
+
+#define BMC_VOLT_COUNT	5
+#define MENF21BMC_V33	0
+#define MENF21BMC_V5	1
+#define MENF21BMC_V12	2
+#define MENF21BMC_V5_SB	3
+#define MENF21BMC_VBAT	4
+
+#define IDX_TO_VOLT_MIN_CMD(idx) (0x40 + idx)
+#define IDX_TO_VOLT_MAX_CMD(idx) (0x50 + idx)
+#define IDX_TO_VOLT_INP_CMD(idx) (0x60 + idx)
+
+struct menf21bmc_hwmon {
+	bool valid;
+	struct i2c_client *i2c_client;
+	unsigned long last_update;
+	int in_val[BMC_VOLT_COUNT];
+	int in_min[BMC_VOLT_COUNT];
+	int in_max[BMC_VOLT_COUNT];
+};
+
+static const char *const input_names[] = {
+	[MENF21BMC_V33]		= "MON_3_3V",
+	[MENF21BMC_V5]		= "MON_5V",
+	[MENF21BMC_V12]		= "MON_12V",
+	[MENF21BMC_V5_SB]	= "5V_STANDBY",
+	[MENF21BMC_VBAT]	= "VBAT"
+};
+
+static struct menf21bmc_hwmon *menf21bmc_hwmon_update(struct device *dev)
+{
+	int i;
+	int val;
+	struct menf21bmc_hwmon *drv_data = dev_get_drvdata(dev);
+	struct menf21bmc_hwmon *data_ret = drv_data;
+
+	if (time_after(jiffies, drv_data->last_update + HZ)
+	    || !drv_data->valid) {
+		for (i = 0; i < BMC_VOLT_COUNT; i++) {
+			val = i2c_smbus_read_word_data(drv_data->i2c_client,
+						       IDX_TO_VOLT_INP_CMD(i));
+			if (val < 0) {
+				data_ret = ERR_PTR(val);
+				goto abort;
+			}
+			drv_data->in_val[i] = val;
+		}
+		drv_data->last_update = jiffies;
+		drv_data->valid = true;
+	}
+abort:
+	return data_ret;
+}
+
+static int menf21bmc_hwmon_get_volt_limits(struct menf21bmc_hwmon *drv_data)
+{
+	int i, val;
+
+	for (i = 0; i < BMC_VOLT_COUNT; i++) {
+		val = i2c_smbus_read_word_data(drv_data->i2c_client,
+					       IDX_TO_VOLT_MIN_CMD(i));
+		if (val < 0)
+			return val;
+
+		drv_data->in_min[i] = val;
+
+		val = i2c_smbus_read_word_data(drv_data->i2c_client,
+					       IDX_TO_VOLT_MAX_CMD(i));
+		if (val < 0)
+			return val;
+
+		drv_data->in_max[i] = val;
+	}
+	return 0;
+}
+
+static ssize_t
+show_label(struct device *dev, struct device_attribute *devattr, char *buf)
+{
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+
+	return sprintf(buf, "%s\n", input_names[attr->index]);
+}
+
+static ssize_t
+show_in(struct device *dev, struct device_attribute *devattr, char *buf)
+{
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+	struct menf21bmc_hwmon *drv_data = menf21bmc_hwmon_update(dev);
+
+	if (IS_ERR(drv_data))
+		return PTR_ERR(drv_data);
+
+	return sprintf(buf, "%d\n", drv_data->in_val[attr->index]);
+}
+
+static ssize_t
+show_min(struct device *dev, struct device_attribute *devattr, char *buf)
+{
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+	struct menf21bmc_hwmon *drv_data = dev_get_drvdata(dev);
+
+	return sprintf(buf, "%d\n", drv_data->in_min[attr->index]);
+}
+
+static ssize_t
+show_max(struct device *dev, struct device_attribute *devattr, char *buf)
+{
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+	struct menf21bmc_hwmon *drv_data = dev_get_drvdata(dev);
+
+	return sprintf(buf, "%d\n", drv_data->in_max[attr->index]);
+}
+
+#define create_voltage_sysfs(idx)			\
+static SENSOR_DEVICE_ATTR(in##idx##_input, S_IRUGO,	\
+			show_in, NULL, idx);		\
+static SENSOR_DEVICE_ATTR(in##idx##_min, S_IRUGO,	\
+			show_min, NULL, idx);		\
+static SENSOR_DEVICE_ATTR(in##idx##_max, S_IRUGO,	\
+			show_max, NULL, idx);		\
+static SENSOR_DEVICE_ATTR(in##idx##_label, S_IRUGO,	\
+			show_label, NULL, idx);
+
+create_voltage_sysfs(0);
+create_voltage_sysfs(1);
+create_voltage_sysfs(2);
+create_voltage_sysfs(3);
+create_voltage_sysfs(4);
+
+static struct attribute *menf21bmc_hwmon_attrs[] = {
+	&sensor_dev_attr_in0_input.dev_attr.attr,
+	&sensor_dev_attr_in0_min.dev_attr.attr,
+	&sensor_dev_attr_in0_max.dev_attr.attr,
+	&sensor_dev_attr_in0_label.dev_attr.attr,
+
+	&sensor_dev_attr_in1_input.dev_attr.attr,
+	&sensor_dev_attr_in1_min.dev_attr.attr,
+	&sensor_dev_attr_in1_max.dev_attr.attr,
+	&sensor_dev_attr_in1_label.dev_attr.attr,
+
+	&sensor_dev_attr_in2_input.dev_attr.attr,
+	&sensor_dev_attr_in2_min.dev_attr.attr,
+	&sensor_dev_attr_in2_max.dev_attr.attr,
+	&sensor_dev_attr_in2_label.dev_attr.attr,
+
+	&sensor_dev_attr_in3_input.dev_attr.attr,
+	&sensor_dev_attr_in3_min.dev_attr.attr,
+	&sensor_dev_attr_in3_max.dev_attr.attr,
+	&sensor_dev_attr_in3_label.dev_attr.attr,
+
+	&sensor_dev_attr_in4_input.dev_attr.attr,
+	&sensor_dev_attr_in4_min.dev_attr.attr,
+	&sensor_dev_attr_in4_max.dev_attr.attr,
+	&sensor_dev_attr_in4_label.dev_attr.attr,
+	NULL
+};
+
+ATTRIBUTE_GROUPS(menf21bmc_hwmon);
+
+static int menf21bmc_hwmon_probe(struct platform_device *pdev)
+{
+	int ret;
+	struct menf21bmc_hwmon *drv_data;
+	struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
+	struct device *hwmon_dev;
+
+	drv_data = devm_kzalloc(&pdev->dev, sizeof(struct menf21bmc_hwmon),
+				GFP_KERNEL);
+	if (!drv_data)
+		return -ENOMEM;
+
+	drv_data->i2c_client = i2c_client;
+
+	ret = menf21bmc_hwmon_get_volt_limits(drv_data);
+	if (ret) {
+		dev_err(&pdev->dev, "failed to read sensor limits");
+		return ret;
+	}
+
+	hwmon_dev = devm_hwmon_device_register_with_groups(&pdev->dev,
+						   "menf21bmc", drv_data,
+						   menf21bmc_hwmon_groups);
+	if (IS_ERR(hwmon_dev))
+		return PTR_ERR(hwmon_dev);
+
+	dev_info(&pdev->dev, "MEN 14F021P00 BMC hwmon device enabled");
+
+	return 0;
+}
+
+static struct platform_driver menf21bmc_hwmon = {
+	.probe		= menf21bmc_hwmon_probe,
+	.driver		= {
+		.name		= DRV_NAME,
+		.owner		= THIS_MODULE,
+	},
+};
+
+module_platform_driver(menf21bmc_hwmon);
+
+MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
+MODULE_DESCRIPTION("MEN 14F021P00 BMC hwmon");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:menf21bmc_hwmon");
-- 
2.0.4


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply related	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 4/4] drivers/hwmon/menf21bmc_hwmon: introduce MEN14F021P00 BMC HWMON driver
  2014-08-27 17:53   ` Andreas Werner
@ 2014-08-27 18:38     ` Guenter Roeck
  -1 siblings, 0 replies; 71+ messages in thread
From: Guenter Roeck @ 2014-08-27 18:38 UTC (permalink / raw)
  To: Andreas Werner
  Cc: linux-kernel, sameo, lee.jones, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

On Wed, Aug 27, 2014 at 07:53:06PM +0200, Andreas Werner wrote:
> Added driver to support the 14F021P00 BMC Hardware Monitoring.
> The BMC is a Board Management Controller including monitoring of the
> board voltages.
> 
> Signed-off-by: Andreas Werner <andreas.werner@men.de>

Looks good, though I do have one comment ...

> +
> +	hwmon_dev = devm_hwmon_device_register_with_groups(&pdev->dev,
> +						   "menf21bmc", drv_data,
> +						   menf21bmc_hwmon_groups);
> +	if (IS_ERR(hwmon_dev))
> +		return PTR_ERR(hwmon_dev);
> +
> +	dev_info(&pdev->dev, "MEN 14F021P00 BMC hwmon device enabled");
> +
You removed the dev_info from the mfd driver but left it in the client
drivers.  If you'd drop it here as well, you could use
'return PTR_ERR_OR_ZERO(hwmon_dev);'.  Just a suggestion, not mandatory.

Either case,

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

I assume this will go in through the mfd tree.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [lm-sensors] [PATCH v6 4/4] drivers/hwmon/menf21bmc_hwmon: introduce MEN14F021P00 BMC HWMON driv
@ 2014-08-27 18:38     ` Guenter Roeck
  0 siblings, 0 replies; 71+ messages in thread
From: Guenter Roeck @ 2014-08-27 18:38 UTC (permalink / raw)
  To: Andreas Werner
  Cc: linux-kernel, sameo, lee.jones, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

On Wed, Aug 27, 2014 at 07:53:06PM +0200, Andreas Werner wrote:
> Added driver to support the 14F021P00 BMC Hardware Monitoring.
> The BMC is a Board Management Controller including monitoring of the
> board voltages.
> 
> Signed-off-by: Andreas Werner <andreas.werner@men.de>

Looks good, though I do have one comment ...

> +
> +	hwmon_dev = devm_hwmon_device_register_with_groups(&pdev->dev,
> +						   "menf21bmc", drv_data,
> +						   menf21bmc_hwmon_groups);
> +	if (IS_ERR(hwmon_dev))
> +		return PTR_ERR(hwmon_dev);
> +
> +	dev_info(&pdev->dev, "MEN 14F021P00 BMC hwmon device enabled");
> +
You removed the dev_info from the mfd driver but left it in the client
drivers.  If you'd drop it here as well, you could use
'return PTR_ERR_OR_ZERO(hwmon_dev);'.  Just a suggestion, not mandatory.

Either case,

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

I assume this will go in through the mfd tree.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 1/4] drivers/mfd/menf21bmc: introduce MEN 14F021P00 BMC MFD Core driver
  2014-08-27 17:51   ` Andreas Werner
  (?)
@ 2014-08-28  7:37     ` Lee Jones
  -1 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-08-28  7:37 UTC (permalink / raw)
  To: Andreas Werner
  Cc: linux-kernel, sameo, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

On Wed, 27 Aug 2014, Andreas Werner wrote:

> The MEN 14F021P00 Board Management Controller provides an
> I2C interface to the host to access the feature implemented in the BMC.
> The BMC is a PIC Microntroller assembled on CPCI Card from MEN Mikroelektronik
> and on a few Box/Display Computer.
> 
> Added MFD Core driver, supporting the I2C communication to the device.
> 
> The MFD driver currently supports the following features:
>  	- Watchdog
>  	- LEDs
> 	- Hwmon (voltage monitoring)
> 
> Signed-off-by: Andreas Werner <andreas.werner@men.de>
> ---
>  drivers/mfd/Kconfig     |  15 ++++++
>  drivers/mfd/Makefile    |   1 +
>  drivers/mfd/menf21bmc.c | 132 ++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 148 insertions(+)
>  create mode 100644 drivers/mfd/menf21bmc.c

I'd like to take this set through the MFD tree, but for now:

Acked-by: Lee Jones <lee.jones@linaro.org>

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 1/4] drivers/mfd/menf21bmc: introduce MEN 14F021P00 BMC MFD Core driver
@ 2014-08-28  7:37     ` Lee Jones
  0 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-08-28  7:37 UTC (permalink / raw)
  To: Andreas Werner
  Cc: linux-kernel, sameo, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

On Wed, 27 Aug 2014, Andreas Werner wrote:

> The MEN 14F021P00 Board Management Controller provides an
> I2C interface to the host to access the feature implemented in the BMC.
> The BMC is a PIC Microntroller assembled on CPCI Card from MEN Mikroelektronik
> and on a few Box/Display Computer.
> 
> Added MFD Core driver, supporting the I2C communication to the device.
> 
> The MFD driver currently supports the following features:
>  	- Watchdog
>  	- LEDs
> 	- Hwmon (voltage monitoring)
> 
> Signed-off-by: Andreas Werner <andreas.werner@men.de>
> ---
>  drivers/mfd/Kconfig     |  15 ++++++
>  drivers/mfd/Makefile    |   1 +
>  drivers/mfd/menf21bmc.c | 132 ++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 148 insertions(+)
>  create mode 100644 drivers/mfd/menf21bmc.c

I'd like to take this set through the MFD tree, but for now:

Acked-by: Lee Jones <lee.jones@linaro.org>

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [lm-sensors] [PATCH v6 1/4] drivers/mfd/menf21bmc: introduce MEN 14F021P00 BMC MFD Core driver
@ 2014-08-28  7:37     ` Lee Jones
  0 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-08-28  7:37 UTC (permalink / raw)
  To: Andreas Werner
  Cc: linux-kernel, sameo, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

T24gV2VkLCAyNyBBdWcgMjAxNCwgQW5kcmVhcyBXZXJuZXIgd3JvdGU6Cgo+IFRoZSBNRU4gMTRG
MDIxUDAwIEJvYXJkIE1hbmFnZW1lbnQgQ29udHJvbGxlciBwcm92aWRlcyBhbgo+IEkyQyBpbnRl
cmZhY2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SBKb25lcwpMaW5hcm8gU1RNaWNyb2VsZWN0cm9uaWNzIExhbmRpbmcgVGVhbSBMZWFkCkxpbmFy
by5vcmcg4pSCIE9wZW4gc291cmNlIHNvZnR3YXJlIGZvciBBUk0gU29DcwpGb2xsb3cgTGluYXJv
OiBGYWNlYm9vayB8IFR3aXR0ZXIgfCBCbG9nCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fXwpsbS1zZW5zb3JzIG1haWxpbmcgbGlzdApsbS1zZW5zb3JzQGxt
LXNlbnNvcnMub3JnCmh0dHA6Ly9saXN0cy5sbS1zZW5zb3JzLm9yZy9tYWlsbWFuL2xpc3RpbmZv
L2xtLXNlbnNvcnM

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 4/4] drivers/hwmon/menf21bmc_hwmon: introduce MEN14F021P00 BMC HWMON driver
  2014-08-27 18:38     ` [lm-sensors] [PATCH v6 4/4] drivers/hwmon/menf21bmc_hwmon: introduce MEN14F021P00 BMC HWMON driv Guenter Roeck
  (?)
@ 2014-08-28  8:16       ` Andreas Werner
  -1 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-28  8:16 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Andreas Werner, linux-kernel, sameo, lee.jones, lm-sensors, wim,
	linux-watchdog, cooloney, rpurdie, linux-leds

On Wed, Aug 27, 2014 at 11:38:43AM -0700, Guenter Roeck wrote:
> On Wed, Aug 27, 2014 at 07:53:06PM +0200, Andreas Werner wrote:
> > Added driver to support the 14F021P00 BMC Hardware Monitoring.
> > The BMC is a Board Management Controller including monitoring of the
> > board voltages.
> > 
> > Signed-off-by: Andreas Werner <andreas.werner@men.de>
> 
> Looks good, though I do have one comment ...
> 
> > +
> > +	hwmon_dev = devm_hwmon_device_register_with_groups(&pdev->dev,
> > +						   "menf21bmc", drv_data,
> > +						   menf21bmc_hwmon_groups);
> > +	if (IS_ERR(hwmon_dev))
> > +		return PTR_ERR(hwmon_dev);
> > +
> > +	dev_info(&pdev->dev, "MEN 14F021P00 BMC hwmon device enabled");
> > +
> You removed the dev_info from the mfd driver but left it in the client
> drivers.  If you'd drop it here as well, you could use
> 'return PTR_ERR_OR_ZERO(hwmon_dev);'.  Just a suggestion, not mandatory.
> 
> Either case,

It is a nice info for every slave driver which are the drivers for accessing
the features in the BMC. The mfd is just the driver who will instantiate the
slaves. For the mfd the most important info is if there was an error.

Anyway good idea with PTR_ERR_OR_ZERO.

Thanks for the nice review and the comments.

Regards
Andy

> 
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> 
> I assume this will go in through the mfd tree.
> 
> Thanks,
> Guenter

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 4/4] drivers/hwmon/menf21bmc_hwmon: introduce MEN14F021P00 BMC HWMON driver
@ 2014-08-28  8:16       ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-28  8:16 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Andreas Werner, linux-kernel, sameo, lee.jones, lm-sensors, wim,
	linux-watchdog, cooloney, rpurdie, linux-leds

On Wed, Aug 27, 2014 at 11:38:43AM -0700, Guenter Roeck wrote:
> On Wed, Aug 27, 2014 at 07:53:06PM +0200, Andreas Werner wrote:
> > Added driver to support the 14F021P00 BMC Hardware Monitoring.
> > The BMC is a Board Management Controller including monitoring of the
> > board voltages.
> > 
> > Signed-off-by: Andreas Werner <andreas.werner@men.de>
> 
> Looks good, though I do have one comment ...
> 
> > +
> > +	hwmon_dev = devm_hwmon_device_register_with_groups(&pdev->dev,
> > +						   "menf21bmc", drv_data,
> > +						   menf21bmc_hwmon_groups);
> > +	if (IS_ERR(hwmon_dev))
> > +		return PTR_ERR(hwmon_dev);
> > +
> > +	dev_info(&pdev->dev, "MEN 14F021P00 BMC hwmon device enabled");
> > +
> You removed the dev_info from the mfd driver but left it in the client
> drivers.  If you'd drop it here as well, you could use
> 'return PTR_ERR_OR_ZERO(hwmon_dev);'.  Just a suggestion, not mandatory.
> 
> Either case,

It is a nice info for every slave driver which are the drivers for accessing
the features in the BMC. The mfd is just the driver who will instantiate the
slaves. For the mfd the most important info is if there was an error.

Anyway good idea with PTR_ERR_OR_ZERO.

Thanks for the nice review and the comments.

Regards
Andy

> 
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> 
> I assume this will go in through the mfd tree.
> 
> Thanks,
> Guenter

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [lm-sensors] [PATCH v6 4/4] drivers/hwmon/menf21bmc_hwmon: introduce MEN14F021P00 BMC HWMON driv
@ 2014-08-28  8:16       ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-28  8:16 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Andreas Werner, linux-kernel, sameo, lee.jones, lm-sensors, wim,
	linux-watchdog, cooloney, rpurdie, linux-leds

On Wed, Aug 27, 2014 at 11:38:43AM -0700, Guenter Roeck wrote:
> On Wed, Aug 27, 2014 at 07:53:06PM +0200, Andreas Werner wrote:
> > Added driver to support the 14F021P00 BMC Hardware Monitoring.
> > The BMC is a Board Management Controller including monitoring of the
> > board voltages.
> > 
> > Signed-off-by: Andreas Werner <andreas.werner@men.de>
> 
> Looks good, though I do have one comment ...
> 
> > +
> > +	hwmon_dev = devm_hwmon_device_register_with_groups(&pdev->dev,
> > +						   "menf21bmc", drv_data,
> > +						   menf21bmc_hwmon_groups);
> > +	if (IS_ERR(hwmon_dev))
> > +		return PTR_ERR(hwmon_dev);
> > +
> > +	dev_info(&pdev->dev, "MEN 14F021P00 BMC hwmon device enabled");
> > +
> You removed the dev_info from the mfd driver but left it in the client
> drivers.  If you'd drop it here as well, you could use
> 'return PTR_ERR_OR_ZERO(hwmon_dev);'.  Just a suggestion, not mandatory.
> 
> Either case,

It is a nice info for every slave driver which are the drivers for accessing
the features in the BMC. The mfd is just the driver who will instantiate the
slaves. For the mfd the most important info is if there was an error.

Anyway good idea with PTR_ERR_OR_ZERO.

Thanks for the nice review and the comments.

Regards
Andy

> 
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> 
> I assume this will go in through the mfd tree.
> 
> Thanks,
> Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 3/4] drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver
  2014-08-27 17:52   ` Andreas Werner
@ 2014-08-28 17:54     ` Bryan Wu
  -1 siblings, 0 replies; 71+ messages in thread
From: Bryan Wu @ 2014-08-28 17:54 UTC (permalink / raw)
  To: Andreas Werner
  Cc: lkml, Samuel Ortiz, Lee Jones, linux, lm-sensors, wim,
	linux-watchdog, rpurdie, Linux LED Subsystem

On Wed, Aug 27, 2014 at 10:52 AM, Andreas Werner <andreas.werner@men.de> wrote:
> Added driver to support the 14F021P00 BMC LEDs.
> The BMC is a Board Management Controller including four LEDs which
> can be switched on and off.
>

Please go ahead with my Ack
Acked-by: Bryan Wu <cooloney@gmail.com>

Lee, will you merge this through your tree? I think we do that in one
shot is better.

Thanks,
-Bryan

> Signed-off-by: Andreas Werner <andreas.werner@men.de>
> ---
>  drivers/leds/Kconfig          |   9 +++
>  drivers/leds/Makefile         |   1 +
>  drivers/leds/leds-menf21bmc.c | 131 ++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 141 insertions(+)
>  create mode 100644 drivers/leds/leds-menf21bmc.c
>
> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> index 27cf0cd..ec03457 100644
> --- a/drivers/leds/Kconfig
> +++ b/drivers/leds/Kconfig
> @@ -458,6 +458,15 @@ config LEDS_OT200
>           This option enables support for the LEDs on the Bachmann OT200.
>           Say Y to enable LEDs on the Bachmann OT200.
>
> +config LEDS_MENF21BMC
> +       tristate "LED support for the MEN 14F021P00 BMC"
> +       depends on LEDS_CLASS && MFD_MENF21BMC
> +       help
> +         Say Y here to include support for the MEN 14F021P00 BMC LEDs.
> +
> +         This driver can also be built as a module. If so the module
> +         will be called leds-menf21bmc.
> +
>  comment "LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)"
>
>  config LEDS_BLINKM
> diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
> index 3c03666..cadc433 100644
> --- a/drivers/leds/Makefile
> +++ b/drivers/leds/Makefile
> @@ -53,6 +53,7 @@ obj-$(CONFIG_LEDS_MAX8997)            += leds-max8997.o
>  obj-$(CONFIG_LEDS_LM355x)              += leds-lm355x.o
>  obj-$(CONFIG_LEDS_BLINKM)              += leds-blinkm.o
>  obj-$(CONFIG_LEDS_VERSATILE)           += leds-versatile.o
> +obj-$(CONFIG_LEDS_MENF21BMC)           += leds-menf21bmc.o
>
>  # LED SPI Drivers
>  obj-$(CONFIG_LEDS_DAC124S085)          += leds-dac124s085.o
> diff --git a/drivers/leds/leds-menf21bmc.c b/drivers/leds/leds-menf21bmc.c
> new file mode 100644
> index 0000000..89dd577
> --- /dev/null
> +++ b/drivers/leds/leds-menf21bmc.c
> @@ -0,0 +1,131 @@
> +/*
> + *  MEN 14F021P00 Board Management Controller (BMC) LEDs Driver.
> + *
> + *  This is the core LED driver of the MEN 14F021P00 BMC.
> + *  There are four LEDs available which can be switched on and off.
> + *  STATUS LED, HOT SWAP LED, USER LED 1, USER LED 2
> + *
> + *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
> + *
> + *  This program is free software; you can redistribute  it and/or modify it
> + *  under  the terms of  the GNU General  Public License as published by the
> + *  Free Software Foundation;  either version 2 of the  License, or (at your
> + *  option) any later version.
> + */
> +
> +#include <linux/module.h>
> +#include <linux/kernel.h>
> +#include <linux/platform_device.h>
> +#include <linux/leds.h>
> +#include <linux/i2c.h>
> +
> +#define BMC_CMD_LED_GET_SET    0xA0
> +#define BMC_BIT_LED_STATUS     BIT(0)
> +#define BMC_BIT_LED_HOTSWAP    BIT(1)
> +#define BMC_BIT_LED_USER1      BIT(2)
> +#define BMC_BIT_LED_USER2      BIT(3)
> +
> +struct menf21bmc_led {
> +       struct led_classdev cdev;
> +       u8 led_bit;
> +       const char *name;
> +       struct i2c_client *i2c_client;
> +};
> +
> +static struct menf21bmc_led leds[] = {
> +       {
> +               .name = "menf21bmc:led_status",
> +               .led_bit = BMC_BIT_LED_STATUS,
> +       },
> +       {
> +               .name = "menf21bmc:led_hotswap",
> +               .led_bit = BMC_BIT_LED_HOTSWAP,
> +       },
> +       {
> +               .name = "menf21bmc:led_user1",
> +               .led_bit = BMC_BIT_LED_USER1,
> +       },
> +       {
> +               .name = "menf21bmc:led_user2",
> +               .led_bit = BMC_BIT_LED_USER2,
> +       }
> +};
> +
> +static DEFINE_MUTEX(led_lock);
> +
> +static void
> +menf21bmc_led_set(struct led_classdev *led_cdev, enum led_brightness value)
> +{
> +       int led_val;
> +       struct menf21bmc_led *led = container_of(led_cdev,
> +                                       struct menf21bmc_led, cdev);
> +
> +       mutex_lock(&led_lock);
> +       led_val = i2c_smbus_read_byte_data(led->i2c_client,
> +                                          BMC_CMD_LED_GET_SET);
> +       if (led_val < 0)
> +               goto err_out;
> +
> +       if (value == LED_OFF)
> +               led_val &= ~led->led_bit;
> +       else
> +               led_val |= led->led_bit;
> +
> +       i2c_smbus_write_byte_data(led->i2c_client,
> +                                 BMC_CMD_LED_GET_SET, led_val);
> +err_out:
> +       mutex_unlock(&led_lock);
> +}
> +
> +static int menf21bmc_led_probe(struct platform_device *pdev)
> +{
> +       int i;
> +       int ret;
> +       struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
> +
> +       for (i = 0; i < ARRAY_SIZE(leds); i++) {
> +               leds[i].cdev.name = leds[i].name;
> +               leds[i].cdev.brightness_set = menf21bmc_led_set;
> +               leds[i].i2c_client = i2c_client;
> +               ret = led_classdev_register(&pdev->dev, &leds[i].cdev);
> +               if (ret < 0)
> +                       goto err_free_leds;
> +       }
> +       dev_info(&pdev->dev, "MEN 140F21P00 BMC LED device enabled\n");
> +
> +       return 0;
> +
> +err_free_leds:
> +       dev_err(&pdev->dev, "failed to register LED device\n");
> +
> +       for (i = i - 1; i >= 0; i--)
> +               led_classdev_unregister(&leds[i].cdev);
> +
> +       return ret;
> +}
> +
> +static int menf21bmc_led_remove(struct platform_device *pdev)
> +{
> +       int i;
> +
> +       for (i = 0; i < ARRAY_SIZE(leds); i++)
> +               led_classdev_unregister(&leds[i].cdev);
> +
> +       return 0;
> +}
> +
> +static struct platform_driver menf21bmc_led = {
> +       .probe          = menf21bmc_led_probe,
> +       .remove         = menf21bmc_led_remove,
> +       .driver         = {
> +               .name           = "menf21bmc_led",
> +               .owner          = THIS_MODULE,
> +       },
> +};
> +
> +module_platform_driver(menf21bmc_led);
> +
> +MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
> +MODULE_DESCRIPTION("MEN 14F021P00 BMC led driver");
> +MODULE_LICENSE("GPL v2");
> +MODULE_ALIAS("platform:menf21bmc_led");
> --
> 2.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-leds" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [lm-sensors] [PATCH v6 3/4] drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver
@ 2014-08-28 17:54     ` Bryan Wu
  0 siblings, 0 replies; 71+ messages in thread
From: Bryan Wu @ 2014-08-28 17:54 UTC (permalink / raw)
  To: Andreas Werner
  Cc: lkml, Samuel Ortiz, Lee Jones, linux, lm-sensors, wim,
	linux-watchdog, rpurdie, Linux LED Subsystem

On Wed, Aug 27, 2014 at 10:52 AM, Andreas Werner <andreas.werner@men.de> wrote:
> Added driver to support the 14F021P00 BMC LEDs.
> The BMC is a Board Management Controller including four LEDs which
> can be switched on and off.
>

Please go ahead with my Ack
Acked-by: Bryan Wu <cooloney@gmail.com>

Lee, will you merge this through your tree? I think we do that in one
shot is better.

Thanks,
-Bryan

> Signed-off-by: Andreas Werner <andreas.werner@men.de>
> ---
>  drivers/leds/Kconfig          |   9 +++
>  drivers/leds/Makefile         |   1 +
>  drivers/leds/leds-menf21bmc.c | 131 ++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 141 insertions(+)
>  create mode 100644 drivers/leds/leds-menf21bmc.c
>
> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> index 27cf0cd..ec03457 100644
> --- a/drivers/leds/Kconfig
> +++ b/drivers/leds/Kconfig
> @@ -458,6 +458,15 @@ config LEDS_OT200
>           This option enables support for the LEDs on the Bachmann OT200.
>           Say Y to enable LEDs on the Bachmann OT200.
>
> +config LEDS_MENF21BMC
> +       tristate "LED support for the MEN 14F021P00 BMC"
> +       depends on LEDS_CLASS && MFD_MENF21BMC
> +       help
> +         Say Y here to include support for the MEN 14F021P00 BMC LEDs.
> +
> +         This driver can also be built as a module. If so the module
> +         will be called leds-menf21bmc.
> +
>  comment "LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)"
>
>  config LEDS_BLINKM
> diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
> index 3c03666..cadc433 100644
> --- a/drivers/leds/Makefile
> +++ b/drivers/leds/Makefile
> @@ -53,6 +53,7 @@ obj-$(CONFIG_LEDS_MAX8997)            += leds-max8997.o
>  obj-$(CONFIG_LEDS_LM355x)              += leds-lm355x.o
>  obj-$(CONFIG_LEDS_BLINKM)              += leds-blinkm.o
>  obj-$(CONFIG_LEDS_VERSATILE)           += leds-versatile.o
> +obj-$(CONFIG_LEDS_MENF21BMC)           += leds-menf21bmc.o
>
>  # LED SPI Drivers
>  obj-$(CONFIG_LEDS_DAC124S085)          += leds-dac124s085.o
> diff --git a/drivers/leds/leds-menf21bmc.c b/drivers/leds/leds-menf21bmc.c
> new file mode 100644
> index 0000000..89dd577
> --- /dev/null
> +++ b/drivers/leds/leds-menf21bmc.c
> @@ -0,0 +1,131 @@
> +/*
> + *  MEN 14F021P00 Board Management Controller (BMC) LEDs Driver.
> + *
> + *  This is the core LED driver of the MEN 14F021P00 BMC.
> + *  There are four LEDs available which can be switched on and off.
> + *  STATUS LED, HOT SWAP LED, USER LED 1, USER LED 2
> + *
> + *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
> + *
> + *  This program is free software; you can redistribute  it and/or modify it
> + *  under  the terms of  the GNU General  Public License as published by the
> + *  Free Software Foundation;  either version 2 of the  License, or (at your
> + *  option) any later version.
> + */
> +
> +#include <linux/module.h>
> +#include <linux/kernel.h>
> +#include <linux/platform_device.h>
> +#include <linux/leds.h>
> +#include <linux/i2c.h>
> +
> +#define BMC_CMD_LED_GET_SET    0xA0
> +#define BMC_BIT_LED_STATUS     BIT(0)
> +#define BMC_BIT_LED_HOTSWAP    BIT(1)
> +#define BMC_BIT_LED_USER1      BIT(2)
> +#define BMC_BIT_LED_USER2      BIT(3)
> +
> +struct menf21bmc_led {
> +       struct led_classdev cdev;
> +       u8 led_bit;
> +       const char *name;
> +       struct i2c_client *i2c_client;
> +};
> +
> +static struct menf21bmc_led leds[] = {
> +       {
> +               .name = "menf21bmc:led_status",
> +               .led_bit = BMC_BIT_LED_STATUS,
> +       },
> +       {
> +               .name = "menf21bmc:led_hotswap",
> +               .led_bit = BMC_BIT_LED_HOTSWAP,
> +       },
> +       {
> +               .name = "menf21bmc:led_user1",
> +               .led_bit = BMC_BIT_LED_USER1,
> +       },
> +       {
> +               .name = "menf21bmc:led_user2",
> +               .led_bit = BMC_BIT_LED_USER2,
> +       }
> +};
> +
> +static DEFINE_MUTEX(led_lock);
> +
> +static void
> +menf21bmc_led_set(struct led_classdev *led_cdev, enum led_brightness value)
> +{
> +       int led_val;
> +       struct menf21bmc_led *led = container_of(led_cdev,
> +                                       struct menf21bmc_led, cdev);
> +
> +       mutex_lock(&led_lock);
> +       led_val = i2c_smbus_read_byte_data(led->i2c_client,
> +                                          BMC_CMD_LED_GET_SET);
> +       if (led_val < 0)
> +               goto err_out;
> +
> +       if (value = LED_OFF)
> +               led_val &= ~led->led_bit;
> +       else
> +               led_val |= led->led_bit;
> +
> +       i2c_smbus_write_byte_data(led->i2c_client,
> +                                 BMC_CMD_LED_GET_SET, led_val);
> +err_out:
> +       mutex_unlock(&led_lock);
> +}
> +
> +static int menf21bmc_led_probe(struct platform_device *pdev)
> +{
> +       int i;
> +       int ret;
> +       struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
> +
> +       for (i = 0; i < ARRAY_SIZE(leds); i++) {
> +               leds[i].cdev.name = leds[i].name;
> +               leds[i].cdev.brightness_set = menf21bmc_led_set;
> +               leds[i].i2c_client = i2c_client;
> +               ret = led_classdev_register(&pdev->dev, &leds[i].cdev);
> +               if (ret < 0)
> +                       goto err_free_leds;
> +       }
> +       dev_info(&pdev->dev, "MEN 140F21P00 BMC LED device enabled\n");
> +
> +       return 0;
> +
> +err_free_leds:
> +       dev_err(&pdev->dev, "failed to register LED device\n");
> +
> +       for (i = i - 1; i >= 0; i--)
> +               led_classdev_unregister(&leds[i].cdev);
> +
> +       return ret;
> +}
> +
> +static int menf21bmc_led_remove(struct platform_device *pdev)
> +{
> +       int i;
> +
> +       for (i = 0; i < ARRAY_SIZE(leds); i++)
> +               led_classdev_unregister(&leds[i].cdev);
> +
> +       return 0;
> +}
> +
> +static struct platform_driver menf21bmc_led = {
> +       .probe          = menf21bmc_led_probe,
> +       .remove         = menf21bmc_led_remove,
> +       .driver         = {
> +               .name           = "menf21bmc_led",
> +               .owner          = THIS_MODULE,
> +       },
> +};
> +
> +module_platform_driver(menf21bmc_led);
> +
> +MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
> +MODULE_DESCRIPTION("MEN 14F021P00 BMC led driver");
> +MODULE_LICENSE("GPL v2");
> +MODULE_ALIAS("platform:menf21bmc_led");
> --
> 2.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-leds" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 3/4] drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver
  2014-08-28 17:54     ` [lm-sensors] " Bryan Wu
  (?)
@ 2014-08-29  6:59       ` Lee Jones
  -1 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-08-29  6:59 UTC (permalink / raw)
  To: Bryan Wu
  Cc: Andreas Werner, lkml, Samuel Ortiz, linux, lm-sensors, wim,
	linux-watchdog, rpurdie, Linux LED Subsystem

On Thu, 28 Aug 2014, Bryan Wu wrote:

> On Wed, Aug 27, 2014 at 10:52 AM, Andreas Werner <andreas.werner@men.de> wrote:
> > Added driver to support the 14F021P00 BMC LEDs.
> > The BMC is a Board Management Controller including four LEDs which
> > can be switched on and off.
> >
> 
> Please go ahead with my Ack
> Acked-by: Bryan Wu <cooloney@gmail.com>
> 
> Lee, will you merge this through your tree? I think we do that in one
> shot is better.

Yes, that's fine.  Pull-request to follow.

> > Signed-off-by: Andreas Werner <andreas.werner@men.de>
> > ---
> >  drivers/leds/Kconfig          |   9 +++
> >  drivers/leds/Makefile         |   1 +
> >  drivers/leds/leds-menf21bmc.c | 131 ++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 141 insertions(+)
> >  create mode 100644 drivers/leds/leds-menf21bmc.c
> >
> > diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> > index 27cf0cd..ec03457 100644
> > --- a/drivers/leds/Kconfig
> > +++ b/drivers/leds/Kconfig
> > @@ -458,6 +458,15 @@ config LEDS_OT200
> >           This option enables support for the LEDs on the Bachmann OT200.
> >           Say Y to enable LEDs on the Bachmann OT200.
> >
> > +config LEDS_MENF21BMC
> > +       tristate "LED support for the MEN 14F021P00 BMC"
> > +       depends on LEDS_CLASS && MFD_MENF21BMC
> > +       help
> > +         Say Y here to include support for the MEN 14F021P00 BMC LEDs.
> > +
> > +         This driver can also be built as a module. If so the module
> > +         will be called leds-menf21bmc.
> > +
> >  comment "LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)"
> >
> >  config LEDS_BLINKM
> > diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
> > index 3c03666..cadc433 100644
> > --- a/drivers/leds/Makefile
> > +++ b/drivers/leds/Makefile
> > @@ -53,6 +53,7 @@ obj-$(CONFIG_LEDS_MAX8997)            += leds-max8997.o
> >  obj-$(CONFIG_LEDS_LM355x)              += leds-lm355x.o
> >  obj-$(CONFIG_LEDS_BLINKM)              += leds-blinkm.o
> >  obj-$(CONFIG_LEDS_VERSATILE)           += leds-versatile.o
> > +obj-$(CONFIG_LEDS_MENF21BMC)           += leds-menf21bmc.o
> >
> >  # LED SPI Drivers
> >  obj-$(CONFIG_LEDS_DAC124S085)          += leds-dac124s085.o
> > diff --git a/drivers/leds/leds-menf21bmc.c b/drivers/leds/leds-menf21bmc.c
> > new file mode 100644
> > index 0000000..89dd577
> > --- /dev/null
> > +++ b/drivers/leds/leds-menf21bmc.c
> > @@ -0,0 +1,131 @@
> > +/*
> > + *  MEN 14F021P00 Board Management Controller (BMC) LEDs Driver.
> > + *
> > + *  This is the core LED driver of the MEN 14F021P00 BMC.
> > + *  There are four LEDs available which can be switched on and off.
> > + *  STATUS LED, HOT SWAP LED, USER LED 1, USER LED 2
> > + *
> > + *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
> > + *
> > + *  This program is free software; you can redistribute  it and/or modify it
> > + *  under  the terms of  the GNU General  Public License as published by the
> > + *  Free Software Foundation;  either version 2 of the  License, or (at your
> > + *  option) any later version.
> > + */
> > +
> > +#include <linux/module.h>
> > +#include <linux/kernel.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/leds.h>
> > +#include <linux/i2c.h>
> > +
> > +#define BMC_CMD_LED_GET_SET    0xA0
> > +#define BMC_BIT_LED_STATUS     BIT(0)
> > +#define BMC_BIT_LED_HOTSWAP    BIT(1)
> > +#define BMC_BIT_LED_USER1      BIT(2)
> > +#define BMC_BIT_LED_USER2      BIT(3)
> > +
> > +struct menf21bmc_led {
> > +       struct led_classdev cdev;
> > +       u8 led_bit;
> > +       const char *name;
> > +       struct i2c_client *i2c_client;
> > +};
> > +
> > +static struct menf21bmc_led leds[] = {
> > +       {
> > +               .name = "menf21bmc:led_status",
> > +               .led_bit = BMC_BIT_LED_STATUS,
> > +       },
> > +       {
> > +               .name = "menf21bmc:led_hotswap",
> > +               .led_bit = BMC_BIT_LED_HOTSWAP,
> > +       },
> > +       {
> > +               .name = "menf21bmc:led_user1",
> > +               .led_bit = BMC_BIT_LED_USER1,
> > +       },
> > +       {
> > +               .name = "menf21bmc:led_user2",
> > +               .led_bit = BMC_BIT_LED_USER2,
> > +       }
> > +};
> > +
> > +static DEFINE_MUTEX(led_lock);
> > +
> > +static void
> > +menf21bmc_led_set(struct led_classdev *led_cdev, enum led_brightness value)
> > +{
> > +       int led_val;
> > +       struct menf21bmc_led *led = container_of(led_cdev,
> > +                                       struct menf21bmc_led, cdev);
> > +
> > +       mutex_lock(&led_lock);
> > +       led_val = i2c_smbus_read_byte_data(led->i2c_client,
> > +                                          BMC_CMD_LED_GET_SET);
> > +       if (led_val < 0)
> > +               goto err_out;
> > +
> > +       if (value == LED_OFF)
> > +               led_val &= ~led->led_bit;
> > +       else
> > +               led_val |= led->led_bit;
> > +
> > +       i2c_smbus_write_byte_data(led->i2c_client,
> > +                                 BMC_CMD_LED_GET_SET, led_val);
> > +err_out:
> > +       mutex_unlock(&led_lock);
> > +}
> > +
> > +static int menf21bmc_led_probe(struct platform_device *pdev)
> > +{
> > +       int i;
> > +       int ret;
> > +       struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
> > +
> > +       for (i = 0; i < ARRAY_SIZE(leds); i++) {
> > +               leds[i].cdev.name = leds[i].name;
> > +               leds[i].cdev.brightness_set = menf21bmc_led_set;
> > +               leds[i].i2c_client = i2c_client;
> > +               ret = led_classdev_register(&pdev->dev, &leds[i].cdev);
> > +               if (ret < 0)
> > +                       goto err_free_leds;
> > +       }
> > +       dev_info(&pdev->dev, "MEN 140F21P00 BMC LED device enabled\n");
> > +
> > +       return 0;
> > +
> > +err_free_leds:
> > +       dev_err(&pdev->dev, "failed to register LED device\n");
> > +
> > +       for (i = i - 1; i >= 0; i--)
> > +               led_classdev_unregister(&leds[i].cdev);
> > +
> > +       return ret;
> > +}
> > +
> > +static int menf21bmc_led_remove(struct platform_device *pdev)
> > +{
> > +       int i;
> > +
> > +       for (i = 0; i < ARRAY_SIZE(leds); i++)
> > +               led_classdev_unregister(&leds[i].cdev);
> > +
> > +       return 0;
> > +}
> > +
> > +static struct platform_driver menf21bmc_led = {
> > +       .probe          = menf21bmc_led_probe,
> > +       .remove         = menf21bmc_led_remove,
> > +       .driver         = {
> > +               .name           = "menf21bmc_led",
> > +               .owner          = THIS_MODULE,
> > +       },
> > +};
> > +
> > +module_platform_driver(menf21bmc_led);
> > +
> > +MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
> > +MODULE_DESCRIPTION("MEN 14F021P00 BMC led driver");
> > +MODULE_LICENSE("GPL v2");
> > +MODULE_ALIAS("platform:menf21bmc_led");
> >

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 3/4] drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver
@ 2014-08-29  6:59       ` Lee Jones
  0 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-08-29  6:59 UTC (permalink / raw)
  To: Bryan Wu
  Cc: Andreas Werner, lkml, Samuel Ortiz, linux, lm-sensors, wim,
	linux-watchdog, rpurdie, Linux LED Subsystem

On Thu, 28 Aug 2014, Bryan Wu wrote:

> On Wed, Aug 27, 2014 at 10:52 AM, Andreas Werner <andreas.werner@men.de> wrote:
> > Added driver to support the 14F021P00 BMC LEDs.
> > The BMC is a Board Management Controller including four LEDs which
> > can be switched on and off.
> >
> 
> Please go ahead with my Ack
> Acked-by: Bryan Wu <cooloney@gmail.com>
> 
> Lee, will you merge this through your tree? I think we do that in one
> shot is better.

Yes, that's fine.  Pull-request to follow.

> > Signed-off-by: Andreas Werner <andreas.werner@men.de>
> > ---
> >  drivers/leds/Kconfig          |   9 +++
> >  drivers/leds/Makefile         |   1 +
> >  drivers/leds/leds-menf21bmc.c | 131 ++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 141 insertions(+)
> >  create mode 100644 drivers/leds/leds-menf21bmc.c
> >
> > diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> > index 27cf0cd..ec03457 100644
> > --- a/drivers/leds/Kconfig
> > +++ b/drivers/leds/Kconfig
> > @@ -458,6 +458,15 @@ config LEDS_OT200
> >           This option enables support for the LEDs on the Bachmann OT200.
> >           Say Y to enable LEDs on the Bachmann OT200.
> >
> > +config LEDS_MENF21BMC
> > +       tristate "LED support for the MEN 14F021P00 BMC"
> > +       depends on LEDS_CLASS && MFD_MENF21BMC
> > +       help
> > +         Say Y here to include support for the MEN 14F021P00 BMC LEDs.
> > +
> > +         This driver can also be built as a module. If so the module
> > +         will be called leds-menf21bmc.
> > +
> >  comment "LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)"
> >
> >  config LEDS_BLINKM
> > diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
> > index 3c03666..cadc433 100644
> > --- a/drivers/leds/Makefile
> > +++ b/drivers/leds/Makefile
> > @@ -53,6 +53,7 @@ obj-$(CONFIG_LEDS_MAX8997)            += leds-max8997.o
> >  obj-$(CONFIG_LEDS_LM355x)              += leds-lm355x.o
> >  obj-$(CONFIG_LEDS_BLINKM)              += leds-blinkm.o
> >  obj-$(CONFIG_LEDS_VERSATILE)           += leds-versatile.o
> > +obj-$(CONFIG_LEDS_MENF21BMC)           += leds-menf21bmc.o
> >
> >  # LED SPI Drivers
> >  obj-$(CONFIG_LEDS_DAC124S085)          += leds-dac124s085.o
> > diff --git a/drivers/leds/leds-menf21bmc.c b/drivers/leds/leds-menf21bmc.c
> > new file mode 100644
> > index 0000000..89dd577
> > --- /dev/null
> > +++ b/drivers/leds/leds-menf21bmc.c
> > @@ -0,0 +1,131 @@
> > +/*
> > + *  MEN 14F021P00 Board Management Controller (BMC) LEDs Driver.
> > + *
> > + *  This is the core LED driver of the MEN 14F021P00 BMC.
> > + *  There are four LEDs available which can be switched on and off.
> > + *  STATUS LED, HOT SWAP LED, USER LED 1, USER LED 2
> > + *
> > + *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
> > + *
> > + *  This program is free software; you can redistribute  it and/or modify it
> > + *  under  the terms of  the GNU General  Public License as published by the
> > + *  Free Software Foundation;  either version 2 of the  License, or (at your
> > + *  option) any later version.
> > + */
> > +
> > +#include <linux/module.h>
> > +#include <linux/kernel.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/leds.h>
> > +#include <linux/i2c.h>
> > +
> > +#define BMC_CMD_LED_GET_SET    0xA0
> > +#define BMC_BIT_LED_STATUS     BIT(0)
> > +#define BMC_BIT_LED_HOTSWAP    BIT(1)
> > +#define BMC_BIT_LED_USER1      BIT(2)
> > +#define BMC_BIT_LED_USER2      BIT(3)
> > +
> > +struct menf21bmc_led {
> > +       struct led_classdev cdev;
> > +       u8 led_bit;
> > +       const char *name;
> > +       struct i2c_client *i2c_client;
> > +};
> > +
> > +static struct menf21bmc_led leds[] = {
> > +       {
> > +               .name = "menf21bmc:led_status",
> > +               .led_bit = BMC_BIT_LED_STATUS,
> > +       },
> > +       {
> > +               .name = "menf21bmc:led_hotswap",
> > +               .led_bit = BMC_BIT_LED_HOTSWAP,
> > +       },
> > +       {
> > +               .name = "menf21bmc:led_user1",
> > +               .led_bit = BMC_BIT_LED_USER1,
> > +       },
> > +       {
> > +               .name = "menf21bmc:led_user2",
> > +               .led_bit = BMC_BIT_LED_USER2,
> > +       }
> > +};
> > +
> > +static DEFINE_MUTEX(led_lock);
> > +
> > +static void
> > +menf21bmc_led_set(struct led_classdev *led_cdev, enum led_brightness value)
> > +{
> > +       int led_val;
> > +       struct menf21bmc_led *led = container_of(led_cdev,
> > +                                       struct menf21bmc_led, cdev);
> > +
> > +       mutex_lock(&led_lock);
> > +       led_val = i2c_smbus_read_byte_data(led->i2c_client,
> > +                                          BMC_CMD_LED_GET_SET);
> > +       if (led_val < 0)
> > +               goto err_out;
> > +
> > +       if (value == LED_OFF)
> > +               led_val &= ~led->led_bit;
> > +       else
> > +               led_val |= led->led_bit;
> > +
> > +       i2c_smbus_write_byte_data(led->i2c_client,
> > +                                 BMC_CMD_LED_GET_SET, led_val);
> > +err_out:
> > +       mutex_unlock(&led_lock);
> > +}
> > +
> > +static int menf21bmc_led_probe(struct platform_device *pdev)
> > +{
> > +       int i;
> > +       int ret;
> > +       struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
> > +
> > +       for (i = 0; i < ARRAY_SIZE(leds); i++) {
> > +               leds[i].cdev.name = leds[i].name;
> > +               leds[i].cdev.brightness_set = menf21bmc_led_set;
> > +               leds[i].i2c_client = i2c_client;
> > +               ret = led_classdev_register(&pdev->dev, &leds[i].cdev);
> > +               if (ret < 0)
> > +                       goto err_free_leds;
> > +       }
> > +       dev_info(&pdev->dev, "MEN 140F21P00 BMC LED device enabled\n");
> > +
> > +       return 0;
> > +
> > +err_free_leds:
> > +       dev_err(&pdev->dev, "failed to register LED device\n");
> > +
> > +       for (i = i - 1; i >= 0; i--)
> > +               led_classdev_unregister(&leds[i].cdev);
> > +
> > +       return ret;
> > +}
> > +
> > +static int menf21bmc_led_remove(struct platform_device *pdev)
> > +{
> > +       int i;
> > +
> > +       for (i = 0; i < ARRAY_SIZE(leds); i++)
> > +               led_classdev_unregister(&leds[i].cdev);
> > +
> > +       return 0;
> > +}
> > +
> > +static struct platform_driver menf21bmc_led = {
> > +       .probe          = menf21bmc_led_probe,
> > +       .remove         = menf21bmc_led_remove,
> > +       .driver         = {
> > +               .name           = "menf21bmc_led",
> > +               .owner          = THIS_MODULE,
> > +       },
> > +};
> > +
> > +module_platform_driver(menf21bmc_led);
> > +
> > +MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
> > +MODULE_DESCRIPTION("MEN 14F021P00 BMC led driver");
> > +MODULE_LICENSE("GPL v2");
> > +MODULE_ALIAS("platform:menf21bmc_led");
> >

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [lm-sensors] [PATCH v6 3/4] drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver
@ 2014-08-29  6:59       ` Lee Jones
  0 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-08-29  6:59 UTC (permalink / raw)
  To: Bryan Wu
  Cc: Andreas Werner, lkml, Samuel Ortiz, linux, lm-sensors, wim,
	linux-watchdog, rpurdie, Linux LED Subsystem

T24gVGh1LCAyOCBBdWcgMjAxNCwgQnJ5YW4gV3Ugd3JvdGU6Cgo+IE9uIFdlZCwgQXVnIDI3LCAy
MDE0IGF0IDEwOjUyIEFNLCBBbmRyZWFzIFdlcm5lciA8YW5kcmVhcy53ZXJuZXJAbWVuLmRlPiB3
cm90ZToKPiA+IEFkZGVkIGRyaXZlciB0byBzdXBwb3J0IHRoZSAxNEYwMjFQMDAgQk1DIExFRHMu
Cj4gPiBUaGUgQk1DIGlzIGEgQm9hcmQgTWFuYWdlbWVudCBDb250cm9sbGVyIGluY2x1ZGluZyBm
b3VyIExFRHMgd2hpY2gKPiA+IGNhbiBiZSBzd2l0Y2hlZ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hPUigiQW5kcmVh
cyBXZXJuZXIgPGFuZHJlYXMud2VybmVyQG1lbi5kZT4iKTsKPiA+ICtNT0RVTEVfREVTQ1JJUFRJ
T04oIk1FTiAxNEYwMjFQMDAgQk1DIGxlZCBkcml2ZXIiKTsKPiA+ICtNT0RVTEVfTElDRU5TRSgi
R1BMIHYyIik7Cj4gPiArTU9EVUxFX0FMSUFTKCJwbGF0Zm9ybTptZW5mMjFibWNfbGVkIik7Cj4g
PgoKLS0gCkxlZSBKb25lcwpMaW5hcm8gU1RNaWNyb2VsZWN0cm9uaWNzIExhbmRpbmcgVGVhbSBM
ZWFkCkxpbmFyby5vcmcg4pSCIE9wZW4gc291cmNlIHNvZnR3YXJlIGZvciBBUk0gU29DcwpGb2xs
b3cgTGluYXJvOiBGYWNlYm9vayB8IFR3aXR0ZXIgfCBCbG9nCgpfX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fXwpsbS1zZW5zb3JzIG1haWxpbmcgbGlzdApsbS1z
ZW5zb3JzQGxtLXNlbnNvcnMub3JnCmh0dHA6Ly9saXN0cy5sbS1zZW5zb3JzLm9yZy9tYWlsbWFu
L2xpc3RpbmZvL2xtLXNlbnNvcnM

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 3/4] drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver
  2014-08-29 11:38         ` Andreas Werner
@ 2014-08-29 10:59           ` Lee Jones
  -1 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-08-29 10:59 UTC (permalink / raw)
  To: Andreas Werner
  Cc: Bryan Wu, lkml, Samuel Ortiz, linux, lm-sensors, wim,
	linux-watchdog, rpurdie, Linux LED Subsystem

On Fri, 29 Aug 2014, Andreas Werner wrote:

> On Fri, Aug 29, 2014 at 07:59:15AM +0100, Lee Jones wrote:
> > On Thu, 28 Aug 2014, Bryan Wu wrote:
> > 
> > > On Wed, Aug 27, 2014 at 10:52 AM, Andreas Werner <andreas.werner@men.de> wrote:
> > > > Added driver to support the 14F021P00 BMC LEDs.
> > > > The BMC is a Board Management Controller including four LEDs which
> > > > can be switched on and off.
> > > >
> > > 
> > > Please go ahead with my Ack
> > > Acked-by: Bryan Wu <cooloney@gmail.com>
> > > 
> > > Lee, will you merge this through your tree? I think we do that in one
> > > shot is better.
> > 
> > Yes, that's fine.  Pull-request to follow.
> > 
> 
> Thanks to all for review.
> 
> Who of you does the Watchdog part? Is it the part of Wim to Ack the patch
> if everythings is right or Guenther?

Wim looks like the guy:

WATCHDOG DEVICE DRIVERS
M:      Wim Van Sebroeck <wim@iguana.be>
L:      linux-watchdog@vger.kernel.org
W:      http://www.linux-watchdog.org/
T:      git git://www.linux-watchdog.org/linux-watchdog.git
S:      Maintained
F:      Documentation/watchdog/
F:      drivers/watchdog/
F:      include/linux/watchdog.h
F:      include/uapi/linux/watchdog.h

> I ask because if everything is ok all the patches can go in completly that would
> be nice.

That is the plan.

> > > > Signed-off-by: Andreas Werner <andreas.werner@men.de>
> > > > ---
> > > >  drivers/leds/Kconfig          |   9 +++
> > > >  drivers/leds/Makefile         |   1 +
> > > >  drivers/leds/leds-menf21bmc.c | 131 ++++++++++++++++++++++++++++++++++++++++++
> > > >  3 files changed, 141 insertions(+)
> > > >  create mode 100644 drivers/leds/leds-menf21bmc.c
> > > >
> > > > diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> > > > index 27cf0cd..ec03457 100644
> > > > --- a/drivers/leds/Kconfig
> > > > +++ b/drivers/leds/Kconfig
> > > > @@ -458,6 +458,15 @@ config LEDS_OT200
> > > >           This option enables support for the LEDs on the Bachmann OT200.
> > > >           Say Y to enable LEDs on the Bachmann OT200.
> > > >
> > > > +config LEDS_MENF21BMC
> > > > +       tristate "LED support for the MEN 14F021P00 BMC"
> > > > +       depends on LEDS_CLASS && MFD_MENF21BMC
> > > > +       help
> > > > +         Say Y here to include support for the MEN 14F021P00 BMC LEDs.
> > > > +
> > > > +         This driver can also be built as a module. If so the module
> > > > +         will be called leds-menf21bmc.
> > > > +
> > > >  comment "LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)"
> > > >
> > > >  config LEDS_BLINKM
> > > > diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
> > > > index 3c03666..cadc433 100644
> > > > --- a/drivers/leds/Makefile
> > > > +++ b/drivers/leds/Makefile
> > > > @@ -53,6 +53,7 @@ obj-$(CONFIG_LEDS_MAX8997)            += leds-max8997.o
> > > >  obj-$(CONFIG_LEDS_LM355x)              += leds-lm355x.o
> > > >  obj-$(CONFIG_LEDS_BLINKM)              += leds-blinkm.o
> > > >  obj-$(CONFIG_LEDS_VERSATILE)           += leds-versatile.o
> > > > +obj-$(CONFIG_LEDS_MENF21BMC)           += leds-menf21bmc.o
> > > >
> > > >  # LED SPI Drivers
> > > >  obj-$(CONFIG_LEDS_DAC124S085)          += leds-dac124s085.o
> > > > diff --git a/drivers/leds/leds-menf21bmc.c b/drivers/leds/leds-menf21bmc.c
> > > > new file mode 100644
> > > > index 0000000..89dd577
> > > > --- /dev/null
> > > > +++ b/drivers/leds/leds-menf21bmc.c
> > > > @@ -0,0 +1,131 @@
> > > > +/*
> > > > + *  MEN 14F021P00 Board Management Controller (BMC) LEDs Driver.
> > > > + *
> > > > + *  This is the core LED driver of the MEN 14F021P00 BMC.
> > > > + *  There are four LEDs available which can be switched on and off.
> > > > + *  STATUS LED, HOT SWAP LED, USER LED 1, USER LED 2
> > > > + *
> > > > + *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
> > > > + *
> > > > + *  This program is free software; you can redistribute  it and/or modify it
> > > > + *  under  the terms of  the GNU General  Public License as published by the
> > > > + *  Free Software Foundation;  either version 2 of the  License, or (at your
> > > > + *  option) any later version.
> > > > + */
> > > > +
> > > > +#include <linux/module.h>
> > > > +#include <linux/kernel.h>
> > > > +#include <linux/platform_device.h>
> > > > +#include <linux/leds.h>
> > > > +#include <linux/i2c.h>
> > > > +
> > > > +#define BMC_CMD_LED_GET_SET    0xA0
> > > > +#define BMC_BIT_LED_STATUS     BIT(0)
> > > > +#define BMC_BIT_LED_HOTSWAP    BIT(1)
> > > > +#define BMC_BIT_LED_USER1      BIT(2)
> > > > +#define BMC_BIT_LED_USER2      BIT(3)
> > > > +
> > > > +struct menf21bmc_led {
> > > > +       struct led_classdev cdev;
> > > > +       u8 led_bit;
> > > > +       const char *name;
> > > > +       struct i2c_client *i2c_client;
> > > > +};
> > > > +
> > > > +static struct menf21bmc_led leds[] = {
> > > > +       {
> > > > +               .name = "menf21bmc:led_status",
> > > > +               .led_bit = BMC_BIT_LED_STATUS,
> > > > +       },
> > > > +       {
> > > > +               .name = "menf21bmc:led_hotswap",
> > > > +               .led_bit = BMC_BIT_LED_HOTSWAP,
> > > > +       },
> > > > +       {
> > > > +               .name = "menf21bmc:led_user1",
> > > > +               .led_bit = BMC_BIT_LED_USER1,
> > > > +       },
> > > > +       {
> > > > +               .name = "menf21bmc:led_user2",
> > > > +               .led_bit = BMC_BIT_LED_USER2,
> > > > +       }
> > > > +};
> > > > +
> > > > +static DEFINE_MUTEX(led_lock);
> > > > +
> > > > +static void
> > > > +menf21bmc_led_set(struct led_classdev *led_cdev, enum led_brightness value)
> > > > +{
> > > > +       int led_val;
> > > > +       struct menf21bmc_led *led = container_of(led_cdev,
> > > > +                                       struct menf21bmc_led, cdev);
> > > > +
> > > > +       mutex_lock(&led_lock);
> > > > +       led_val = i2c_smbus_read_byte_data(led->i2c_client,
> > > > +                                          BMC_CMD_LED_GET_SET);
> > > > +       if (led_val < 0)
> > > > +               goto err_out;
> > > > +
> > > > +       if (value == LED_OFF)
> > > > +               led_val &= ~led->led_bit;
> > > > +       else
> > > > +               led_val |= led->led_bit;
> > > > +
> > > > +       i2c_smbus_write_byte_data(led->i2c_client,
> > > > +                                 BMC_CMD_LED_GET_SET, led_val);
> > > > +err_out:
> > > > +       mutex_unlock(&led_lock);
> > > > +}
> > > > +
> > > > +static int menf21bmc_led_probe(struct platform_device *pdev)
> > > > +{
> > > > +       int i;
> > > > +       int ret;
> > > > +       struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
> > > > +
> > > > +       for (i = 0; i < ARRAY_SIZE(leds); i++) {
> > > > +               leds[i].cdev.name = leds[i].name;
> > > > +               leds[i].cdev.brightness_set = menf21bmc_led_set;
> > > > +               leds[i].i2c_client = i2c_client;
> > > > +               ret = led_classdev_register(&pdev->dev, &leds[i].cdev);
> > > > +               if (ret < 0)
> > > > +                       goto err_free_leds;
> > > > +       }
> > > > +       dev_info(&pdev->dev, "MEN 140F21P00 BMC LED device enabled\n");
> > > > +
> > > > +       return 0;
> > > > +
> > > > +err_free_leds:
> > > > +       dev_err(&pdev->dev, "failed to register LED device\n");
> > > > +
> > > > +       for (i = i - 1; i >= 0; i--)
> > > > +               led_classdev_unregister(&leds[i].cdev);
> > > > +
> > > > +       return ret;
> > > > +}
> > > > +
> > > > +static int menf21bmc_led_remove(struct platform_device *pdev)
> > > > +{
> > > > +       int i;
> > > > +
> > > > +       for (i = 0; i < ARRAY_SIZE(leds); i++)
> > > > +               led_classdev_unregister(&leds[i].cdev);
> > > > +
> > > > +       return 0;
> > > > +}
> > > > +
> > > > +static struct platform_driver menf21bmc_led = {
> > > > +       .probe          = menf21bmc_led_probe,
> > > > +       .remove         = menf21bmc_led_remove,
> > > > +       .driver         = {
> > > > +               .name           = "menf21bmc_led",
> > > > +               .owner          = THIS_MODULE,
> > > > +       },
> > > > +};
> > > > +
> > > > +module_platform_driver(menf21bmc_led);
> > > > +
> > > > +MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
> > > > +MODULE_DESCRIPTION("MEN 14F021P00 BMC led driver");
> > > > +MODULE_LICENSE("GPL v2");
> > > > +MODULE_ALIAS("platform:menf21bmc_led");
> > > >
> > 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [lm-sensors] [PATCH v6 3/4] drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver
@ 2014-08-29 10:59           ` Lee Jones
  0 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-08-29 10:59 UTC (permalink / raw)
  To: Andreas Werner
  Cc: Bryan Wu, lkml, Samuel Ortiz, linux, lm-sensors, wim,
	linux-watchdog, rpurdie, Linux LED Subsystem

T24gRnJpLCAyOSBBdWcgMjAxNCwgQW5kcmVhcyBXZXJuZXIgd3JvdGU6Cgo+IE9uIEZyaSwgQXVn
IDI5LCAyMDE0IGF0IDA3OjU5OjE1QU0gKzAxMDAsIExlZSBKb25lcyB3cm90ZToKPiA+IE9uIFRo
dSwgMjggQXVnIDIwMTQsIEJyeWFuIFd1IHdyb3RlOgo+ID4gCj4gPiA+IE9uIFdlZCwgQXVnIDI3
LCAyMDE0IGF0IDEwOjUyIEFNLCBBbmRyZWFzIFdlcm5lciA8YW5kcmVhcy53ZXJuZXJAbWVuLmRl
PiB3cm90ZToKPiA+ID4gPiBBZGRlZCBkcml2ZXIgdG8gc3VwcG9ydCB0aGUgMTRGMDIxUDAwIEJN
QyBMRURzLgo+ID4gPiA+IFRoZSBCTUMgaXMgYSBCb2FyZCBNYW5hZ2VtZW50IENvbnRyb2xsZXIg
aW5jbHVkaW5nIGZvdXIgTEVEcyB3aGljaAo+ID4gPiA+IGNhbiBiZSBzd2l0Y2hlZCBvbiBhbmQg
b2ZmLgo+ID4gPiA+Cj4gPiA+IAo+ID4gPiBQbGVhc2UgZ28gYWhlYWQgd2l0aCBteSBBY2sKPiA+
ID4gQWNrZWQtYnk6IEJyeWFuIFd1IDxjb29sb25leUBnbWFpbC5jb20+Cj4gPiA+IAo+ID4gPiBM
ZWUsIHdpbGwgeW91IG1lcmdlIHRoaXMgdGhyb3VnaCB5b3VyIHRyZWU/IEkgdGhpbmsgd2UgZG8g
dGhhdCBpbiBvbmUKPiA+ID4gc2hvdCBpcyBi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19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fXwpsbS1zZW5zb3JzIG1haWxpbmcgbGlzdApsbS1zZW5zb3JzQGxtLXNl
bnNvcnMub3JnCmh0dHA6Ly9saXN0cy5sbS1zZW5zb3JzLm9yZy9tYWlsbWFuL2xpc3RpbmZvL2xt
LXNlbnNvcnM

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 3/4] drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver
  2014-08-29  6:59       ` Lee Jones
  (?)
  (?)
@ 2014-08-29 11:38         ` Andreas Werner
  -1 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-29 11:38 UTC (permalink / raw)
  To: Lee Jones
  Cc: Bryan Wu, Andreas Werner, lkml, Samuel Ortiz, linux, lm-sensors,
	wim, linux-watchdog, rpurdie, Linux LED Subsystem

On Fri, Aug 29, 2014 at 07:59:15AM +0100, Lee Jones wrote:
> On Thu, 28 Aug 2014, Bryan Wu wrote:
> 
> > On Wed, Aug 27, 2014 at 10:52 AM, Andreas Werner <andreas.werner@men.de> wrote:
> > > Added driver to support the 14F021P00 BMC LEDs.
> > > The BMC is a Board Management Controller including four LEDs which
> > > can be switched on and off.
> > >
> > 
> > Please go ahead with my Ack
> > Acked-by: Bryan Wu <cooloney@gmail.com>
> > 
> > Lee, will you merge this through your tree? I think we do that in one
> > shot is better.
> 
> Yes, that's fine.  Pull-request to follow.
> 

Thanks to all for review.

Who of you does the Watchdog part? Is it the part of Wim to Ack the patch
if everythings is right or Guenther?

I ask because if everything is ok all the patches can go in completly that would
be nice.

Regards
Andy

> > > Signed-off-by: Andreas Werner <andreas.werner@men.de>
> > > ---
> > >  drivers/leds/Kconfig          |   9 +++
> > >  drivers/leds/Makefile         |   1 +
> > >  drivers/leds/leds-menf21bmc.c | 131 ++++++++++++++++++++++++++++++++++++++++++
> > >  3 files changed, 141 insertions(+)
> > >  create mode 100644 drivers/leds/leds-menf21bmc.c
> > >
> > > diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> > > index 27cf0cd..ec03457 100644
> > > --- a/drivers/leds/Kconfig
> > > +++ b/drivers/leds/Kconfig
> > > @@ -458,6 +458,15 @@ config LEDS_OT200
> > >           This option enables support for the LEDs on the Bachmann OT200.
> > >           Say Y to enable LEDs on the Bachmann OT200.
> > >
> > > +config LEDS_MENF21BMC
> > > +       tristate "LED support for the MEN 14F021P00 BMC"
> > > +       depends on LEDS_CLASS && MFD_MENF21BMC
> > > +       help
> > > +         Say Y here to include support for the MEN 14F021P00 BMC LEDs.
> > > +
> > > +         This driver can also be built as a module. If so the module
> > > +         will be called leds-menf21bmc.
> > > +
> > >  comment "LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)"
> > >
> > >  config LEDS_BLINKM
> > > diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
> > > index 3c03666..cadc433 100644
> > > --- a/drivers/leds/Makefile
> > > +++ b/drivers/leds/Makefile
> > > @@ -53,6 +53,7 @@ obj-$(CONFIG_LEDS_MAX8997)            += leds-max8997.o
> > >  obj-$(CONFIG_LEDS_LM355x)              += leds-lm355x.o
> > >  obj-$(CONFIG_LEDS_BLINKM)              += leds-blinkm.o
> > >  obj-$(CONFIG_LEDS_VERSATILE)           += leds-versatile.o
> > > +obj-$(CONFIG_LEDS_MENF21BMC)           += leds-menf21bmc.o
> > >
> > >  # LED SPI Drivers
> > >  obj-$(CONFIG_LEDS_DAC124S085)          += leds-dac124s085.o
> > > diff --git a/drivers/leds/leds-menf21bmc.c b/drivers/leds/leds-menf21bmc.c
> > > new file mode 100644
> > > index 0000000..89dd577
> > > --- /dev/null
> > > +++ b/drivers/leds/leds-menf21bmc.c
> > > @@ -0,0 +1,131 @@
> > > +/*
> > > + *  MEN 14F021P00 Board Management Controller (BMC) LEDs Driver.
> > > + *
> > > + *  This is the core LED driver of the MEN 14F021P00 BMC.
> > > + *  There are four LEDs available which can be switched on and off.
> > > + *  STATUS LED, HOT SWAP LED, USER LED 1, USER LED 2
> > > + *
> > > + *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
> > > + *
> > > + *  This program is free software; you can redistribute  it and/or modify it
> > > + *  under  the terms of  the GNU General  Public License as published by the
> > > + *  Free Software Foundation;  either version 2 of the  License, or (at your
> > > + *  option) any later version.
> > > + */
> > > +
> > > +#include <linux/module.h>
> > > +#include <linux/kernel.h>
> > > +#include <linux/platform_device.h>
> > > +#include <linux/leds.h>
> > > +#include <linux/i2c.h>
> > > +
> > > +#define BMC_CMD_LED_GET_SET    0xA0
> > > +#define BMC_BIT_LED_STATUS     BIT(0)
> > > +#define BMC_BIT_LED_HOTSWAP    BIT(1)
> > > +#define BMC_BIT_LED_USER1      BIT(2)
> > > +#define BMC_BIT_LED_USER2      BIT(3)
> > > +
> > > +struct menf21bmc_led {
> > > +       struct led_classdev cdev;
> > > +       u8 led_bit;
> > > +       const char *name;
> > > +       struct i2c_client *i2c_client;
> > > +};
> > > +
> > > +static struct menf21bmc_led leds[] = {
> > > +       {
> > > +               .name = "menf21bmc:led_status",
> > > +               .led_bit = BMC_BIT_LED_STATUS,
> > > +       },
> > > +       {
> > > +               .name = "menf21bmc:led_hotswap",
> > > +               .led_bit = BMC_BIT_LED_HOTSWAP,
> > > +       },
> > > +       {
> > > +               .name = "menf21bmc:led_user1",
> > > +               .led_bit = BMC_BIT_LED_USER1,
> > > +       },
> > > +       {
> > > +               .name = "menf21bmc:led_user2",
> > > +               .led_bit = BMC_BIT_LED_USER2,
> > > +       }
> > > +};
> > > +
> > > +static DEFINE_MUTEX(led_lock);
> > > +
> > > +static void
> > > +menf21bmc_led_set(struct led_classdev *led_cdev, enum led_brightness value)
> > > +{
> > > +       int led_val;
> > > +       struct menf21bmc_led *led = container_of(led_cdev,
> > > +                                       struct menf21bmc_led, cdev);
> > > +
> > > +       mutex_lock(&led_lock);
> > > +       led_val = i2c_smbus_read_byte_data(led->i2c_client,
> > > +                                          BMC_CMD_LED_GET_SET);
> > > +       if (led_val < 0)
> > > +               goto err_out;
> > > +
> > > +       if (value == LED_OFF)
> > > +               led_val &= ~led->led_bit;
> > > +       else
> > > +               led_val |= led->led_bit;
> > > +
> > > +       i2c_smbus_write_byte_data(led->i2c_client,
> > > +                                 BMC_CMD_LED_GET_SET, led_val);
> > > +err_out:
> > > +       mutex_unlock(&led_lock);
> > > +}
> > > +
> > > +static int menf21bmc_led_probe(struct platform_device *pdev)
> > > +{
> > > +       int i;
> > > +       int ret;
> > > +       struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
> > > +
> > > +       for (i = 0; i < ARRAY_SIZE(leds); i++) {
> > > +               leds[i].cdev.name = leds[i].name;
> > > +               leds[i].cdev.brightness_set = menf21bmc_led_set;
> > > +               leds[i].i2c_client = i2c_client;
> > > +               ret = led_classdev_register(&pdev->dev, &leds[i].cdev);
> > > +               if (ret < 0)
> > > +                       goto err_free_leds;
> > > +       }
> > > +       dev_info(&pdev->dev, "MEN 140F21P00 BMC LED device enabled\n");
> > > +
> > > +       return 0;
> > > +
> > > +err_free_leds:
> > > +       dev_err(&pdev->dev, "failed to register LED device\n");
> > > +
> > > +       for (i = i - 1; i >= 0; i--)
> > > +               led_classdev_unregister(&leds[i].cdev);
> > > +
> > > +       return ret;
> > > +}
> > > +
> > > +static int menf21bmc_led_remove(struct platform_device *pdev)
> > > +{
> > > +       int i;
> > > +
> > > +       for (i = 0; i < ARRAY_SIZE(leds); i++)
> > > +               led_classdev_unregister(&leds[i].cdev);
> > > +
> > > +       return 0;
> > > +}
> > > +
> > > +static struct platform_driver menf21bmc_led = {
> > > +       .probe          = menf21bmc_led_probe,
> > > +       .remove         = menf21bmc_led_remove,
> > > +       .driver         = {
> > > +               .name           = "menf21bmc_led",
> > > +               .owner          = THIS_MODULE,
> > > +       },
> > > +};
> > > +
> > > +module_platform_driver(menf21bmc_led);
> > > +
> > > +MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
> > > +MODULE_DESCRIPTION("MEN 14F021P00 BMC led driver");
> > > +MODULE_LICENSE("GPL v2");
> > > +MODULE_ALIAS("platform:menf21bmc_led");
> > >
> 
> -- 
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 3/4] drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver
@ 2014-08-29 11:38         ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-29 11:38 UTC (permalink / raw)
  To: Lee Jones
  Cc: Bryan Wu, Andreas Werner, lkml, Samuel Ortiz, linux, lm-sensors,
	wim, linux-watchdog, rpurdie, Linux LED Subsystem

On Fri, Aug 29, 2014 at 07:59:15AM +0100, Lee Jones wrote:
> On Thu, 28 Aug 2014, Bryan Wu wrote:
> 
> > On Wed, Aug 27, 2014 at 10:52 AM, Andreas Werner <andreas.werner@men.de> wrote:
> > > Added driver to support the 14F021P00 BMC LEDs.
> > > The BMC is a Board Management Controller including four LEDs which
> > > can be switched on and off.
> > >
> > 
> > Please go ahead with my Ack
> > Acked-by: Bryan Wu <cooloney@gmail.com>
> > 
> > Lee, will you merge this through your tree? I think we do that in one
> > shot is better.
> 
> Yes, that's fine.  Pull-request to follow.
> 

Thanks to all for review.

Who of you does the Watchdog part? Is it the part of Wim to Ack the patch
if everythings is right or Guenther?

I ask because if everything is ok all the patches can go in completly that would
be nice.

Regards
Andy

> > > Signed-off-by: Andreas Werner <andreas.werner@men.de>
> > > ---
> > >  drivers/leds/Kconfig          |   9 +++
> > >  drivers/leds/Makefile         |   1 +
> > >  drivers/leds/leds-menf21bmc.c | 131 ++++++++++++++++++++++++++++++++++++++++++
> > >  3 files changed, 141 insertions(+)
> > >  create mode 100644 drivers/leds/leds-menf21bmc.c
> > >
> > > diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> > > index 27cf0cd..ec03457 100644
> > > --- a/drivers/leds/Kconfig
> > > +++ b/drivers/leds/Kconfig
> > > @@ -458,6 +458,15 @@ config LEDS_OT200
> > >           This option enables support for the LEDs on the Bachmann OT200.
> > >           Say Y to enable LEDs on the Bachmann OT200.
> > >
> > > +config LEDS_MENF21BMC
> > > +       tristate "LED support for the MEN 14F021P00 BMC"
> > > +       depends on LEDS_CLASS && MFD_MENF21BMC
> > > +       help
> > > +         Say Y here to include support for the MEN 14F021P00 BMC LEDs.
> > > +
> > > +         This driver can also be built as a module. If so the module
> > > +         will be called leds-menf21bmc.
> > > +
> > >  comment "LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)"
> > >
> > >  config LEDS_BLINKM
> > > diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
> > > index 3c03666..cadc433 100644
> > > --- a/drivers/leds/Makefile
> > > +++ b/drivers/leds/Makefile
> > > @@ -53,6 +53,7 @@ obj-$(CONFIG_LEDS_MAX8997)            += leds-max8997.o
> > >  obj-$(CONFIG_LEDS_LM355x)              += leds-lm355x.o
> > >  obj-$(CONFIG_LEDS_BLINKM)              += leds-blinkm.o
> > >  obj-$(CONFIG_LEDS_VERSATILE)           += leds-versatile.o
> > > +obj-$(CONFIG_LEDS_MENF21BMC)           += leds-menf21bmc.o
> > >
> > >  # LED SPI Drivers
> > >  obj-$(CONFIG_LEDS_DAC124S085)          += leds-dac124s085.o
> > > diff --git a/drivers/leds/leds-menf21bmc.c b/drivers/leds/leds-menf21bmc.c
> > > new file mode 100644
> > > index 0000000..89dd577
> > > --- /dev/null
> > > +++ b/drivers/leds/leds-menf21bmc.c
> > > @@ -0,0 +1,131 @@
> > > +/*
> > > + *  MEN 14F021P00 Board Management Controller (BMC) LEDs Driver.
> > > + *
> > > + *  This is the core LED driver of the MEN 14F021P00 BMC.
> > > + *  There are four LEDs available which can be switched on and off.
> > > + *  STATUS LED, HOT SWAP LED, USER LED 1, USER LED 2
> > > + *
> > > + *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
> > > + *
> > > + *  This program is free software; you can redistribute  it and/or modify it
> > > + *  under  the terms of  the GNU General  Public License as published by the
> > > + *  Free Software Foundation;  either version 2 of the  License, or (at your
> > > + *  option) any later version.
> > > + */
> > > +
> > > +#include <linux/module.h>
> > > +#include <linux/kernel.h>
> > > +#include <linux/platform_device.h>
> > > +#include <linux/leds.h>
> > > +#include <linux/i2c.h>
> > > +
> > > +#define BMC_CMD_LED_GET_SET    0xA0
> > > +#define BMC_BIT_LED_STATUS     BIT(0)
> > > +#define BMC_BIT_LED_HOTSWAP    BIT(1)
> > > +#define BMC_BIT_LED_USER1      BIT(2)
> > > +#define BMC_BIT_LED_USER2      BIT(3)
> > > +
> > > +struct menf21bmc_led {
> > > +       struct led_classdev cdev;
> > > +       u8 led_bit;
> > > +       const char *name;
> > > +       struct i2c_client *i2c_client;
> > > +};
> > > +
> > > +static struct menf21bmc_led leds[] = {
> > > +       {
> > > +               .name = "menf21bmc:led_status",
> > > +               .led_bit = BMC_BIT_LED_STATUS,
> > > +       },
> > > +       {
> > > +               .name = "menf21bmc:led_hotswap",
> > > +               .led_bit = BMC_BIT_LED_HOTSWAP,
> > > +       },
> > > +       {
> > > +               .name = "menf21bmc:led_user1",
> > > +               .led_bit = BMC_BIT_LED_USER1,
> > > +       },
> > > +       {
> > > +               .name = "menf21bmc:led_user2",
> > > +               .led_bit = BMC_BIT_LED_USER2,
> > > +       }
> > > +};
> > > +
> > > +static DEFINE_MUTEX(led_lock);
> > > +
> > > +static void
> > > +menf21bmc_led_set(struct led_classdev *led_cdev, enum led_brightness value)
> > > +{
> > > +       int led_val;
> > > +       struct menf21bmc_led *led = container_of(led_cdev,
> > > +                                       struct menf21bmc_led, cdev);
> > > +
> > > +       mutex_lock(&led_lock);
> > > +       led_val = i2c_smbus_read_byte_data(led->i2c_client,
> > > +                                          BMC_CMD_LED_GET_SET);
> > > +       if (led_val < 0)
> > > +               goto err_out;
> > > +
> > > +       if (value == LED_OFF)
> > > +               led_val &= ~led->led_bit;
> > > +       else
> > > +               led_val |= led->led_bit;
> > > +
> > > +       i2c_smbus_write_byte_data(led->i2c_client,
> > > +                                 BMC_CMD_LED_GET_SET, led_val);
> > > +err_out:
> > > +       mutex_unlock(&led_lock);
> > > +}
> > > +
> > > +static int menf21bmc_led_probe(struct platform_device *pdev)
> > > +{
> > > +       int i;
> > > +       int ret;
> > > +       struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
> > > +
> > > +       for (i = 0; i < ARRAY_SIZE(leds); i++) {
> > > +               leds[i].cdev.name = leds[i].name;
> > > +               leds[i].cdev.brightness_set = menf21bmc_led_set;
> > > +               leds[i].i2c_client = i2c_client;
> > > +               ret = led_classdev_register(&pdev->dev, &leds[i].cdev);
> > > +               if (ret < 0)
> > > +                       goto err_free_leds;
> > > +       }
> > > +       dev_info(&pdev->dev, "MEN 140F21P00 BMC LED device enabled\n");
> > > +
> > > +       return 0;
> > > +
> > > +err_free_leds:
> > > +       dev_err(&pdev->dev, "failed to register LED device\n");
> > > +
> > > +       for (i = i - 1; i >= 0; i--)
> > > +               led_classdev_unregister(&leds[i].cdev);
> > > +
> > > +       return ret;
> > > +}
> > > +
> > > +static int menf21bmc_led_remove(struct platform_device *pdev)
> > > +{
> > > +       int i;
> > > +
> > > +       for (i = 0; i < ARRAY_SIZE(leds); i++)
> > > +               led_classdev_unregister(&leds[i].cdev);
> > > +
> > > +       return 0;
> > > +}
> > > +
> > > +static struct platform_driver menf21bmc_led = {
> > > +       .probe          = menf21bmc_led_probe,
> > > +       .remove         = menf21bmc_led_remove,
> > > +       .driver         = {
> > > +               .name           = "menf21bmc_led",
> > > +               .owner          = THIS_MODULE,
> > > +       },
> > > +};
> > > +
> > > +module_platform_driver(menf21bmc_led);
> > > +
> > > +MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
> > > +MODULE_DESCRIPTION("MEN 14F021P00 BMC led driver");
> > > +MODULE_LICENSE("GPL v2");
> > > +MODULE_ALIAS("platform:menf21bmc_led");
> > >
> 
> -- 
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 3/4] drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver
@ 2014-08-29 11:38         ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-29 11:38 UTC (permalink / raw)
  To: Lee Jones
  Cc: Bryan Wu, Andreas Werner, lkml, Samuel Ortiz, linux, lm-sensors,
	wim, linux-watchdog, rpurdie, Linux LED Subsystem

On Fri, Aug 29, 2014 at 07:59:15AM +0100, Lee Jones wrote:
> On Thu, 28 Aug 2014, Bryan Wu wrote:
> 
> > On Wed, Aug 27, 2014 at 10:52 AM, Andreas Werner <andreas.werner@men.de> wrote:
> > > Added driver to support the 14F021P00 BMC LEDs.
> > > The BMC is a Board Management Controller including four LEDs which
> > > can be switched on and off.
> > >
> > 
> > Please go ahead with my Ack
> > Acked-by: Bryan Wu <cooloney@gmail.com>
> > 
> > Lee, will you merge this through your tree? I think we do that in one
> > shot is better.
> 
> Yes, that's fine.  Pull-request to follow.
> 

Thanks to all for review.

Who of you does the Watchdog part? Is it the part of Wim to Ack the patch
if everythings is right or Guenther?

I ask because if everything is ok all the patches can go in completly that would
be nice.

Regards
Andy

> > > Signed-off-by: Andreas Werner <andreas.werner@men.de>
> > > ---
> > >  drivers/leds/Kconfig          |   9 +++
> > >  drivers/leds/Makefile         |   1 +
> > >  drivers/leds/leds-menf21bmc.c | 131 ++++++++++++++++++++++++++++++++++++++++++
> > >  3 files changed, 141 insertions(+)
> > >  create mode 100644 drivers/leds/leds-menf21bmc.c
> > >
> > > diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> > > index 27cf0cd..ec03457 100644
> > > --- a/drivers/leds/Kconfig
> > > +++ b/drivers/leds/Kconfig
> > > @@ -458,6 +458,15 @@ config LEDS_OT200
> > >           This option enables support for the LEDs on the Bachmann OT200.
> > >           Say Y to enable LEDs on the Bachmann OT200.
> > >
> > > +config LEDS_MENF21BMC
> > > +       tristate "LED support for the MEN 14F021P00 BMC"
> > > +       depends on LEDS_CLASS && MFD_MENF21BMC
> > > +       help
> > > +         Say Y here to include support for the MEN 14F021P00 BMC LEDs.
> > > +
> > > +         This driver can also be built as a module. If so the module
> > > +         will be called leds-menf21bmc.
> > > +
> > >  comment "LED driver for blink(1) USB RGB LED is under Special HID drivers (HID_THINGM)"
> > >
> > >  config LEDS_BLINKM
> > > diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
> > > index 3c03666..cadc433 100644
> > > --- a/drivers/leds/Makefile
> > > +++ b/drivers/leds/Makefile
> > > @@ -53,6 +53,7 @@ obj-$(CONFIG_LEDS_MAX8997)            += leds-max8997.o
> > >  obj-$(CONFIG_LEDS_LM355x)              += leds-lm355x.o
> > >  obj-$(CONFIG_LEDS_BLINKM)              += leds-blinkm.o
> > >  obj-$(CONFIG_LEDS_VERSATILE)           += leds-versatile.o
> > > +obj-$(CONFIG_LEDS_MENF21BMC)           += leds-menf21bmc.o
> > >
> > >  # LED SPI Drivers
> > >  obj-$(CONFIG_LEDS_DAC124S085)          += leds-dac124s085.o
> > > diff --git a/drivers/leds/leds-menf21bmc.c b/drivers/leds/leds-menf21bmc.c
> > > new file mode 100644
> > > index 0000000..89dd577
> > > --- /dev/null
> > > +++ b/drivers/leds/leds-menf21bmc.c
> > > @@ -0,0 +1,131 @@
> > > +/*
> > > + *  MEN 14F021P00 Board Management Controller (BMC) LEDs Driver.
> > > + *
> > > + *  This is the core LED driver of the MEN 14F021P00 BMC.
> > > + *  There are four LEDs available which can be switched on and off.
> > > + *  STATUS LED, HOT SWAP LED, USER LED 1, USER LED 2
> > > + *
> > > + *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
> > > + *
> > > + *  This program is free software; you can redistribute  it and/or modify it
> > > + *  under  the terms of  the GNU General  Public License as published by the
> > > + *  Free Software Foundation;  either version 2 of the  License, or (at your
> > > + *  option) any later version.
> > > + */
> > > +
> > > +#include <linux/module.h>
> > > +#include <linux/kernel.h>
> > > +#include <linux/platform_device.h>
> > > +#include <linux/leds.h>
> > > +#include <linux/i2c.h>
> > > +
> > > +#define BMC_CMD_LED_GET_SET    0xA0
> > > +#define BMC_BIT_LED_STATUS     BIT(0)
> > > +#define BMC_BIT_LED_HOTSWAP    BIT(1)
> > > +#define BMC_BIT_LED_USER1      BIT(2)
> > > +#define BMC_BIT_LED_USER2      BIT(3)
> > > +
> > > +struct menf21bmc_led {
> > > +       struct led_classdev cdev;
> > > +       u8 led_bit;
> > > +       const char *name;
> > > +       struct i2c_client *i2c_client;
> > > +};
> > > +
> > > +static struct menf21bmc_led leds[] = {
> > > +       {
> > > +               .name = "menf21bmc:led_status",
> > > +               .led_bit = BMC_BIT_LED_STATUS,
> > > +       },
> > > +       {
> > > +               .name = "menf21bmc:led_hotswap",
> > > +               .led_bit = BMC_BIT_LED_HOTSWAP,
> > > +       },
> > > +       {
> > > +               .name = "menf21bmc:led_user1",
> > > +               .led_bit = BMC_BIT_LED_USER1,
> > > +       },
> > > +       {
> > > +               .name = "menf21bmc:led_user2",
> > > +               .led_bit = BMC_BIT_LED_USER2,
> > > +       }
> > > +};
> > > +
> > > +static DEFINE_MUTEX(led_lock);
> > > +
> > > +static void
> > > +menf21bmc_led_set(struct led_classdev *led_cdev, enum led_brightness value)
> > > +{
> > > +       int led_val;
> > > +       struct menf21bmc_led *led = container_of(led_cdev,
> > > +                                       struct menf21bmc_led, cdev);
> > > +
> > > +       mutex_lock(&led_lock);
> > > +       led_val = i2c_smbus_read_byte_data(led->i2c_client,
> > > +                                          BMC_CMD_LED_GET_SET);
> > > +       if (led_val < 0)
> > > +               goto err_out;
> > > +
> > > +       if (value == LED_OFF)
> > > +               led_val &= ~led->led_bit;
> > > +       else
> > > +               led_val |= led->led_bit;
> > > +
> > > +       i2c_smbus_write_byte_data(led->i2c_client,
> > > +                                 BMC_CMD_LED_GET_SET, led_val);
> > > +err_out:
> > > +       mutex_unlock(&led_lock);
> > > +}
> > > +
> > > +static int menf21bmc_led_probe(struct platform_device *pdev)
> > > +{
> > > +       int i;
> > > +       int ret;
> > > +       struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
> > > +
> > > +       for (i = 0; i < ARRAY_SIZE(leds); i++) {
> > > +               leds[i].cdev.name = leds[i].name;
> > > +               leds[i].cdev.brightness_set = menf21bmc_led_set;
> > > +               leds[i].i2c_client = i2c_client;
> > > +               ret = led_classdev_register(&pdev->dev, &leds[i].cdev);
> > > +               if (ret < 0)
> > > +                       goto err_free_leds;
> > > +       }
> > > +       dev_info(&pdev->dev, "MEN 140F21P00 BMC LED device enabled\n");
> > > +
> > > +       return 0;
> > > +
> > > +err_free_leds:
> > > +       dev_err(&pdev->dev, "failed to register LED device\n");
> > > +
> > > +       for (i = i - 1; i >= 0; i--)
> > > +               led_classdev_unregister(&leds[i].cdev);
> > > +
> > > +       return ret;
> > > +}
> > > +
> > > +static int menf21bmc_led_remove(struct platform_device *pdev)
> > > +{
> > > +       int i;
> > > +
> > > +       for (i = 0; i < ARRAY_SIZE(leds); i++)
> > > +               led_classdev_unregister(&leds[i].cdev);
> > > +
> > > +       return 0;
> > > +}
> > > +
> > > +static struct platform_driver menf21bmc_led = {
> > > +       .probe          = menf21bmc_led_probe,
> > > +       .remove         = menf21bmc_led_remove,
> > > +       .driver         = {
> > > +               .name           = "menf21bmc_led",
> > > +               .owner          = THIS_MODULE,
> > > +       },
> > > +};
> > > +
> > > +module_platform_driver(menf21bmc_led);
> > > +
> > > +MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
> > > +MODULE_DESCRIPTION("MEN 14F021P00 BMC led driver");
> > > +MODULE_LICENSE("GPL v2");
> > > +MODULE_ALIAS("platform:menf21bmc_led");
> > >
> 
> -- 
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [lm-sensors] [PATCH v6 3/4] drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver
@ 2014-08-29 11:38         ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-08-29 11:38 UTC (permalink / raw)
  To: Lee Jones
  Cc: Bryan Wu, Andreas Werner, lkml, Samuel Ortiz, linux, lm-sensors,
	wim, linux-watchdog, rpurdie, Linux LED Subsystem

T24gRnJpLCBBdWcgMjksIDIwMTQgYXQgMDc6NTk6MTVBTSArMDEwMCwgTGVlIEpvbmVzIHdyb3Rl
Ogo+IE9uIFRodSwgMjggQXVnIDIwMTQsIEJyeWFuIFd1IHdyb3RlOgo+IAo+ID4gT24gV2VkLCBB
dWcgMjcsIDIwMTQgYXQgMTA6NTIgQU0sIEFuZHJlYXMgV2VybmVyIDxhbmRyZWFzLndlcm5lckBt
ZW4uZGU+IHdyb3RlOgo+ID4gPiBBZGRlZCBkcml2ZXIgdG8gc3VwcG9ydCB0aGUgMTRGMDIxUDAw
IEJNQyBMRURzLgo+ID4gPiBUaGUgQk1DIGlzIGEgQm9hcmQgTWFuYWdlbWVudCBDb250cm9sbGVy
IGluY2x1ZGluZyBmb3VyIExFRHMgd2hpY2gKPiA+ID4gY2FuIGJlIHN3aXRjaGVkIG9uIGFuZCBv
ZmYuCj4gPiA+Cj4gPiAKPiA+IFBsZWFzZSBnbyBhaGVhZCB3aXRoIG15IEFjawo+ID4gQWNrZWQt
Ynk6IEJyeWFuIFd1IDxjb29sb25leUBnbWFpbC5jb20+Cj4gPiAKPiA+IExlZSwgd2lsbCB5b3Ug
bWVyZ2UgdGhpcyB0aHJvdWdoIHlvdXIg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vciBBUk0gU29Dcwo+IEZvbGxvdyBMaW5hcm86IEZhY2Vib29rIHwgVHdpdHRlciB8IEJsb2cK
Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCmxtLXNlbnNv
cnMgbWFpbGluZyBsaXN0CmxtLXNlbnNvcnNAbG0tc2Vuc29ycy5vcmcKaHR0cDovL2xpc3RzLmxt
LXNlbnNvcnMub3JnL21haWxtYW4vbGlzdGluZm8vbG0tc2Vuc29ycw=

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 2/4] drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog driver
  2014-08-27 17:52   ` [PATCH v6 2/4] drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog driver Andreas Werner
@ 2014-09-04  9:14     ` Lee Jones
  -1 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-04  9:14 UTC (permalink / raw)
  To: Andreas Werner
  Cc: linux-watchdog, cooloney, linux-kernel, lm-sensors, wim, rpurdie,
	linux-leds, sameo

Wim,

We're still waiting on your Ack?

> Added driver to support the 14F021P00 BMC Watchdog.
> The BMC is a Board Management Controller including watchdog functionality.
> 
> Signed-off-by: Andreas Werner <andreas.werner@men.de>
> ---
>  drivers/watchdog/Kconfig         |  10 ++
>  drivers/watchdog/Makefile        |   1 +
>  drivers/watchdog/menf21bmc_wdt.c | 203 +++++++++++++++++++++++++++++++++++++++
>  3 files changed, 214 insertions(+)
>  create mode 100644 drivers/watchdog/menf21bmc_wdt.c
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 76dd541..96d72c2 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -95,6 +95,16 @@ config GPIO_WATCHDOG
>  	  If you say yes here you get support for watchdog device
>  	  controlled through GPIO-line.
>  
> +config MENF21BMC_WATCHDOG
> +	tristate "MEN 14F021P00 BMC Watchdog"
> +	depends on MFD_MENF21BMC
> +	select WATCHDOG_CORE
> +	help
> +	  Say Y here to include support for the MEN 14F021P00 BMC Watchdog.
> +
> +	  This driver can also be built as a module. If so the module
> +	  will be called menf21bmc_wdt.
> +
>  config WM831X_WATCHDOG
>  	tristate "WM831x watchdog"
>  	depends on MFD_WM831X
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 468c320..de17014 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -178,3 +178,4 @@ obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o
>  obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o
>  obj-$(CONFIG_MAX63XX_WATCHDOG) += max63xx_wdt.o
>  obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
> +obj-$(CONFIG_MENF21BMC_WATCHDOG) += menf21bmc_wdt.o
> diff --git a/drivers/watchdog/menf21bmc_wdt.c b/drivers/watchdog/menf21bmc_wdt.c
> new file mode 100644
> index 0000000..2042874
> --- /dev/null
> +++ b/drivers/watchdog/menf21bmc_wdt.c
> @@ -0,0 +1,203 @@
> +/*
> + *  MEN 14F021P00 Board Management Controller (BMC) Watchdog Driver.
> + *
> + *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
> + *
> + *  This program is free software; you can redistribute  it and/or modify it
> + *  under  the terms of  the GNU General  Public License as published by the
> + *  Free Software Foundation;  either version 2 of the  License, or (at your
> + *  option) any later version.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/device.h>
> +#include <linux/module.h>
> +#include <linux/watchdog.h>
> +#include <linux/platform_device.h>
> +#include <linux/i2c.h>
> +
> +#define DEVNAME "menf21bmc_wdt"
> +
> +#define BMC_CMD_WD_ON		0x11
> +#define BMC_CMD_WD_OFF		0x12
> +#define BMC_CMD_WD_TRIG		0x13
> +#define BMC_CMD_WD_TIME		0x14
> +#define BMC_CMD_WD_STATE	0x17
> +#define BMC_WD_OFF_VAL		0x69
> +#define BMC_CMD_RST_RSN		0x92
> +
> +#define BMC_WD_TIMEOUT_MIN	1	/* in sec */
> +#define BMC_WD_TIMEOUT_MAX	6553	/* in sec */
> +
> +static bool nowayout = WATCHDOG_NOWAYOUT;
> +module_param(nowayout, bool, 0);
> +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
> +				__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> +
> +struct menf21bmc_wdt {
> +	struct watchdog_device wdt;
> +	struct i2c_client *i2c_client;
> +};
> +
> +static int menf21bmc_wdt_set_bootstatus(struct menf21bmc_wdt *data)
> +{
> +	int rst_rsn;
> +
> +	rst_rsn = i2c_smbus_read_byte_data(data->i2c_client, BMC_CMD_RST_RSN);
> +	if (rst_rsn < 0)
> +		return rst_rsn;
> +
> +	if (rst_rsn == 0x02)
> +		data->wdt.bootstatus |= WDIOF_CARDRESET;
> +	else if (rst_rsn == 0x05)
> +		data->wdt.bootstatus |= WDIOF_EXTERN1;
> +	else if (rst_rsn == 0x06)
> +		data->wdt.bootstatus |= WDIOF_EXTERN2;
> +	else if (rst_rsn == 0x0A)
> +		data->wdt.bootstatus |= WDIOF_POWERUNDER;
> +
> +	return 0;
> +}
> +
> +static int menf21bmc_wdt_start(struct watchdog_device *wdt)
> +{
> +	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
> +
> +	return i2c_smbus_write_byte(drv_data->i2c_client, BMC_CMD_WD_ON);
> +}
> +
> +static int menf21bmc_wdt_stop(struct watchdog_device *wdt)
> +{
> +	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
> +
> +	return i2c_smbus_write_byte_data(drv_data->i2c_client,
> +					 BMC_CMD_WD_OFF, BMC_WD_OFF_VAL);
> +}
> +
> +static int
> +menf21bmc_wdt_settimeout(struct watchdog_device *wdt, unsigned int timeout)
> +{
> +	int ret;
> +	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
> +
> +	/*
> +	 *  BMC Watchdog does have a resolution of 100ms.
> +	 *  Watchdog API defines the timeout in seconds, so we have to
> +	 *  multiply the value.
> +	 */
> +	ret = i2c_smbus_write_word_data(drv_data->i2c_client,
> +					BMC_CMD_WD_TIME, timeout * 10);
> +	if (ret < 0)
> +		return ret;
> +
> +	wdt->timeout = timeout;
> +
> +	return 0;
> +}
> +
> +static int menf21bmc_wdt_ping(struct watchdog_device *wdt)
> +{
> +	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
> +
> +	return i2c_smbus_write_byte(drv_data->i2c_client, BMC_CMD_WD_TRIG);
> +}
> +
> +static const struct watchdog_info menf21bmc_wdt_info = {
> +	.options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
> +	.identity = DEVNAME,
> +};
> +
> +static const struct watchdog_ops menf21bmc_wdt_ops = {
> +	.owner		= THIS_MODULE,
> +	.start		= menf21bmc_wdt_start,
> +	.stop		= menf21bmc_wdt_stop,
> +	.ping		= menf21bmc_wdt_ping,
> +	.set_timeout	= menf21bmc_wdt_settimeout,
> +};
> +
> +static int menf21bmc_wdt_probe(struct platform_device *pdev)
> +{
> +	int ret, bmc_timeout;
> +	struct menf21bmc_wdt *drv_data;
> +	struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
> +
> +	drv_data = devm_kzalloc(&pdev->dev,
> +				sizeof(struct menf21bmc_wdt), GFP_KERNEL);
> +	if (!drv_data)
> +		return -ENOMEM;
> +
> +	drv_data->wdt.ops = &menf21bmc_wdt_ops;
> +	drv_data->wdt.info = &menf21bmc_wdt_info;
> +	drv_data->wdt.min_timeout = BMC_WD_TIMEOUT_MIN;
> +	drv_data->wdt.max_timeout = BMC_WD_TIMEOUT_MAX;
> +	drv_data->i2c_client = i2c_client;
> +
> +	/*
> +	 * Get the current wdt timeout value from the BMC because
> +	 * the BMC will save the value set before if the system restarts.
> +	 */
> +	bmc_timeout = i2c_smbus_read_word_data(drv_data->i2c_client,
> +					       BMC_CMD_WD_TIME);
> +	if (bmc_timeout < 0) {
> +		dev_err(&pdev->dev, "failed to get current WDT timeout\n");
> +		return bmc_timeout;
> +	}
> +
> +	watchdog_init_timeout(&drv_data->wdt, bmc_timeout / 10, &pdev->dev);
> +	watchdog_set_nowayout(&drv_data->wdt, nowayout);
> +	watchdog_set_drvdata(&drv_data->wdt, drv_data);
> +	platform_set_drvdata(pdev, drv_data);
> +
> +	ret = menf21bmc_wdt_set_bootstatus(drv_data);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "failed to set Watchdog bootstatus\n");
> +		return ret;
> +	}
> +
> +	ret = watchdog_register_device(&drv_data->wdt);
> +	if (ret) {
> +		dev_err(&pdev->dev, "failed to register Watchdog device\n");
> +		return ret;
> +	}
> +
> +	dev_info(&pdev->dev, "MEN 14F021P00 BMC Watchdog device enabled\n");
> +
> +	return 0;
> +}
> +
> +static int menf21bmc_wdt_remove(struct platform_device *pdev)
> +{
> +	struct menf21bmc_wdt *drv_data = platform_get_drvdata(pdev);
> +
> +	dev_warn(&pdev->dev,
> +		 "Unregister MEN 14F021P00 BMC Watchdog device, board may reset\n");
> +
> +	watchdog_unregister_device(&drv_data->wdt);
> +
> +	return 0;
> +}
> +
> +static void menf21bmc_wdt_shutdown(struct platform_device *pdev)
> +{
> +	struct menf21bmc_wdt *drv_data = platform_get_drvdata(pdev);
> +
> +	i2c_smbus_write_word_data(drv_data->i2c_client,
> +				  BMC_CMD_WD_OFF, BMC_WD_OFF_VAL);
> +}
> +
> +static struct  platform_driver menf21bmc_wdt = {
> +	.driver		= {
> +		.owner = THIS_MODULE,
> +		.name	= DEVNAME,
> +	},
> +	.probe		= menf21bmc_wdt_probe,
> +	.remove		= menf21bmc_wdt_remove,
> +	.shutdown	= menf21bmc_wdt_shutdown,
> +};
> +
> +module_platform_driver(menf21bmc_wdt);
> +
> +MODULE_DESCRIPTION("MEN 14F021P00 BMC Watchdog driver");
> +MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
> +MODULE_LICENSE("GPL v2");
> +MODULE_ALIAS("platform:menf21bmc_wdt");

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 2/4] drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog driver
@ 2014-09-04  9:14     ` Lee Jones
  0 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-04  9:14 UTC (permalink / raw)
  To: Andreas Werner
  Cc: linux-kernel, sameo, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

Wim,

We're still waiting on your Ack?

> Added driver to support the 14F021P00 BMC Watchdog.
> The BMC is a Board Management Controller including watchdog functionality.
> 
> Signed-off-by: Andreas Werner <andreas.werner@men.de>
> ---
>  drivers/watchdog/Kconfig         |  10 ++
>  drivers/watchdog/Makefile        |   1 +
>  drivers/watchdog/menf21bmc_wdt.c | 203 +++++++++++++++++++++++++++++++++++++++
>  3 files changed, 214 insertions(+)
>  create mode 100644 drivers/watchdog/menf21bmc_wdt.c
> 
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 76dd541..96d72c2 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -95,6 +95,16 @@ config GPIO_WATCHDOG
>  	  If you say yes here you get support for watchdog device
>  	  controlled through GPIO-line.
>  
> +config MENF21BMC_WATCHDOG
> +	tristate "MEN 14F021P00 BMC Watchdog"
> +	depends on MFD_MENF21BMC
> +	select WATCHDOG_CORE
> +	help
> +	  Say Y here to include support for the MEN 14F021P00 BMC Watchdog.
> +
> +	  This driver can also be built as a module. If so the module
> +	  will be called menf21bmc_wdt.
> +
>  config WM831X_WATCHDOG
>  	tristate "WM831x watchdog"
>  	depends on MFD_WM831X
> diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
> index 468c320..de17014 100644
> --- a/drivers/watchdog/Makefile
> +++ b/drivers/watchdog/Makefile
> @@ -178,3 +178,4 @@ obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o
>  obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o
>  obj-$(CONFIG_MAX63XX_WATCHDOG) += max63xx_wdt.o
>  obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
> +obj-$(CONFIG_MENF21BMC_WATCHDOG) += menf21bmc_wdt.o
> diff --git a/drivers/watchdog/menf21bmc_wdt.c b/drivers/watchdog/menf21bmc_wdt.c
> new file mode 100644
> index 0000000..2042874
> --- /dev/null
> +++ b/drivers/watchdog/menf21bmc_wdt.c
> @@ -0,0 +1,203 @@
> +/*
> + *  MEN 14F021P00 Board Management Controller (BMC) Watchdog Driver.
> + *
> + *  Copyright (C) 2014 MEN Mikro Elektronik Nuernberg GmbH
> + *
> + *  This program is free software; you can redistribute  it and/or modify it
> + *  under  the terms of  the GNU General  Public License as published by the
> + *  Free Software Foundation;  either version 2 of the  License, or (at your
> + *  option) any later version.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/device.h>
> +#include <linux/module.h>
> +#include <linux/watchdog.h>
> +#include <linux/platform_device.h>
> +#include <linux/i2c.h>
> +
> +#define DEVNAME "menf21bmc_wdt"
> +
> +#define BMC_CMD_WD_ON		0x11
> +#define BMC_CMD_WD_OFF		0x12
> +#define BMC_CMD_WD_TRIG		0x13
> +#define BMC_CMD_WD_TIME		0x14
> +#define BMC_CMD_WD_STATE	0x17
> +#define BMC_WD_OFF_VAL		0x69
> +#define BMC_CMD_RST_RSN		0x92
> +
> +#define BMC_WD_TIMEOUT_MIN	1	/* in sec */
> +#define BMC_WD_TIMEOUT_MAX	6553	/* in sec */
> +
> +static bool nowayout = WATCHDOG_NOWAYOUT;
> +module_param(nowayout, bool, 0);
> +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
> +				__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> +
> +struct menf21bmc_wdt {
> +	struct watchdog_device wdt;
> +	struct i2c_client *i2c_client;
> +};
> +
> +static int menf21bmc_wdt_set_bootstatus(struct menf21bmc_wdt *data)
> +{
> +	int rst_rsn;
> +
> +	rst_rsn = i2c_smbus_read_byte_data(data->i2c_client, BMC_CMD_RST_RSN);
> +	if (rst_rsn < 0)
> +		return rst_rsn;
> +
> +	if (rst_rsn == 0x02)
> +		data->wdt.bootstatus |= WDIOF_CARDRESET;
> +	else if (rst_rsn == 0x05)
> +		data->wdt.bootstatus |= WDIOF_EXTERN1;
> +	else if (rst_rsn == 0x06)
> +		data->wdt.bootstatus |= WDIOF_EXTERN2;
> +	else if (rst_rsn == 0x0A)
> +		data->wdt.bootstatus |= WDIOF_POWERUNDER;
> +
> +	return 0;
> +}
> +
> +static int menf21bmc_wdt_start(struct watchdog_device *wdt)
> +{
> +	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
> +
> +	return i2c_smbus_write_byte(drv_data->i2c_client, BMC_CMD_WD_ON);
> +}
> +
> +static int menf21bmc_wdt_stop(struct watchdog_device *wdt)
> +{
> +	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
> +
> +	return i2c_smbus_write_byte_data(drv_data->i2c_client,
> +					 BMC_CMD_WD_OFF, BMC_WD_OFF_VAL);
> +}
> +
> +static int
> +menf21bmc_wdt_settimeout(struct watchdog_device *wdt, unsigned int timeout)
> +{
> +	int ret;
> +	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
> +
> +	/*
> +	 *  BMC Watchdog does have a resolution of 100ms.
> +	 *  Watchdog API defines the timeout in seconds, so we have to
> +	 *  multiply the value.
> +	 */
> +	ret = i2c_smbus_write_word_data(drv_data->i2c_client,
> +					BMC_CMD_WD_TIME, timeout * 10);
> +	if (ret < 0)
> +		return ret;
> +
> +	wdt->timeout = timeout;
> +
> +	return 0;
> +}
> +
> +static int menf21bmc_wdt_ping(struct watchdog_device *wdt)
> +{
> +	struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt);
> +
> +	return i2c_smbus_write_byte(drv_data->i2c_client, BMC_CMD_WD_TRIG);
> +}
> +
> +static const struct watchdog_info menf21bmc_wdt_info = {
> +	.options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
> +	.identity = DEVNAME,
> +};
> +
> +static const struct watchdog_ops menf21bmc_wdt_ops = {
> +	.owner		= THIS_MODULE,
> +	.start		= menf21bmc_wdt_start,
> +	.stop		= menf21bmc_wdt_stop,
> +	.ping		= menf21bmc_wdt_ping,
> +	.set_timeout	= menf21bmc_wdt_settimeout,
> +};
> +
> +static int menf21bmc_wdt_probe(struct platform_device *pdev)
> +{
> +	int ret, bmc_timeout;
> +	struct menf21bmc_wdt *drv_data;
> +	struct i2c_client *i2c_client = to_i2c_client(pdev->dev.parent);
> +
> +	drv_data = devm_kzalloc(&pdev->dev,
> +				sizeof(struct menf21bmc_wdt), GFP_KERNEL);
> +	if (!drv_data)
> +		return -ENOMEM;
> +
> +	drv_data->wdt.ops = &menf21bmc_wdt_ops;
> +	drv_data->wdt.info = &menf21bmc_wdt_info;
> +	drv_data->wdt.min_timeout = BMC_WD_TIMEOUT_MIN;
> +	drv_data->wdt.max_timeout = BMC_WD_TIMEOUT_MAX;
> +	drv_data->i2c_client = i2c_client;
> +
> +	/*
> +	 * Get the current wdt timeout value from the BMC because
> +	 * the BMC will save the value set before if the system restarts.
> +	 */
> +	bmc_timeout = i2c_smbus_read_word_data(drv_data->i2c_client,
> +					       BMC_CMD_WD_TIME);
> +	if (bmc_timeout < 0) {
> +		dev_err(&pdev->dev, "failed to get current WDT timeout\n");
> +		return bmc_timeout;
> +	}
> +
> +	watchdog_init_timeout(&drv_data->wdt, bmc_timeout / 10, &pdev->dev);
> +	watchdog_set_nowayout(&drv_data->wdt, nowayout);
> +	watchdog_set_drvdata(&drv_data->wdt, drv_data);
> +	platform_set_drvdata(pdev, drv_data);
> +
> +	ret = menf21bmc_wdt_set_bootstatus(drv_data);
> +	if (ret < 0) {
> +		dev_err(&pdev->dev, "failed to set Watchdog bootstatus\n");
> +		return ret;
> +	}
> +
> +	ret = watchdog_register_device(&drv_data->wdt);
> +	if (ret) {
> +		dev_err(&pdev->dev, "failed to register Watchdog device\n");
> +		return ret;
> +	}
> +
> +	dev_info(&pdev->dev, "MEN 14F021P00 BMC Watchdog device enabled\n");
> +
> +	return 0;
> +}
> +
> +static int menf21bmc_wdt_remove(struct platform_device *pdev)
> +{
> +	struct menf21bmc_wdt *drv_data = platform_get_drvdata(pdev);
> +
> +	dev_warn(&pdev->dev,
> +		 "Unregister MEN 14F021P00 BMC Watchdog device, board may reset\n");
> +
> +	watchdog_unregister_device(&drv_data->wdt);
> +
> +	return 0;
> +}
> +
> +static void menf21bmc_wdt_shutdown(struct platform_device *pdev)
> +{
> +	struct menf21bmc_wdt *drv_data = platform_get_drvdata(pdev);
> +
> +	i2c_smbus_write_word_data(drv_data->i2c_client,
> +				  BMC_CMD_WD_OFF, BMC_WD_OFF_VAL);
> +}
> +
> +static struct  platform_driver menf21bmc_wdt = {
> +	.driver		= {
> +		.owner = THIS_MODULE,
> +		.name	= DEVNAME,
> +	},
> +	.probe		= menf21bmc_wdt_probe,
> +	.remove		= menf21bmc_wdt_remove,
> +	.shutdown	= menf21bmc_wdt_shutdown,
> +};
> +
> +module_platform_driver(menf21bmc_wdt);
> +
> +MODULE_DESCRIPTION("MEN 14F021P00 BMC Watchdog driver");
> +MODULE_AUTHOR("Andreas Werner <andreas.werner@men.de>");
> +MODULE_LICENSE("GPL v2");
> +MODULE_ALIAS("platform:menf21bmc_wdt");

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* [PATCH] MAINTAINERS: Adds Andreas Werner to maintainers list for MEN F21BMC
  2014-08-27 17:51 ` Andreas Werner
                   ` (5 preceding siblings ...)
  (?)
@ 2014-09-15  7:36 ` Andreas Werner
  2014-09-15 22:42   ` Lee Jones
  -1 siblings, 1 reply; 71+ messages in thread
From: Andreas Werner @ 2014-09-15  7:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: andreas.werner, lee.jones

Added maintainer for the following MEN F21BMC drivers:
	- menf21bmc (MFD)
	- menf21bmc_wdt (Watchdog)
	- menf21bmc_hwmon (HWMON)
	- leds-menf21bmc (LED)

Signed-off-by: Andreas Werner <andreas.werner@men.de>
---
 MAINTAINERS | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 65cc66d..c4a188c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5938,6 +5938,15 @@ S:	Supported
 F:	drivers/mcb/
 F:	include/linux/mcb.h
 
+MEN F21BMC (Board Management Controller)
+M:	Andreas Werner <andreas.werner@men.de>
+S:	Supported
+F:	drivers/mfd/menf21bmc.c
+F:	drivers/watchdog/menf21bmc_wdt.c
+F:	drivers/leds/leds-menf21bmc.c
+F:	drivers/hwmon/menf21bmc_hwmon.c
+F:	Documentation/hwmon/menf21bmc
+
 METAG ARCHITECTURE
 M:	James Hogan <james.hogan@imgtec.com>
 L:	linux-metag@vger.kernel.org
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 71+ messages in thread

* Re: [PATCH] MAINTAINERS: Adds Andreas Werner to maintainers list for MEN F21BMC
  2014-09-15  7:36 ` [PATCH] MAINTAINERS: Adds Andreas Werner to maintainers list for MEN F21BMC Andreas Werner
@ 2014-09-15 22:42   ` Lee Jones
  2014-09-16  8:22     ` Andreas Werner
  0 siblings, 1 reply; 71+ messages in thread
From: Lee Jones @ 2014-09-15 22:42 UTC (permalink / raw)
  To: Andreas Werner; +Cc: linux-kernel

On Mon, 15 Sep 2014, Andreas Werner wrote:

> Added maintainer for the following MEN F21BMC drivers:
> 	- menf21bmc (MFD)
> 	- menf21bmc_wdt (Watchdog)
> 	- menf21bmc_hwmon (HWMON)
> 	- leds-menf21bmc (LED)
> 
> Signed-off-by: Andreas Werner <andreas.werner@men.de>
> ---
>  MAINTAINERS | 9 +++++++++
>  1 file changed, 9 insertions(+)

Acked-by: Lee Jones <lee.jones@linaro.org>

> diff --git a/MAINTAINERS b/MAINTAINERS
> index 65cc66d..c4a188c 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -5938,6 +5938,15 @@ S:	Supported
>  F:	drivers/mcb/
>  F:	include/linux/mcb.h
>  
> +MEN F21BMC (Board Management Controller)
> +M:	Andreas Werner <andreas.werner@men.de>
> +S:	Supported
> +F:	drivers/mfd/menf21bmc.c
> +F:	drivers/watchdog/menf21bmc_wdt.c
> +F:	drivers/leds/leds-menf21bmc.c
> +F:	drivers/hwmon/menf21bmc_hwmon.c
> +F:	Documentation/hwmon/menf21bmc
> +
>  METAG ARCHITECTURE
>  M:	James Hogan <james.hogan@imgtec.com>
>  L:	linux-metag@vger.kernel.org

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH] MAINTAINERS: Adds Andreas Werner to maintainers list for MEN F21BMC
  2014-09-15 22:42   ` Lee Jones
@ 2014-09-16  8:22     ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-09-16  8:22 UTC (permalink / raw)
  To: Lee Jones; +Cc: Andreas Werner, linux-kernel

On Mon, Sep 15, 2014 at 11:42:19PM +0100, Lee Jones wrote:
> On Mon, 15 Sep 2014, Andreas Werner wrote:
> 
> > Added maintainer for the following MEN F21BMC drivers:
> > 	- menf21bmc (MFD)
> > 	- menf21bmc_wdt (Watchdog)
> > 	- menf21bmc_hwmon (HWMON)
> > 	- leds-menf21bmc (LED)
> > 
> > Signed-off-by: Andreas Werner <andreas.werner@men.de>
> > ---
> >  MAINTAINERS | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> 
> Acked-by: Lee Jones <lee.jones@linaro.org>
> 

Thanks.
I think we are almost complete.
Just the Watchdog needs to be Acked if everything is ok.

Regards
Andy

> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index 65cc66d..c4a188c 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -5938,6 +5938,15 @@ S:	Supported
> >  F:	drivers/mcb/
> >  F:	include/linux/mcb.h
> >  
> > +MEN F21BMC (Board Management Controller)
> > +M:	Andreas Werner <andreas.werner@men.de>
> > +S:	Supported
> > +F:	drivers/mfd/menf21bmc.c
> > +F:	drivers/watchdog/menf21bmc_wdt.c
> > +F:	drivers/leds/leds-menf21bmc.c
> > +F:	drivers/hwmon/menf21bmc_hwmon.c
> > +F:	Documentation/hwmon/menf21bmc
> > +
> >  METAG ARCHITECTURE
> >  M:	James Hogan <james.hogan@imgtec.com>
> >  L:	linux-metag@vger.kernel.org
> 
> -- 
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 2/4] drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog driver
  2014-08-27 17:52   ` [PATCH v6 2/4] drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog driver Andreas Werner
@ 2014-09-24 12:35     ` Lee Jones
  -1 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-24 12:35 UTC (permalink / raw)
  To: Andreas Werner
  Cc: linux-kernel, sameo, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

On Wed, 27 Aug 2014, Andreas Werner wrote:

> Added driver to support the 14F021P00 BMC Watchdog.
> The BMC is a Board Management Controller including watchdog functionality.
> 
> Signed-off-by: Andreas Werner <andreas.werner@men.de>
> ---
>  drivers/watchdog/Kconfig         |  10 ++
>  drivers/watchdog/Makefile        |   1 +
>  drivers/watchdog/menf21bmc_wdt.c | 203 +++++++++++++++++++++++++++++++++++++++
>  3 files changed, 214 insertions(+)
>  create mode 100644 drivers/watchdog/menf21bmc_wdt.c

I see no reason to keep this dragging on.  I'm going to apply this
along with the remainder of the set and send a pull-request to all the
other Maintainers.  This branch is currently under test.

Any fix-ups for review comments can go in subsequently.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 2/4] drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog driver
@ 2014-09-24 12:35     ` Lee Jones
  0 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-24 12:35 UTC (permalink / raw)
  To: Andreas Werner
  Cc: linux-kernel, sameo, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

On Wed, 27 Aug 2014, Andreas Werner wrote:

> Added driver to support the 14F021P00 BMC Watchdog.
> The BMC is a Board Management Controller including watchdog functionality.
> 
> Signed-off-by: Andreas Werner <andreas.werner@men.de>
> ---
>  drivers/watchdog/Kconfig         |  10 ++
>  drivers/watchdog/Makefile        |   1 +
>  drivers/watchdog/menf21bmc_wdt.c | 203 +++++++++++++++++++++++++++++++++++++++
>  3 files changed, 214 insertions(+)
>  create mode 100644 drivers/watchdog/menf21bmc_wdt.c

I see no reason to keep this dragging on.  I'm going to apply this
along with the remainder of the set and send a pull-request to all the
other Maintainers.  This branch is currently under test.

Any fix-ups for review comments can go in subsequently.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 2/4] drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog driver
  2014-09-24 12:35     ` Lee Jones
  (?)
@ 2014-09-24 13:24     ` Guenter Roeck
  2014-09-24 14:13         ` Lee Jones
  -1 siblings, 1 reply; 71+ messages in thread
From: Guenter Roeck @ 2014-09-24 13:24 UTC (permalink / raw)
  To: Lee Jones, Andreas Werner
  Cc: linux-kernel, sameo, lm-sensors, wim, linux-watchdog, cooloney,
	rpurdie, linux-leds

On 09/24/2014 05:35 AM, Lee Jones wrote:
> On Wed, 27 Aug 2014, Andreas Werner wrote:
>
>> Added driver to support the 14F021P00 BMC Watchdog.
>> The BMC is a Board Management Controller including watchdog functionality.
>>
>> Signed-off-by: Andreas Werner <andreas.werner@men.de>
>> ---
>>   drivers/watchdog/Kconfig         |  10 ++
>>   drivers/watchdog/Makefile        |   1 +
>>   drivers/watchdog/menf21bmc_wdt.c | 203 +++++++++++++++++++++++++++++++++++++++
>>   3 files changed, 214 insertions(+)
>>   create mode 100644 drivers/watchdog/menf21bmc_wdt.c
>
> I see no reason to keep this dragging on.  I'm going to apply this
> along with the remainder of the set and send a pull-request to all the
> other Maintainers.  This branch is currently under test.
>
> Any fix-ups for review comments can go in subsequently.
>
Tend to agree. I thought I sent it before, but in case I didn't

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

[ for the watchdog driver ]

Guenter

^ permalink raw reply	[flat|nested] 71+ messages in thread

* [GIT PULL] Immutable branch between MFD, HWMON, LEDs and Watchdog
  2014-08-27 17:51 ` Andreas Werner
@ 2014-09-24 13:45   ` Lee Jones
  -1 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-24 13:45 UTC (permalink / raw)
  To: Andreas Werner
  Cc: linux-kernel, sameo, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:

  Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.17

for you to fetch changes up to 25b1efbf5ff8a2475e29572065cac3d89cee24b1:

  hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 13:31:20 +0100)

----------------------------------------------------------------
Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.17

----------------------------------------------------------------
Andreas Werner (4):
      mfd: menf21bmc: Introduce MEN 14F021P00 BMC MFD Core driver
      watchdog: menf21bmc_wdt: Introduce MEN 14F021P00 BMC Watchdog driver
      leds: leds-menf21bmc: Introduce MEN 14F021P00 BMC LED driver
      hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver

 Documentation/hwmon/menf21bmc    |  50 +++++++++
 drivers/hwmon/Kconfig            |  10 ++
 drivers/hwmon/Makefile           |   1 +
 drivers/hwmon/menf21bmc_hwmon.c  | 230 +++++++++++++++++++++++++++++++++++++++
 drivers/leds/Kconfig             |   9 ++
 drivers/leds/Makefile            |   1 +
 drivers/leds/leds-menf21bmc.c    | 131 ++++++++++++++++++++++
 drivers/mfd/Kconfig              |  15 +++
 drivers/mfd/Makefile             |   1 +
 drivers/mfd/menf21bmc.c          | 132 ++++++++++++++++++++++
 drivers/watchdog/Kconfig         |  10 ++
 drivers/watchdog/Makefile        |   1 +
 drivers/watchdog/menf21bmc_wdt.c | 203 ++++++++++++++++++++++++++++++++++
 13 files changed, 794 insertions(+)
 create mode 100644 Documentation/hwmon/menf21bmc
 create mode 100644 drivers/hwmon/menf21bmc_hwmon.c
 create mode 100644 drivers/leds/leds-menf21bmc.c
 create mode 100644 drivers/mfd/menf21bmc.c
 create mode 100644 drivers/watchdog/menf21bmc_wdt.c

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* [GIT PULL] Immutable branch between MFD, HWMON, LEDs and Watchdog
@ 2014-09-24 13:45   ` Lee Jones
  0 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-24 13:45 UTC (permalink / raw)
  To: Andreas Werner
  Cc: linux-kernel, sameo, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:

  Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.17

for you to fetch changes up to 25b1efbf5ff8a2475e29572065cac3d89cee24b1:

  hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 13:31:20 +0100)

----------------------------------------------------------------
Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.17

----------------------------------------------------------------
Andreas Werner (4):
      mfd: menf21bmc: Introduce MEN 14F021P00 BMC MFD Core driver
      watchdog: menf21bmc_wdt: Introduce MEN 14F021P00 BMC Watchdog driver
      leds: leds-menf21bmc: Introduce MEN 14F021P00 BMC LED driver
      hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver

 Documentation/hwmon/menf21bmc    |  50 +++++++++
 drivers/hwmon/Kconfig            |  10 ++
 drivers/hwmon/Makefile           |   1 +
 drivers/hwmon/menf21bmc_hwmon.c  | 230 +++++++++++++++++++++++++++++++++++++++
 drivers/leds/Kconfig             |   9 ++
 drivers/leds/Makefile            |   1 +
 drivers/leds/leds-menf21bmc.c    | 131 ++++++++++++++++++++++
 drivers/mfd/Kconfig              |  15 +++
 drivers/mfd/Makefile             |   1 +
 drivers/mfd/menf21bmc.c          | 132 ++++++++++++++++++++++
 drivers/watchdog/Kconfig         |  10 ++
 drivers/watchdog/Makefile        |   1 +
 drivers/watchdog/menf21bmc_wdt.c | 203 ++++++++++++++++++++++++++++++++++
 13 files changed, 794 insertions(+)
 create mode 100644 Documentation/hwmon/menf21bmc
 create mode 100644 drivers/hwmon/menf21bmc_hwmon.c
 create mode 100644 drivers/leds/leds-menf21bmc.c
 create mode 100644 drivers/mfd/menf21bmc.c
 create mode 100644 drivers/watchdog/menf21bmc_wdt.c

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 2/4] drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog driver
  2014-09-24 13:24     ` Guenter Roeck
@ 2014-09-24 14:13         ` Lee Jones
  0 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-24 14:13 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Andreas Werner, linux-kernel, sameo, lm-sensors, wim,
	linux-watchdog, cooloney, rpurdie, linux-leds

On Wed, 24 Sep 2014, Guenter Roeck wrote:
> On 09/24/2014 05:35 AM, Lee Jones wrote:
> >On Wed, 27 Aug 2014, Andreas Werner wrote:
> >
> >>Added driver to support the 14F021P00 BMC Watchdog.
> >>The BMC is a Board Management Controller including watchdog functionality.
> >>
> >>Signed-off-by: Andreas Werner <andreas.werner@men.de>
> >>---
> >>  drivers/watchdog/Kconfig         |  10 ++
> >>  drivers/watchdog/Makefile        |   1 +
> >>  drivers/watchdog/menf21bmc_wdt.c | 203 +++++++++++++++++++++++++++++++++++++++
> >>  3 files changed, 214 insertions(+)
> >>  create mode 100644 drivers/watchdog/menf21bmc_wdt.c
> >
> >I see no reason to keep this dragging on.  I'm going to apply this
> >along with the remainder of the set and send a pull-request to all the
> >other Maintainers.  This branch is currently under test.
> >
> >Any fix-ups for review comments can go in subsequently.
> >
> Tend to agree. I thought I sent it before, but in case I didn't
> 
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> 
> [ for the watchdog driver ]

Sorry Guenter, the branch is tested, tagged and pushed.

Will be sending a pull-request shortly.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 2/4] drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog driver
@ 2014-09-24 14:13         ` Lee Jones
  0 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-24 14:13 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Andreas Werner, linux-kernel, sameo, lm-sensors, wim,
	linux-watchdog, cooloney, rpurdie, linux-leds

On Wed, 24 Sep 2014, Guenter Roeck wrote:
> On 09/24/2014 05:35 AM, Lee Jones wrote:
> >On Wed, 27 Aug 2014, Andreas Werner wrote:
> >
> >>Added driver to support the 14F021P00 BMC Watchdog.
> >>The BMC is a Board Management Controller including watchdog functionality.
> >>
> >>Signed-off-by: Andreas Werner <andreas.werner@men.de>
> >>---
> >>  drivers/watchdog/Kconfig         |  10 ++
> >>  drivers/watchdog/Makefile        |   1 +
> >>  drivers/watchdog/menf21bmc_wdt.c | 203 +++++++++++++++++++++++++++++++++++++++
> >>  3 files changed, 214 insertions(+)
> >>  create mode 100644 drivers/watchdog/menf21bmc_wdt.c
> >
> >I see no reason to keep this dragging on.  I'm going to apply this
> >along with the remainder of the set and send a pull-request to all the
> >other Maintainers.  This branch is currently under test.
> >
> >Any fix-ups for review comments can go in subsequently.
> >
> Tend to agree. I thought I sent it before, but in case I didn't
> 
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> 
> [ for the watchdog driver ]

Sorry Guenter, the branch is tested, tagged and pushed.

Will be sending a pull-request shortly.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 2/4] drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog driver
  2014-09-24 14:13         ` Lee Jones
@ 2014-09-24 14:14           ` Lee Jones
  -1 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-24 14:14 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Andreas Werner, linux-kernel, sameo, lm-sensors, wim,
	linux-watchdog, cooloney, rpurdie, linux-leds

On Wed, 24 Sep 2014, Lee Jones wrote:

> On Wed, 24 Sep 2014, Guenter Roeck wrote:
> > On 09/24/2014 05:35 AM, Lee Jones wrote:
> > >On Wed, 27 Aug 2014, Andreas Werner wrote:
> > >
> > >>Added driver to support the 14F021P00 BMC Watchdog.
> > >>The BMC is a Board Management Controller including watchdog functionality.
> > >>
> > >>Signed-off-by: Andreas Werner <andreas.werner@men.de>
> > >>---
> > >>  drivers/watchdog/Kconfig         |  10 ++
> > >>  drivers/watchdog/Makefile        |   1 +
> > >>  drivers/watchdog/menf21bmc_wdt.c | 203 +++++++++++++++++++++++++++++++++++++++
> > >>  3 files changed, 214 insertions(+)
> > >>  create mode 100644 drivers/watchdog/menf21bmc_wdt.c
> > >
> > >I see no reason to keep this dragging on.  I'm going to apply this
> > >along with the remainder of the set and send a pull-request to all the
> > >other Maintainers.  This branch is currently under test.
> > >
> > >Any fix-ups for review comments can go in subsequently.
> > >
> > Tend to agree. I thought I sent it before, but in case I didn't
> > 
> > Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> > 
> > [ for the watchdog driver ]
> 
> Sorry Guenter, the branch is tested, tagged and pushed.
> 
> Will be sending a pull-request shortly.

Ah, screw it, I'll re-tag and push with your RB.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 2/4] drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog driver
@ 2014-09-24 14:14           ` Lee Jones
  0 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-24 14:14 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Andreas Werner, linux-kernel, sameo, lm-sensors, wim,
	linux-watchdog, cooloney, rpurdie, linux-leds

On Wed, 24 Sep 2014, Lee Jones wrote:

> On Wed, 24 Sep 2014, Guenter Roeck wrote:
> > On 09/24/2014 05:35 AM, Lee Jones wrote:
> > >On Wed, 27 Aug 2014, Andreas Werner wrote:
> > >
> > >>Added driver to support the 14F021P00 BMC Watchdog.
> > >>The BMC is a Board Management Controller including watchdog functionality.
> > >>
> > >>Signed-off-by: Andreas Werner <andreas.werner@men.de>
> > >>---
> > >>  drivers/watchdog/Kconfig         |  10 ++
> > >>  drivers/watchdog/Makefile        |   1 +
> > >>  drivers/watchdog/menf21bmc_wdt.c | 203 +++++++++++++++++++++++++++++++++++++++
> > >>  3 files changed, 214 insertions(+)
> > >>  create mode 100644 drivers/watchdog/menf21bmc_wdt.c
> > >
> > >I see no reason to keep this dragging on.  I'm going to apply this
> > >along with the remainder of the set and send a pull-request to all the
> > >other Maintainers.  This branch is currently under test.
> > >
> > >Any fix-ups for review comments can go in subsequently.
> > >
> > Tend to agree. I thought I sent it before, but in case I didn't
> > 
> > Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> > 
> > [ for the watchdog driver ]
> 
> Sorry Guenter, the branch is tested, tagged and pushed.
> 
> Will be sending a pull-request shortly.

Ah, screw it, I'll re-tag and push with your RB.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
  2014-08-27 17:51 ` Andreas Werner
@ 2014-09-24 14:48   ` Lee Jones
  -1 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-24 14:48 UTC (permalink / raw)
  To: Andreas Werner
  Cc: linux-kernel, sameo, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

Guenter, Bryan, Wim,

The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:

  Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18

for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:

  hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)

----------------------------------------------------------------
Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18

----------------------------------------------------------------
Andreas Werner (4):
      mfd: menf21bmc: Introduce MEN 14F021P00 BMC MFD Core driver
      watchdog: menf21bmc_wdt: Introduce MEN 14F021P00 BMC Watchdog driver
      leds: leds-menf21bmc: Introduce MEN 14F021P00 BMC LED driver
      hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver

 Documentation/hwmon/menf21bmc    |  50 +++++++++
 drivers/hwmon/Kconfig            |  10 ++
 drivers/hwmon/Makefile           |   1 +
 drivers/hwmon/menf21bmc_hwmon.c  | 230 +++++++++++++++++++++++++++++++++++++++
 drivers/leds/Kconfig             |   9 ++
 drivers/leds/Makefile            |   1 +
 drivers/leds/leds-menf21bmc.c    | 131 ++++++++++++++++++++++
 drivers/mfd/Kconfig              |  15 +++
 drivers/mfd/Makefile             |   1 +
 drivers/mfd/menf21bmc.c          | 132 ++++++++++++++++++++++
 drivers/watchdog/Kconfig         |  10 ++
 drivers/watchdog/Makefile        |   1 +
 drivers/watchdog/menf21bmc_wdt.c | 203 ++++++++++++++++++++++++++++++++++
 13 files changed, 794 insertions(+)
 create mode 100644 Documentation/hwmon/menf21bmc
 create mode 100644 drivers/hwmon/menf21bmc_hwmon.c
 create mode 100644 drivers/leds/leds-menf21bmc.c
 create mode 100644 drivers/mfd/menf21bmc.c
 create mode 100644 drivers/watchdog/menf21bmc_wdt.c

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
@ 2014-09-24 14:48   ` Lee Jones
  0 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-24 14:48 UTC (permalink / raw)
  To: Andreas Werner
  Cc: linux-kernel, sameo, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

Guenter, Bryan, Wim,

The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:

  Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18

for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:

  hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)

----------------------------------------------------------------
Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18

----------------------------------------------------------------
Andreas Werner (4):
      mfd: menf21bmc: Introduce MEN 14F021P00 BMC MFD Core driver
      watchdog: menf21bmc_wdt: Introduce MEN 14F021P00 BMC Watchdog driver
      leds: leds-menf21bmc: Introduce MEN 14F021P00 BMC LED driver
      hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver

 Documentation/hwmon/menf21bmc    |  50 +++++++++
 drivers/hwmon/Kconfig            |  10 ++
 drivers/hwmon/Makefile           |   1 +
 drivers/hwmon/menf21bmc_hwmon.c  | 230 +++++++++++++++++++++++++++++++++++++++
 drivers/leds/Kconfig             |   9 ++
 drivers/leds/Makefile            |   1 +
 drivers/leds/leds-menf21bmc.c    | 131 ++++++++++++++++++++++
 drivers/mfd/Kconfig              |  15 +++
 drivers/mfd/Makefile             |   1 +
 drivers/mfd/menf21bmc.c          | 132 ++++++++++++++++++++++
 drivers/watchdog/Kconfig         |  10 ++
 drivers/watchdog/Makefile        |   1 +
 drivers/watchdog/menf21bmc_wdt.c | 203 ++++++++++++++++++++++++++++++++++
 13 files changed, 794 insertions(+)
 create mode 100644 Documentation/hwmon/menf21bmc
 create mode 100644 drivers/hwmon/menf21bmc_hwmon.c
 create mode 100644 drivers/leds/leds-menf21bmc.c
 create mode 100644 drivers/mfd/menf21bmc.c
 create mode 100644 drivers/watchdog/menf21bmc_wdt.c

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 71+ messages in thread

* [GIT PULL] MFD: Immutable branch between HWMON, LEDs and Watchdog
  2014-08-27 17:51 ` Andreas Werner
@ 2014-09-24 14:49   ` Lee Jones
  -1 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-24 14:49 UTC (permalink / raw)
  To: Andreas Werner
  Cc: linux-kernel, sameo, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

Guenter, Bryan, Wim,

The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
  
  Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
  
are available in the git repository at:
  
  git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18

for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:

  hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)

----------------------------------------------------------------
Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18

----------------------------------------------------------------
Andreas Werner (4):
      mfd: menf21bmc: Introduce MEN 14F021P00 BMC MFD Core driver
      watchdog: menf21bmc_wdt: Introduce MEN 14F021P00 BMC Watchdog driver
      leds: leds-menf21bmc: Introduce MEN 14F021P00 BMC LED driver
      hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver

 Documentation/hwmon/menf21bmc    |  50 +++++++++
 drivers/hwmon/Kconfig            |  10 ++
 drivers/hwmon/Makefile           |   1 +
 drivers/hwmon/menf21bmc_hwmon.c  | 230 +++++++++++++++++++++++++++++++++++++++
 drivers/leds/Kconfig             |   9 ++
 drivers/leds/Makefile            |   1 +
 drivers/leds/leds-menf21bmc.c    | 131 ++++++++++++++++++++++
 drivers/mfd/Kconfig              |  15 +++
 drivers/mfd/Makefile             |   1 +
 drivers/mfd/menf21bmc.c          | 132 ++++++++++++++++++++++
 drivers/watchdog/Kconfig         |  10 ++
 drivers/watchdog/Makefile        |   1 +
 drivers/watchdog/menf21bmc_wdt.c | 203 ++++++++++++++++++++++++++++++++++
 13 files changed, 794 insertions(+)
 create mode 100644 Documentation/hwmon/menf21bmc
 create mode 100644 drivers/hwmon/menf21bmc_hwmon.c
 create mode 100644 drivers/leds/leds-menf21bmc.c
 create mode 100644 drivers/mfd/menf21bmc.c
 create mode 100644 drivers/watchdog/menf21bmc_wdt.c

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* [GIT PULL] MFD: Immutable branch between HWMON, LEDs and Watchdog
@ 2014-09-24 14:49   ` Lee Jones
  0 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-24 14:49 UTC (permalink / raw)
  To: Andreas Werner
  Cc: linux-kernel, sameo, linux, lm-sensors, wim, linux-watchdog,
	cooloney, rpurdie, linux-leds

Guenter, Bryan, Wim,

The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
  
  Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
  
are available in the git repository at:
  
  git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18

for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:

  hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)

----------------------------------------------------------------
Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18

----------------------------------------------------------------
Andreas Werner (4):
      mfd: menf21bmc: Introduce MEN 14F021P00 BMC MFD Core driver
      watchdog: menf21bmc_wdt: Introduce MEN 14F021P00 BMC Watchdog driver
      leds: leds-menf21bmc: Introduce MEN 14F021P00 BMC LED driver
      hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver

 Documentation/hwmon/menf21bmc    |  50 +++++++++
 drivers/hwmon/Kconfig            |  10 ++
 drivers/hwmon/Makefile           |   1 +
 drivers/hwmon/menf21bmc_hwmon.c  | 230 +++++++++++++++++++++++++++++++++++++++
 drivers/leds/Kconfig             |   9 ++
 drivers/leds/Makefile            |   1 +
 drivers/leds/leds-menf21bmc.c    | 131 ++++++++++++++++++++++
 drivers/mfd/Kconfig              |  15 +++
 drivers/mfd/Makefile             |   1 +
 drivers/mfd/menf21bmc.c          | 132 ++++++++++++++++++++++
 drivers/watchdog/Kconfig         |  10 ++
 drivers/watchdog/Makefile        |   1 +
 drivers/watchdog/menf21bmc_wdt.c | 203 ++++++++++++++++++++++++++++++++++
 13 files changed, 794 insertions(+)
 create mode 100644 Documentation/hwmon/menf21bmc
 create mode 100644 drivers/hwmon/menf21bmc_hwmon.c
 create mode 100644 drivers/leds/leds-menf21bmc.c
 create mode 100644 drivers/mfd/menf21bmc.c
 create mode 100644 drivers/watchdog/menf21bmc_wdt.c

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
  2014-09-24 14:48   ` Lee Jones
@ 2014-09-24 15:45     ` Guenter Roeck
  -1 siblings, 0 replies; 71+ messages in thread
From: Guenter Roeck @ 2014-09-24 15:45 UTC (permalink / raw)
  To: Lee Jones
  Cc: Andreas Werner, linux-kernel, sameo, lm-sensors, wim,
	linux-watchdog, cooloney, rpurdie, linux-leds

On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
> Guenter, Bryan, Wim,
> 
> The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
> 
>   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
> 
> for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
> 
>   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
> 
> ----------------------------------------------------------------
> Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
> 
I assume you'll push it all through mfd, correct ?

Thanks,
Guenter

> ----------------------------------------------------------------
> Andreas Werner (4):
>       mfd: menf21bmc: Introduce MEN 14F021P00 BMC MFD Core driver
>       watchdog: menf21bmc_wdt: Introduce MEN 14F021P00 BMC Watchdog driver
>       leds: leds-menf21bmc: Introduce MEN 14F021P00 BMC LED driver
>       hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver
> 
>  Documentation/hwmon/menf21bmc    |  50 +++++++++
>  drivers/hwmon/Kconfig            |  10 ++
>  drivers/hwmon/Makefile           |   1 +
>  drivers/hwmon/menf21bmc_hwmon.c  | 230 +++++++++++++++++++++++++++++++++++++++
>  drivers/leds/Kconfig             |   9 ++
>  drivers/leds/Makefile            |   1 +
>  drivers/leds/leds-menf21bmc.c    | 131 ++++++++++++++++++++++
>  drivers/mfd/Kconfig              |  15 +++
>  drivers/mfd/Makefile             |   1 +
>  drivers/mfd/menf21bmc.c          | 132 ++++++++++++++++++++++
>  drivers/watchdog/Kconfig         |  10 ++
>  drivers/watchdog/Makefile        |   1 +
>  drivers/watchdog/menf21bmc_wdt.c | 203 ++++++++++++++++++++++++++++++++++
>  13 files changed, 794 insertions(+)
>  create mode 100644 Documentation/hwmon/menf21bmc
>  create mode 100644 drivers/hwmon/menf21bmc_hwmon.c
>  create mode 100644 drivers/leds/leds-menf21bmc.c
>  create mode 100644 drivers/mfd/menf21bmc.c
>  create mode 100644 drivers/watchdog/menf21bmc_wdt.c
> 
> -- 
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [lm-sensors] [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
@ 2014-09-24 15:45     ` Guenter Roeck
  0 siblings, 0 replies; 71+ messages in thread
From: Guenter Roeck @ 2014-09-24 15:45 UTC (permalink / raw)
  To: Lee Jones
  Cc: sameo, Andreas Werner, cooloney, linux-kernel, lm-sensors, wim,
	rpurdie, linux-leds, linux-watchdog

On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
> Guenter, Bryan, Wim,
> 
> The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
> 
>   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
> 
> for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
> 
>   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
> 
> ----------------------------------------------------------------
> Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
> 
I assume you'll push it all through mfd, correct ?

Thanks,
Guenter

> ----------------------------------------------------------------
> Andreas Werner (4):
>       mfd: menf21bmc: Introduce MEN 14F021P00 BMC MFD Core driver
>       watchdog: menf21bmc_wdt: Introduce MEN 14F021P00 BMC Watchdog driver
>       leds: leds-menf21bmc: Introduce MEN 14F021P00 BMC LED driver
>       hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver
> 
>  Documentation/hwmon/menf21bmc    |  50 +++++++++
>  drivers/hwmon/Kconfig            |  10 ++
>  drivers/hwmon/Makefile           |   1 +
>  drivers/hwmon/menf21bmc_hwmon.c  | 230 +++++++++++++++++++++++++++++++++++++++
>  drivers/leds/Kconfig             |   9 ++
>  drivers/leds/Makefile            |   1 +
>  drivers/leds/leds-menf21bmc.c    | 131 ++++++++++++++++++++++
>  drivers/mfd/Kconfig              |  15 +++
>  drivers/mfd/Makefile             |   1 +
>  drivers/mfd/menf21bmc.c          | 132 ++++++++++++++++++++++
>  drivers/watchdog/Kconfig         |  10 ++
>  drivers/watchdog/Makefile        |   1 +
>  drivers/watchdog/menf21bmc_wdt.c | 203 ++++++++++++++++++++++++++++++++++
>  13 files changed, 794 insertions(+)
>  create mode 100644 Documentation/hwmon/menf21bmc
>  create mode 100644 drivers/hwmon/menf21bmc_hwmon.c
>  create mode 100644 drivers/leds/leds-menf21bmc.c
>  create mode 100644 drivers/mfd/menf21bmc.c
>  create mode 100644 drivers/watchdog/menf21bmc_wdt.c
> 
> -- 
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
  2014-09-24 15:45     ` [lm-sensors] " Guenter Roeck
@ 2014-09-24 16:18       ` Lee Jones
  -1 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-24 16:18 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Andreas Werner, linux-kernel, sameo, lm-sensors, wim,
	linux-watchdog, cooloney, rpurdie, linux-leds

On Wed, 24 Sep 2014, Guenter Roeck wrote:

> On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
> > Guenter, Bryan, Wim,
> > 
> > The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
> > 
> >   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
> > 
> > are available in the git repository at:
> > 
> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
> > 
> > for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
> > 
> >   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
> > 
> > ----------------------------------------------------------------
> > Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
> > 
> I assume you'll push it all through mfd, correct ?

The idea is for all the affected Maintainers to pull this branch in to
their own trees.  If you guys don't, there will be a good chance of
conflict during the merge-window, which will subsequently upset Linus.

So in answer to your question; yes I'll be taking this, but so should
each of you.

> > ----------------------------------------------------------------
> > Andreas Werner (4):
> >       mfd: menf21bmc: Introduce MEN 14F021P00 BMC MFD Core driver
> >       watchdog: menf21bmc_wdt: Introduce MEN 14F021P00 BMC Watchdog driver
> >       leds: leds-menf21bmc: Introduce MEN 14F021P00 BMC LED driver
> >       hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver
> > 
> >  Documentation/hwmon/menf21bmc    |  50 +++++++++
> >  drivers/hwmon/Kconfig            |  10 ++
> >  drivers/hwmon/Makefile           |   1 +
> >  drivers/hwmon/menf21bmc_hwmon.c  | 230 +++++++++++++++++++++++++++++++++++++++
> >  drivers/leds/Kconfig             |   9 ++
> >  drivers/leds/Makefile            |   1 +
> >  drivers/leds/leds-menf21bmc.c    | 131 ++++++++++++++++++++++
> >  drivers/mfd/Kconfig              |  15 +++
> >  drivers/mfd/Makefile             |   1 +
> >  drivers/mfd/menf21bmc.c          | 132 ++++++++++++++++++++++
> >  drivers/watchdog/Kconfig         |  10 ++
> >  drivers/watchdog/Makefile        |   1 +
> >  drivers/watchdog/menf21bmc_wdt.c | 203 ++++++++++++++++++++++++++++++++++
> >  13 files changed, 794 insertions(+)
> >  create mode 100644 Documentation/hwmon/menf21bmc
> >  create mode 100644 drivers/hwmon/menf21bmc_hwmon.c
> >  create mode 100644 drivers/leds/leds-menf21bmc.c
> >  create mode 100644 drivers/mfd/menf21bmc.c
> >  create mode 100644 drivers/watchdog/menf21bmc_wdt.c
> > 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
@ 2014-09-24 16:18       ` Lee Jones
  0 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-24 16:18 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Andreas Werner, linux-kernel, sameo, lm-sensors, wim,
	linux-watchdog, cooloney, rpurdie, linux-leds

On Wed, 24 Sep 2014, Guenter Roeck wrote:

> On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
> > Guenter, Bryan, Wim,
> > 
> > The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
> > 
> >   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
> > 
> > are available in the git repository at:
> > 
> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
> > 
> > for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
> > 
> >   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
> > 
> > ----------------------------------------------------------------
> > Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
> > 
> I assume you'll push it all through mfd, correct ?

The idea is for all the affected Maintainers to pull this branch in to
their own trees.  If you guys don't, there will be a good chance of
conflict during the merge-window, which will subsequently upset Linus.

So in answer to your question; yes I'll be taking this, but so should
each of you.

> > ----------------------------------------------------------------
> > Andreas Werner (4):
> >       mfd: menf21bmc: Introduce MEN 14F021P00 BMC MFD Core driver
> >       watchdog: menf21bmc_wdt: Introduce MEN 14F021P00 BMC Watchdog driver
> >       leds: leds-menf21bmc: Introduce MEN 14F021P00 BMC LED driver
> >       hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver
> > 
> >  Documentation/hwmon/menf21bmc    |  50 +++++++++
> >  drivers/hwmon/Kconfig            |  10 ++
> >  drivers/hwmon/Makefile           |   1 +
> >  drivers/hwmon/menf21bmc_hwmon.c  | 230 +++++++++++++++++++++++++++++++++++++++
> >  drivers/leds/Kconfig             |   9 ++
> >  drivers/leds/Makefile            |   1 +
> >  drivers/leds/leds-menf21bmc.c    | 131 ++++++++++++++++++++++
> >  drivers/mfd/Kconfig              |  15 +++
> >  drivers/mfd/Makefile             |   1 +
> >  drivers/mfd/menf21bmc.c          | 132 ++++++++++++++++++++++
> >  drivers/watchdog/Kconfig         |  10 ++
> >  drivers/watchdog/Makefile        |   1 +
> >  drivers/watchdog/menf21bmc_wdt.c | 203 ++++++++++++++++++++++++++++++++++
> >  13 files changed, 794 insertions(+)
> >  create mode 100644 Documentation/hwmon/menf21bmc
> >  create mode 100644 drivers/hwmon/menf21bmc_hwmon.c
> >  create mode 100644 drivers/leds/leds-menf21bmc.c
> >  create mode 100644 drivers/mfd/menf21bmc.c
> >  create mode 100644 drivers/watchdog/menf21bmc_wdt.c
> > 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
  2014-09-24 16:18       ` Lee Jones
@ 2014-09-24 16:28         ` Guenter Roeck
  -1 siblings, 0 replies; 71+ messages in thread
From: Guenter Roeck @ 2014-09-24 16:28 UTC (permalink / raw)
  To: Lee Jones
  Cc: Andreas Werner, linux-kernel, sameo, lm-sensors, wim,
	linux-watchdog, cooloney, rpurdie, linux-leds

On Wed, Sep 24, 2014 at 05:18:37PM +0100, Lee Jones wrote:
> On Wed, 24 Sep 2014, Guenter Roeck wrote:
> 
> > On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
> > > Guenter, Bryan, Wim,
> > > 
> > > The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
> > > 
> > >   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
> > > 
> > > are available in the git repository at:
> > > 
> > >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
> > > 
> > > for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
> > > 
> > >   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
> > > 
> > > ----------------------------------------------------------------
> > > Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
> > > 
> > I assume you'll push it all through mfd, correct ?
> 
> The idea is for all the affected Maintainers to pull this branch in to
> their own trees.  If you guys don't, there will be a good chance of
> conflict during the merge-window, which will subsequently upset Linus.
> 
> So in answer to your question; yes I'll be taking this, but so should
> each of you.
> 
No problem with me. Let's see how it goes.

Guenter

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [lm-sensors] [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
@ 2014-09-24 16:28         ` Guenter Roeck
  0 siblings, 0 replies; 71+ messages in thread
From: Guenter Roeck @ 2014-09-24 16:28 UTC (permalink / raw)
  To: Lee Jones
  Cc: sameo, Andreas Werner, cooloney, linux-kernel, lm-sensors, wim,
	rpurdie, linux-leds, linux-watchdog

On Wed, Sep 24, 2014 at 05:18:37PM +0100, Lee Jones wrote:
> On Wed, 24 Sep 2014, Guenter Roeck wrote:
> 
> > On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
> > > Guenter, Bryan, Wim,
> > > 
> > > The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
> > > 
> > >   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
> > > 
> > > are available in the git repository at:
> > > 
> > >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
> > > 
> > > for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
> > > 
> > >   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
> > > 
> > > ----------------------------------------------------------------
> > > Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
> > > 
> > I assume you'll push it all through mfd, correct ?
> 
> The idea is for all the affected Maintainers to pull this branch in to
> their own trees.  If you guys don't, there will be a good chance of
> conflict during the merge-window, which will subsequently upset Linus.
> 
> So in answer to your question; yes I'll be taking this, but so should
> each of you.
> 
No problem with me. Let's see how it goes.

Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
  2014-09-24 16:18       ` Lee Jones
@ 2014-09-24 16:33         ` Bryan Wu
  -1 siblings, 0 replies; 71+ messages in thread
From: Bryan Wu @ 2014-09-24 16:33 UTC (permalink / raw)
  To: Lee Jones
  Cc: Guenter Roeck, Andreas Werner, lkml, Samuel Ortiz, lm-sensors,
	wim, linux-watchdog, rpurdie, Linux LED Subsystem

On Wed, Sep 24, 2014 at 9:18 AM, Lee Jones <lee.jones@linaro.org> wrote:
> On Wed, 24 Sep 2014, Guenter Roeck wrote:
>
>> On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
>> > Guenter, Bryan, Wim,
>> >
>> > The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
>> >
>> >   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
>> >
>> > are available in the git repository at:
>> >
>> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
>> >
>> > for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
>> >
>> >   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
>> >
>> > ----------------------------------------------------------------
>> > Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
>> >
>> I assume you'll push it all through mfd, correct ?
>
> The idea is for all the affected Maintainers to pull this branch in to
> their own trees.  If you guys don't, there will be a good chance of
> conflict during the merge-window, which will subsequently upset Linus.
>
> So in answer to your question; yes I'll be taking this, but so should
> each of you.
>

Thanks for this, man. What am I going to do here? Need I pull in all
the patches here into my LED tree or just one LED patch? I think if
you push this for Linus through MFD tree, I don't need to pull it into
my tree, right?

I was confused, sorry.

-Bryan


>> > ----------------------------------------------------------------
>> > Andreas Werner (4):
>> >       mfd: menf21bmc: Introduce MEN 14F021P00 BMC MFD Core driver
>> >       watchdog: menf21bmc_wdt: Introduce MEN 14F021P00 BMC Watchdog driver
>> >       leds: leds-menf21bmc: Introduce MEN 14F021P00 BMC LED driver
>> >       hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver
>> >
>> >  Documentation/hwmon/menf21bmc    |  50 +++++++++
>> >  drivers/hwmon/Kconfig            |  10 ++
>> >  drivers/hwmon/Makefile           |   1 +
>> >  drivers/hwmon/menf21bmc_hwmon.c  | 230 +++++++++++++++++++++++++++++++++++++++
>> >  drivers/leds/Kconfig             |   9 ++
>> >  drivers/leds/Makefile            |   1 +
>> >  drivers/leds/leds-menf21bmc.c    | 131 ++++++++++++++++++++++
>> >  drivers/mfd/Kconfig              |  15 +++
>> >  drivers/mfd/Makefile             |   1 +
>> >  drivers/mfd/menf21bmc.c          | 132 ++++++++++++++++++++++
>> >  drivers/watchdog/Kconfig         |  10 ++
>> >  drivers/watchdog/Makefile        |   1 +
>> >  drivers/watchdog/menf21bmc_wdt.c | 203 ++++++++++++++++++++++++++++++++++
>> >  13 files changed, 794 insertions(+)
>> >  create mode 100644 Documentation/hwmon/menf21bmc
>> >  create mode 100644 drivers/hwmon/menf21bmc_hwmon.c
>> >  create mode 100644 drivers/leds/leds-menf21bmc.c
>> >  create mode 100644 drivers/mfd/menf21bmc.c
>> >  create mode 100644 drivers/watchdog/menf21bmc_wdt.c
>> >
>
> --
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
@ 2014-09-24 16:33         ` Bryan Wu
  0 siblings, 0 replies; 71+ messages in thread
From: Bryan Wu @ 2014-09-24 16:33 UTC (permalink / raw)
  To: Lee Jones
  Cc: Guenter Roeck, Andreas Werner, lkml, Samuel Ortiz, lm-sensors,
	wim, linux-watchdog, rpurdie, Linux LED Subsystem

On Wed, Sep 24, 2014 at 9:18 AM, Lee Jones <lee.jones@linaro.org> wrote:
> On Wed, 24 Sep 2014, Guenter Roeck wrote:
>
>> On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
>> > Guenter, Bryan, Wim,
>> >
>> > The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
>> >
>> >   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
>> >
>> > are available in the git repository at:
>> >
>> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
>> >
>> > for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
>> >
>> >   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
>> >
>> > ----------------------------------------------------------------
>> > Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
>> >
>> I assume you'll push it all through mfd, correct ?
>
> The idea is for all the affected Maintainers to pull this branch in to
> their own trees.  If you guys don't, there will be a good chance of
> conflict during the merge-window, which will subsequently upset Linus.
>
> So in answer to your question; yes I'll be taking this, but so should
> each of you.
>

Thanks for this, man. What am I going to do here? Need I pull in all
the patches here into my LED tree or just one LED patch? I think if
you push this for Linus through MFD tree, I don't need to pull it into
my tree, right?

I was confused, sorry.

-Bryan


>> > ----------------------------------------------------------------
>> > Andreas Werner (4):
>> >       mfd: menf21bmc: Introduce MEN 14F021P00 BMC MFD Core driver
>> >       watchdog: menf21bmc_wdt: Introduce MEN 14F021P00 BMC Watchdog driver
>> >       leds: leds-menf21bmc: Introduce MEN 14F021P00 BMC LED driver
>> >       hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver
>> >
>> >  Documentation/hwmon/menf21bmc    |  50 +++++++++
>> >  drivers/hwmon/Kconfig            |  10 ++
>> >  drivers/hwmon/Makefile           |   1 +
>> >  drivers/hwmon/menf21bmc_hwmon.c  | 230 +++++++++++++++++++++++++++++++++++++++
>> >  drivers/leds/Kconfig             |   9 ++
>> >  drivers/leds/Makefile            |   1 +
>> >  drivers/leds/leds-menf21bmc.c    | 131 ++++++++++++++++++++++
>> >  drivers/mfd/Kconfig              |  15 +++
>> >  drivers/mfd/Makefile             |   1 +
>> >  drivers/mfd/menf21bmc.c          | 132 ++++++++++++++++++++++
>> >  drivers/watchdog/Kconfig         |  10 ++
>> >  drivers/watchdog/Makefile        |   1 +
>> >  drivers/watchdog/menf21bmc_wdt.c | 203 ++++++++++++++++++++++++++++++++++
>> >  13 files changed, 794 insertions(+)
>> >  create mode 100644 Documentation/hwmon/menf21bmc
>> >  create mode 100644 drivers/hwmon/menf21bmc_hwmon.c
>> >  create mode 100644 drivers/leds/leds-menf21bmc.c
>> >  create mode 100644 drivers/mfd/menf21bmc.c
>> >  create mode 100644 drivers/watchdog/menf21bmc_wdt.c
>> >
>
> --
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
  2014-09-24 16:33         ` Bryan Wu
@ 2014-09-24 16:57           ` Guenter Roeck
  -1 siblings, 0 replies; 71+ messages in thread
From: Guenter Roeck @ 2014-09-24 16:57 UTC (permalink / raw)
  To: Bryan Wu
  Cc: Lee Jones, Andreas Werner, lkml, Samuel Ortiz, lm-sensors, wim,
	linux-watchdog, rpurdie, Linux LED Subsystem

On Wed, Sep 24, 2014 at 09:33:32AM -0700, Bryan Wu wrote:
> On Wed, Sep 24, 2014 at 9:18 AM, Lee Jones <lee.jones@linaro.org> wrote:
> > On Wed, 24 Sep 2014, Guenter Roeck wrote:
> >
> >> On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
> >> > Guenter, Bryan, Wim,
> >> >
> >> > The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
> >> >
> >> >   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
> >> >
> >> > are available in the git repository at:
> >> >
> >> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
> >> >
> >> > for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
> >> >
> >> >   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
> >> >
> >> > ----------------------------------------------------------------
> >> > Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
> >> >
> >> I assume you'll push it all through mfd, correct ?
> >
> > The idea is for all the affected Maintainers to pull this branch in to
> > their own trees.  If you guys don't, there will be a good chance of
> > conflict during the merge-window, which will subsequently upset Linus.
> >
> > So in answer to your question; yes I'll be taking this, but so should
> > each of you.
> >
> 
> Thanks for this, man. What am I going to do here? Need I pull in all
> the patches here into my LED tree or just one LED patch? I think if
> you push this for Linus through MFD tree, I don't need to pull it into
> my tree, right?
> 
I did

git remote add mfd git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
git fetch --tags mfd
git merge mfd-hwmon-leds-watchdog-v3.18

in both my hwmon-next and watchdog-next branches. Both are currently building,
and already pushed into to my repository at kernel.org.

So, effectively, when I send my pull request to Linus, all patches from
mfd-hwmon-leds-watchdog-v3.18 will be included, ie the entire series.
The same will happen when Lee sends his pull request, and Wim, and you. 
I believe that is what Lee is asking for.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [lm-sensors] [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
@ 2014-09-24 16:57           ` Guenter Roeck
  0 siblings, 0 replies; 71+ messages in thread
From: Guenter Roeck @ 2014-09-24 16:57 UTC (permalink / raw)
  To: Bryan Wu
  Cc: Samuel Ortiz, Andreas Werner, lkml, lm-sensors, wim, rpurdie,
	Lee Jones, Linux LED Subsystem, linux-watchdog

On Wed, Sep 24, 2014 at 09:33:32AM -0700, Bryan Wu wrote:
> On Wed, Sep 24, 2014 at 9:18 AM, Lee Jones <lee.jones@linaro.org> wrote:
> > On Wed, 24 Sep 2014, Guenter Roeck wrote:
> >
> >> On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
> >> > Guenter, Bryan, Wim,
> >> >
> >> > The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
> >> >
> >> >   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
> >> >
> >> > are available in the git repository at:
> >> >
> >> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
> >> >
> >> > for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
> >> >
> >> >   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
> >> >
> >> > ----------------------------------------------------------------
> >> > Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
> >> >
> >> I assume you'll push it all through mfd, correct ?
> >
> > The idea is for all the affected Maintainers to pull this branch in to
> > their own trees.  If you guys don't, there will be a good chance of
> > conflict during the merge-window, which will subsequently upset Linus.
> >
> > So in answer to your question; yes I'll be taking this, but so should
> > each of you.
> >
> 
> Thanks for this, man. What am I going to do here? Need I pull in all
> the patches here into my LED tree or just one LED patch? I think if
> you push this for Linus through MFD tree, I don't need to pull it into
> my tree, right?
> 
I did

git remote add mfd git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
git fetch --tags mfd
git merge mfd-hwmon-leds-watchdog-v3.18

in both my hwmon-next and watchdog-next branches. Both are currently building,
and already pushed into to my repository at kernel.org.

So, effectively, when I send my pull request to Linus, all patches from
mfd-hwmon-leds-watchdog-v3.18 will be included, ie the entire series.
The same will happen when Lee sends his pull request, and Wim, and you. 
I believe that is what Lee is asking for.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
  2014-09-24 16:57           ` [lm-sensors] " Guenter Roeck
  (?)
@ 2014-09-24 18:07           ` Bryan Wu
  -1 siblings, 0 replies; 71+ messages in thread
From: Bryan Wu @ 2014-09-24 18:07 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Lee Jones, Andreas Werner, lkml, Samuel Ortiz, lm-sensors, wim,
	linux-watchdog, rpurdie, Linux LED Subsystem

On Wed, Sep 24, 2014 at 9:57 AM, Guenter Roeck <linux@roeck-us.net> wrote:
> On Wed, Sep 24, 2014 at 09:33:32AM -0700, Bryan Wu wrote:
>> On Wed, Sep 24, 2014 at 9:18 AM, Lee Jones <lee.jones@linaro.org> wrote:
>> > On Wed, 24 Sep 2014, Guenter Roeck wrote:
>> >
>> >> On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
>> >> > Guenter, Bryan, Wim,
>> >> >
>> >> > The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
>> >> >
>> >> >   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
>> >> >
>> >> > are available in the git repository at:
>> >> >
>> >> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
>> >> >
>> >> > for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
>> >> >
>> >> >   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
>> >> >
>> >> > ----------------------------------------------------------------
>> >> > Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
>> >> >
>> >> I assume you'll push it all through mfd, correct ?
>> >
>> > The idea is for all the affected Maintainers to pull this branch in to
>> > their own trees.  If you guys don't, there will be a good chance of
>> > conflict during the merge-window, which will subsequently upset Linus.
>> >
>> > So in answer to your question; yes I'll be taking this, but so should
>> > each of you.
>> >
>>
>> Thanks for this, man. What am I going to do here? Need I pull in all
>> the patches here into my LED tree or just one LED patch? I think if
>> you push this for Linus through MFD tree, I don't need to pull it into
>> my tree, right?
>>
> I did
>
> git remote add mfd git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
> git fetch --tags mfd
> git merge mfd-hwmon-leds-watchdog-v3.18
>
> in both my hwmon-next and watchdog-next branches. Both are currently building,
> and already pushed into to my repository at kernel.org.
>
> So, effectively, when I send my pull request to Linus, all patches from
> mfd-hwmon-leds-watchdog-v3.18 will be included, ie the entire series.
> The same will happen when Lee sends his pull request, and Wim, and you.
> I believe that is what Lee is asking for.
>

Great, thanks a lot. I just did the same thing for my leds tree.

-Bryan

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
  2014-09-24 16:57           ` [lm-sensors] " Guenter Roeck
@ 2014-09-24 18:41             ` Lee Jones
  -1 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-24 18:41 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Bryan Wu, Andreas Werner, lkml, Samuel Ortiz, lm-sensors, wim,
	linux-watchdog, rpurdie, Linux LED Subsystem

On Wed, 24 Sep 2014, Guenter Roeck wrote:

> On Wed, Sep 24, 2014 at 09:33:32AM -0700, Bryan Wu wrote:
> > On Wed, Sep 24, 2014 at 9:18 AM, Lee Jones <lee.jones@linaro.org> wrote:
> > > On Wed, 24 Sep 2014, Guenter Roeck wrote:
> > >
> > >> On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
> > >> > Guenter, Bryan, Wim,
> > >> >
> > >> > The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
> > >> >
> > >> >   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
> > >> >
> > >> > are available in the git repository at:
> > >> >
> > >> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
> > >> >
> > >> > for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
> > >> >
> > >> >   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
> > >> >
> > >> > ----------------------------------------------------------------
> > >> > Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
> > >> >
> > >> I assume you'll push it all through mfd, correct ?
> > >
> > > The idea is for all the affected Maintainers to pull this branch in to
> > > their own trees.  If you guys don't, there will be a good chance of
> > > conflict during the merge-window, which will subsequently upset Linus.
> > >
> > > So in answer to your question; yes I'll be taking this, but so should
> > > each of you.
> > >
> > 
> > Thanks for this, man. What am I going to do here? Need I pull in all
> > the patches here into my LED tree or just one LED patch? I think if
> > you push this for Linus through MFD tree, I don't need to pull it into
> > my tree, right?
> > 
> I did
> 
> git remote add mfd git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
> git fetch --tags mfd
> git merge mfd-hwmon-leds-watchdog-v3.18
> 
> in both my hwmon-next and watchdog-next branches. Both are currently building,
> and already pushed into to my repository at kernel.org.
> 
> So, effectively, when I send my pull request to Linus, all patches from
> mfd-hwmon-leds-watchdog-v3.18 will be included, ie the entire series.
> The same will happen when Lee sends his pull request, and Wim, and you. 
> I believe that is what Lee is asking for.

That's right.  It's not okay to break this branch up.  If it was, we
would have been able to apply our respective components into our own
trees from the beginning, but as there are interdependencies, breaking
up the branch could have nasty consequences depending on the order in
which they land in Mainline.  Most likely bisectability will be
broken, which is not allowed.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
@ 2014-09-24 18:41             ` Lee Jones
  0 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-24 18:41 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Bryan Wu, Andreas Werner, lkml, Samuel Ortiz, lm-sensors, wim,
	linux-watchdog, rpurdie, Linux LED Subsystem

On Wed, 24 Sep 2014, Guenter Roeck wrote:

> On Wed, Sep 24, 2014 at 09:33:32AM -0700, Bryan Wu wrote:
> > On Wed, Sep 24, 2014 at 9:18 AM, Lee Jones <lee.jones@linaro.org> wrote:
> > > On Wed, 24 Sep 2014, Guenter Roeck wrote:
> > >
> > >> On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
> > >> > Guenter, Bryan, Wim,
> > >> >
> > >> > The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
> > >> >
> > >> >   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
> > >> >
> > >> > are available in the git repository at:
> > >> >
> > >> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
> > >> >
> > >> > for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
> > >> >
> > >> >   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
> > >> >
> > >> > ----------------------------------------------------------------
> > >> > Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
> > >> >
> > >> I assume you'll push it all through mfd, correct ?
> > >
> > > The idea is for all the affected Maintainers to pull this branch in to
> > > their own trees.  If you guys don't, there will be a good chance of
> > > conflict during the merge-window, which will subsequently upset Linus.
> > >
> > > So in answer to your question; yes I'll be taking this, but so should
> > > each of you.
> > >
> > 
> > Thanks for this, man. What am I going to do here? Need I pull in all
> > the patches here into my LED tree or just one LED patch? I think if
> > you push this for Linus through MFD tree, I don't need to pull it into
> > my tree, right?
> > 
> I did
> 
> git remote add mfd git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
> git fetch --tags mfd
> git merge mfd-hwmon-leds-watchdog-v3.18
> 
> in both my hwmon-next and watchdog-next branches. Both are currently building,
> and already pushed into to my repository at kernel.org.
> 
> So, effectively, when I send my pull request to Linus, all patches from
> mfd-hwmon-leds-watchdog-v3.18 will be included, ie the entire series.
> The same will happen when Lee sends his pull request, and Wim, and you. 
> I believe that is what Lee is asking for.

That's right.  It's not okay to break this branch up.  If it was, we
would have been able to apply our respective components into our own
trees from the beginning, but as there are interdependencies, breaking
up the branch could have nasty consequences depending on the order in
which they land in Mainline.  Most likely bisectability will be
broken, which is not allowed.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
  2014-09-24 18:41             ` Lee Jones
  (?)
@ 2014-09-25  6:58             ` Wim Van Sebroeck
  -1 siblings, 0 replies; 71+ messages in thread
From: Wim Van Sebroeck @ 2014-09-25  6:58 UTC (permalink / raw)
  To: Lee Jones
  Cc: Guenter Roeck, Bryan Wu, Andreas Werner, lkml, Samuel Ortiz,
	lm-sensors, linux-watchdog, rpurdie, Linux LED Subsystem

Hi All,

> On Wed, 24 Sep 2014, Guenter Roeck wrote:
> 
> > On Wed, Sep 24, 2014 at 09:33:32AM -0700, Bryan Wu wrote:
> > > On Wed, Sep 24, 2014 at 9:18 AM, Lee Jones <lee.jones@linaro.org> wrote:
> > > > On Wed, 24 Sep 2014, Guenter Roeck wrote:
> > > >
> > > >> On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
> > > >> > Guenter, Bryan, Wim,
> > > >> >
> > > >> > The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
> > > >> >
> > > >> >   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
> > > >> >
> > > >> > are available in the git repository at:
> > > >> >
> > > >> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
> > > >> >
> > > >> > for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
> > > >> >
> > > >> >   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
> > > >> >
> > > >> > ----------------------------------------------------------------
> > > >> > Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
> > > >> >
> > > >> I assume you'll push it all through mfd, correct ?
> > > >
> > > > The idea is for all the affected Maintainers to pull this branch in to
> > > > their own trees.  If you guys don't, there will be a good chance of
> > > > conflict during the merge-window, which will subsequently upset Linus.
> > > >
> > > > So in answer to your question; yes I'll be taking this, but so should
> > > > each of you.
> > > >
> > > 
> > > Thanks for this, man. What am I going to do here? Need I pull in all
> > > the patches here into my LED tree or just one LED patch? I think if
> > > you push this for Linus through MFD tree, I don't need to pull it into
> > > my tree, right?
> > > 
> > I did
> > 
> > git remote add mfd git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
> > git fetch --tags mfd
> > git merge mfd-hwmon-leds-watchdog-v3.18
> > 
> > in both my hwmon-next and watchdog-next branches. Both are currently building,
> > and already pushed into to my repository at kernel.org.
> > 
> > So, effectively, when I send my pull request to Linus, all patches from
> > mfd-hwmon-leds-watchdog-v3.18 will be included, ie the entire series.
> > The same will happen when Lee sends his pull request, and Wim, and you. 
> > I believe that is what Lee is asking for.
> 
> That's right.  It's not okay to break this branch up.  If it was, we
> would have been able to apply our respective components into our own
> trees from the beginning, but as there are interdependencies, breaking
> up the branch could have nasty consequences depending on the order in
> which they land in Mainline.  Most likely bisectability will be
> broken, which is not allowed.

Added to linux-watchdog-next.

Kind regards,
Wim.

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
  2014-09-25  8:26               ` Andreas Werner
@ 2014-09-25  7:42                 ` Lee Jones
  -1 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-25  7:42 UTC (permalink / raw)
  To: Andreas Werner
  Cc: Guenter Roeck, Bryan Wu, lkml, Samuel Ortiz, lm-sensors, wim,
	linux-watchdog, rpurdie, Linux LED Subsystem

On Thu, 25 Sep 2014, Andreas Werner wrote:
> On Wed, Sep 24, 2014 at 07:41:43PM +0100, Lee Jones wrote:
> > On Wed, 24 Sep 2014, Guenter Roeck wrote:
> > 
> > > On Wed, Sep 24, 2014 at 09:33:32AM -0700, Bryan Wu wrote:
> > > > On Wed, Sep 24, 2014 at 9:18 AM, Lee Jones <lee.jones@linaro.org> wrote:
> > > > > On Wed, 24 Sep 2014, Guenter Roeck wrote:
> > > > >
> > > > >> On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
> > > > >> > Guenter, Bryan, Wim,
> > > > >> >
> > > > >> > The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
> > > > >> >
> > > > >> >   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
> > > > >> >
> > > > >> > are available in the git repository at:
> > > > >> >
> > > > >> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
> > > > >> >
> > > > >> > for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
> > > > >> >
> > > > >> >   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
> > > > >> >
> > > > >> > ----------------------------------------------------------------
> > > > >> > Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
> > > > >> >
> > > > >> I assume you'll push it all through mfd, correct ?
> > > > >
> > > > > The idea is for all the affected Maintainers to pull this branch in to
> > > > > their own trees.  If you guys don't, there will be a good chance of
> > > > > conflict during the merge-window, which will subsequently upset Linus.
> > > > >
> > > > > So in answer to your question; yes I'll be taking this, but so should
> > > > > each of you.
> > > > >
> > > > 
> > > > Thanks for this, man. What am I going to do here? Need I pull in all
> > > > the patches here into my LED tree or just one LED patch? I think if
> > > > you push this for Linus through MFD tree, I don't need to pull it into
> > > > my tree, right?
> > > > 
> > > I did
> > > 
> > > git remote add mfd git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
> > > git fetch --tags mfd
> > > git merge mfd-hwmon-leds-watchdog-v3.18
> > > 
> > > in both my hwmon-next and watchdog-next branches. Both are currently building,
> > > and already pushed into to my repository at kernel.org.
> > > 
> > > So, effectively, when I send my pull request to Linus, all patches from
> > > mfd-hwmon-leds-watchdog-v3.18 will be included, ie the entire series.
> > > The same will happen when Lee sends his pull request, and Wim, and you. 
> > > I believe that is what Lee is asking for.
> > 
> > That's right.  It's not okay to break this branch up.  If it was, we
> > would have been able to apply our respective components into our own
> > trees from the beginning, but as there are interdependencies, breaking
> > up the branch could have nasty consequences depending on the order in
> > which they land in Mainline.  Most likely bisectability will be
> > broken, which is not allowed.
> > 
> 
> Hi,
> please do not forget the MAINTAINERS Patch for this series.
> I have send it last week attached to this series.

I'll take this through the MFD tree with everyone's Ack.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
@ 2014-09-25  7:42                 ` Lee Jones
  0 siblings, 0 replies; 71+ messages in thread
From: Lee Jones @ 2014-09-25  7:42 UTC (permalink / raw)
  To: Andreas Werner
  Cc: Guenter Roeck, Bryan Wu, lkml, Samuel Ortiz, lm-sensors, wim,
	linux-watchdog, rpurdie, Linux LED Subsystem

On Thu, 25 Sep 2014, Andreas Werner wrote:
> On Wed, Sep 24, 2014 at 07:41:43PM +0100, Lee Jones wrote:
> > On Wed, 24 Sep 2014, Guenter Roeck wrote:
> > 
> > > On Wed, Sep 24, 2014 at 09:33:32AM -0700, Bryan Wu wrote:
> > > > On Wed, Sep 24, 2014 at 9:18 AM, Lee Jones <lee.jones@linaro.org> wrote:
> > > > > On Wed, 24 Sep 2014, Guenter Roeck wrote:
> > > > >
> > > > >> On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
> > > > >> > Guenter, Bryan, Wim,
> > > > >> >
> > > > >> > The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
> > > > >> >
> > > > >> >   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
> > > > >> >
> > > > >> > are available in the git repository at:
> > > > >> >
> > > > >> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
> > > > >> >
> > > > >> > for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
> > > > >> >
> > > > >> >   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
> > > > >> >
> > > > >> > ----------------------------------------------------------------
> > > > >> > Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
> > > > >> >
> > > > >> I assume you'll push it all through mfd, correct ?
> > > > >
> > > > > The idea is for all the affected Maintainers to pull this branch in to
> > > > > their own trees.  If you guys don't, there will be a good chance of
> > > > > conflict during the merge-window, which will subsequently upset Linus.
> > > > >
> > > > > So in answer to your question; yes I'll be taking this, but so should
> > > > > each of you.
> > > > >
> > > > 
> > > > Thanks for this, man. What am I going to do here? Need I pull in all
> > > > the patches here into my LED tree or just one LED patch? I think if
> > > > you push this for Linus through MFD tree, I don't need to pull it into
> > > > my tree, right?
> > > > 
> > > I did
> > > 
> > > git remote add mfd git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
> > > git fetch --tags mfd
> > > git merge mfd-hwmon-leds-watchdog-v3.18
> > > 
> > > in both my hwmon-next and watchdog-next branches. Both are currently building,
> > > and already pushed into to my repository at kernel.org.
> > > 
> > > So, effectively, when I send my pull request to Linus, all patches from
> > > mfd-hwmon-leds-watchdog-v3.18 will be included, ie the entire series.
> > > The same will happen when Lee sends his pull request, and Wim, and you. 
> > > I believe that is what Lee is asking for.
> > 
> > That's right.  It's not okay to break this branch up.  If it was, we
> > would have been able to apply our respective components into our own
> > trees from the beginning, but as there are interdependencies, breaking
> > up the branch could have nasty consequences depending on the order in
> > which they land in Mainline.  Most likely bisectability will be
> > broken, which is not allowed.
> > 
> 
> Hi,
> please do not forget the MAINTAINERS Patch for this series.
> I have send it last week attached to this series.

I'll take this through the MFD tree with everyone's Ack.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
  2014-09-24 18:41             ` Lee Jones
  (?)
@ 2014-09-25  8:26               ` Andreas Werner
  -1 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-09-25  8:26 UTC (permalink / raw)
  To: Lee Jones
  Cc: Guenter Roeck, Bryan Wu, Andreas Werner, lkml, Samuel Ortiz,
	lm-sensors, wim, linux-watchdog, rpurdie, Linux LED Subsystem

On Wed, Sep 24, 2014 at 07:41:43PM +0100, Lee Jones wrote:
> On Wed, 24 Sep 2014, Guenter Roeck wrote:
> 
> > On Wed, Sep 24, 2014 at 09:33:32AM -0700, Bryan Wu wrote:
> > > On Wed, Sep 24, 2014 at 9:18 AM, Lee Jones <lee.jones@linaro.org> wrote:
> > > > On Wed, 24 Sep 2014, Guenter Roeck wrote:
> > > >
> > > >> On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
> > > >> > Guenter, Bryan, Wim,
> > > >> >
> > > >> > The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
> > > >> >
> > > >> >   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
> > > >> >
> > > >> > are available in the git repository at:
> > > >> >
> > > >> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
> > > >> >
> > > >> > for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
> > > >> >
> > > >> >   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
> > > >> >
> > > >> > ----------------------------------------------------------------
> > > >> > Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
> > > >> >
> > > >> I assume you'll push it all through mfd, correct ?
> > > >
> > > > The idea is for all the affected Maintainers to pull this branch in to
> > > > their own trees.  If you guys don't, there will be a good chance of
> > > > conflict during the merge-window, which will subsequently upset Linus.
> > > >
> > > > So in answer to your question; yes I'll be taking this, but so should
> > > > each of you.
> > > >
> > > 
> > > Thanks for this, man. What am I going to do here? Need I pull in all
> > > the patches here into my LED tree or just one LED patch? I think if
> > > you push this for Linus through MFD tree, I don't need to pull it into
> > > my tree, right?
> > > 
> > I did
> > 
> > git remote add mfd git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
> > git fetch --tags mfd
> > git merge mfd-hwmon-leds-watchdog-v3.18
> > 
> > in both my hwmon-next and watchdog-next branches. Both are currently building,
> > and already pushed into to my repository at kernel.org.
> > 
> > So, effectively, when I send my pull request to Linus, all patches from
> > mfd-hwmon-leds-watchdog-v3.18 will be included, ie the entire series.
> > The same will happen when Lee sends his pull request, and Wim, and you. 
> > I believe that is what Lee is asking for.
> 
> That's right.  It's not okay to break this branch up.  If it was, we
> would have been able to apply our respective components into our own
> trees from the beginning, but as there are interdependencies, breaking
> up the branch could have nasty consequences depending on the order in
> which they land in Mainline.  Most likely bisectability will be
> broken, which is not allowed.
> 

Hi,
please do not forget the MAINTAINERS Patch for this series.
I have send it last week attached to this series.

Thanks

Regards
Andy

> -- 
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
@ 2014-09-25  8:26               ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-09-25  8:26 UTC (permalink / raw)
  To: Lee Jones
  Cc: Guenter Roeck, Bryan Wu, Andreas Werner, lkml, Samuel Ortiz,
	lm-sensors, wim, linux-watchdog, rpurdie, Linux LED Subsystem

On Wed, Sep 24, 2014 at 07:41:43PM +0100, Lee Jones wrote:
> On Wed, 24 Sep 2014, Guenter Roeck wrote:
> 
> > On Wed, Sep 24, 2014 at 09:33:32AM -0700, Bryan Wu wrote:
> > > On Wed, Sep 24, 2014 at 9:18 AM, Lee Jones <lee.jones@linaro.org> wrote:
> > > > On Wed, 24 Sep 2014, Guenter Roeck wrote:
> > > >
> > > >> On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
> > > >> > Guenter, Bryan, Wim,
> > > >> >
> > > >> > The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
> > > >> >
> > > >> >   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
> > > >> >
> > > >> > are available in the git repository at:
> > > >> >
> > > >> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
> > > >> >
> > > >> > for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
> > > >> >
> > > >> >   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
> > > >> >
> > > >> > ----------------------------------------------------------------
> > > >> > Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
> > > >> >
> > > >> I assume you'll push it all through mfd, correct ?
> > > >
> > > > The idea is for all the affected Maintainers to pull this branch in to
> > > > their own trees.  If you guys don't, there will be a good chance of
> > > > conflict during the merge-window, which will subsequently upset Linus.
> > > >
> > > > So in answer to your question; yes I'll be taking this, but so should
> > > > each of you.
> > > >
> > > 
> > > Thanks for this, man. What am I going to do here? Need I pull in all
> > > the patches here into my LED tree or just one LED patch? I think if
> > > you push this for Linus through MFD tree, I don't need to pull it into
> > > my tree, right?
> > > 
> > I did
> > 
> > git remote add mfd git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
> > git fetch --tags mfd
> > git merge mfd-hwmon-leds-watchdog-v3.18
> > 
> > in both my hwmon-next and watchdog-next branches. Both are currently building,
> > and already pushed into to my repository at kernel.org.
> > 
> > So, effectively, when I send my pull request to Linus, all patches from
> > mfd-hwmon-leds-watchdog-v3.18 will be included, ie the entire series.
> > The same will happen when Lee sends his pull request, and Wim, and you. 
> > I believe that is what Lee is asking for.
> 
> That's right.  It's not okay to break this branch up.  If it was, we
> would have been able to apply our respective components into our own
> trees from the beginning, but as there are interdependencies, breaking
> up the branch could have nasty consequences depending on the order in
> which they land in Mainline.  Most likely bisectability will be
> broken, which is not allowed.
> 

Hi,
please do not forget the MAINTAINERS Patch for this series.
I have send it last week attached to this series.

Thanks

Regards
Andy

> -- 
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog


^ permalink raw reply	[flat|nested] 71+ messages in thread

* Re: [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series
@ 2014-09-25  8:26               ` Andreas Werner
  0 siblings, 0 replies; 71+ messages in thread
From: Andreas Werner @ 2014-09-25  8:26 UTC (permalink / raw)
  To: Lee Jones
  Cc: Guenter Roeck, Bryan Wu, Andreas Werner, lkml, Samuel Ortiz,
	lm-sensors, wim, linux-watchdog, rpurdie, Linux LED Subsystem

On Wed, Sep 24, 2014 at 07:41:43PM +0100, Lee Jones wrote:
> On Wed, 24 Sep 2014, Guenter Roeck wrote:
> 
> > On Wed, Sep 24, 2014 at 09:33:32AM -0700, Bryan Wu wrote:
> > > On Wed, Sep 24, 2014 at 9:18 AM, Lee Jones <lee.jones@linaro.org> wrote:
> > > > On Wed, 24 Sep 2014, Guenter Roeck wrote:
> > > >
> > > >> On Wed, Sep 24, 2014 at 03:48:29PM +0100, Lee Jones wrote:
> > > >> > Guenter, Bryan, Wim,
> > > >> >
> > > >> > The following changes since commit 52addcf9d6669fa439387610bc65c92fa0980cef:
> > > >> >
> > > >> >   Linux 3.17-rc2 (2014-08-25 15:36:20 -0700)
> > > >> >
> > > >> > are available in the git repository at:
> > > >> >
> > > >> >   git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git tags/mfd-hwmon-leds-watchdog-v3.18
> > > >> >
> > > >> > for you to fetch changes up to 964356938fcd3c0001a786f55b9f0a0fbe47656a:
> > > >> >
> > > >> >   hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver (2014-09-24 15:36:33 +0100)
> > > >> >
> > > >> > ----------------------------------------------------------------
> > > >> > Immutable branch between MFD, HWMON, LEDs and Watchdog for v3.18
> > > >> >
> > > >> I assume you'll push it all through mfd, correct ?
> > > >
> > > > The idea is for all the affected Maintainers to pull this branch in to
> > > > their own trees.  If you guys don't, there will be a good chance of
> > > > conflict during the merge-window, which will subsequently upset Linus.
> > > >
> > > > So in answer to your question; yes I'll be taking this, but so should
> > > > each of you.
> > > >
> > > 
> > > Thanks for this, man. What am I going to do here? Need I pull in all
> > > the patches here into my LED tree or just one LED patch? I think if
> > > you push this for Linus through MFD tree, I don't need to pull it into
> > > my tree, right?
> > > 
> > I did
> > 
> > git remote add mfd git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
> > git fetch --tags mfd
> > git merge mfd-hwmon-leds-watchdog-v3.18
> > 
> > in both my hwmon-next and watchdog-next branches. Both are currently building,
> > and already pushed into to my repository at kernel.org.
> > 
> > So, effectively, when I send my pull request to Linus, all patches from
> > mfd-hwmon-leds-watchdog-v3.18 will be included, ie the entire series.
> > The same will happen when Lee sends his pull request, and Wim, and you. 
> > I believe that is what Lee is asking for.
> 
> That's right.  It's not okay to break this branch up.  If it was, we
> would have been able to apply our respective components into our own
> trees from the beginning, but as there are interdependencies, breaking
> up the branch could have nasty consequences depending on the order in
> which they land in Mainline.  Most likely bisectability will be
> broken, which is not allowed.
> 

Hi,
please do not forget the MAINTAINERS Patch for this series.
I have send it last week attached to this series.

Thanks

Regards
Andy

> -- 
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog

--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 71+ messages in thread

end of thread, other threads:[~2014-09-25  7:42 UTC | newest]

Thread overview: 71+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-27 17:51 [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series Andreas Werner
2014-08-27 17:51 ` [lm-sensors] " Andreas Werner
2014-08-27 17:51 ` Andreas Werner
2014-08-27 17:51 ` [PATCH v6 1/4] drivers/mfd/menf21bmc: introduce MEN 14F021P00 BMC MFD Core driver Andreas Werner
2014-08-27 17:51   ` [lm-sensors] " Andreas Werner
2014-08-27 17:51   ` Andreas Werner
2014-08-28  7:37   ` Lee Jones
2014-08-28  7:37     ` [lm-sensors] " Lee Jones
2014-08-28  7:37     ` Lee Jones
2014-08-27 17:52 ` [PATCH v6 2/4] drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog driver Andreas Werner
2014-08-27 17:52   ` [lm-sensors] [PATCH v6 2/4] drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog dri Andreas Werner
2014-08-27 17:52   ` [PATCH v6 2/4] drivers/watchdog/menf21bmc_wdt: introduce MEN 14F021P00 BMC Watchdog driver Andreas Werner
2014-09-04  9:14   ` Lee Jones
2014-09-04  9:14     ` Lee Jones
2014-09-24 12:35   ` Lee Jones
2014-09-24 12:35     ` Lee Jones
2014-09-24 13:24     ` Guenter Roeck
2014-09-24 14:13       ` Lee Jones
2014-09-24 14:13         ` Lee Jones
2014-09-24 14:14         ` Lee Jones
2014-09-24 14:14           ` Lee Jones
2014-08-27 17:52 ` [PATCH v6 3/4] drivers/leds/leds-menf21bmc: introduce MEN 14F021P00 BMC LED driver Andreas Werner
2014-08-27 17:52   ` [lm-sensors] " Andreas Werner
2014-08-27 17:52   ` Andreas Werner
2014-08-28 17:54   ` Bryan Wu
2014-08-28 17:54     ` [lm-sensors] " Bryan Wu
2014-08-29  6:59     ` Lee Jones
2014-08-29  6:59       ` [lm-sensors] " Lee Jones
2014-08-29  6:59       ` Lee Jones
2014-08-29 11:38       ` Andreas Werner
2014-08-29 11:38         ` [lm-sensors] " Andreas Werner
2014-08-29 11:38         ` Andreas Werner
2014-08-29 11:38         ` Andreas Werner
2014-08-29 10:59         ` Lee Jones
2014-08-29 10:59           ` [lm-sensors] " Lee Jones
2014-08-27 17:53 ` [PATCH v6 4/4] drivers/hwmon/menf21bmc_hwmon: introduce MEN14F021P00 BMC HWMON driver Andreas Werner
2014-08-27 17:53   ` [lm-sensors] " Andreas Werner
2014-08-27 17:53   ` Andreas Werner
2014-08-27 18:38   ` Guenter Roeck
2014-08-27 18:38     ` [lm-sensors] [PATCH v6 4/4] drivers/hwmon/menf21bmc_hwmon: introduce MEN14F021P00 BMC HWMON driv Guenter Roeck
2014-08-28  8:16     ` [PATCH v6 4/4] drivers/hwmon/menf21bmc_hwmon: introduce MEN14F021P00 BMC HWMON driver Andreas Werner
2014-08-28  8:16       ` [lm-sensors] [PATCH v6 4/4] drivers/hwmon/menf21bmc_hwmon: introduce MEN14F021P00 BMC HWMON driv Andreas Werner
2014-08-28  8:16       ` [PATCH v6 4/4] drivers/hwmon/menf21bmc_hwmon: introduce MEN14F021P00 BMC HWMON driver Andreas Werner
2014-09-15  7:36 ` [PATCH] MAINTAINERS: Adds Andreas Werner to maintainers list for MEN F21BMC Andreas Werner
2014-09-15 22:42   ` Lee Jones
2014-09-16  8:22     ` Andreas Werner
2014-09-24 13:45 ` [GIT PULL] Immutable branch between MFD, HWMON, LEDs and Watchdog Lee Jones
2014-09-24 13:45   ` Lee Jones
2014-09-24 14:48 ` [PATCH v6 0/4] Introduce MEN 14F021P00 BMC driver series Lee Jones
2014-09-24 14:48   ` Lee Jones
2014-09-24 15:45   ` Guenter Roeck
2014-09-24 15:45     ` [lm-sensors] " Guenter Roeck
2014-09-24 16:18     ` Lee Jones
2014-09-24 16:18       ` Lee Jones
2014-09-24 16:28       ` Guenter Roeck
2014-09-24 16:28         ` [lm-sensors] " Guenter Roeck
2014-09-24 16:33       ` Bryan Wu
2014-09-24 16:33         ` Bryan Wu
2014-09-24 16:57         ` Guenter Roeck
2014-09-24 16:57           ` [lm-sensors] " Guenter Roeck
2014-09-24 18:07           ` Bryan Wu
2014-09-24 18:41           ` Lee Jones
2014-09-24 18:41             ` Lee Jones
2014-09-25  6:58             ` Wim Van Sebroeck
2014-09-25  8:26             ` Andreas Werner
2014-09-25  8:26               ` Andreas Werner
2014-09-25  8:26               ` Andreas Werner
2014-09-25  7:42               ` Lee Jones
2014-09-25  7:42                 ` Lee Jones
2014-09-24 14:49 ` [GIT PULL] MFD: Immutable branch between HWMON, LEDs and Watchdog Lee Jones
2014-09-24 14:49   ` Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.