Re: [PATCH v3 2/2] devicetree: hwmon: Add documentation for TMP108 driver.

2016-12-01 Thread Guenter Roeck

On 12/01/2016 06:32 PM, John Muir wrote:

Simple hwmon binding documentation.

Signed-off-by: John Muir 


Straightforward, so I'll apply it w/o waiting for confirmation from the DT 
maintainers
(Rob - please scream if that is unacceptable).

Thanks,
Guenter


---
 Documentation/devicetree/bindings/hwmon/tmp108.txt | 14 ++
 1 file changed, 14 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/tmp108.txt

diff --git a/Documentation/devicetree/bindings/hwmon/tmp108.txt 
b/Documentation/devicetree/bindings/hwmon/tmp108.txt
new file mode 100644
index 000..8c4b10d
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/tmp108.txt
@@ -0,0 +1,14 @@
+TMP108 temperature sensor
+-
+
+This device supports I2C only.
+
+Requires node properties:
+- compatible : "ti,tmp108"
+- reg : the I2C address of the device. This is 0x48, 0x49, 0x4a, or 0x4b.
+
+Example:
+   tmp108@48 {
+   compatible = "ti,tmp108";
+   reg = <0x48>;
+   };



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


Re: [PATCH v3 1/2] hwmon: Add Texas Instruments TMP108 temperature sensor driver.

2016-12-01 Thread Guenter Roeck

On 12/01/2016 06:32 PM, John Muir wrote:

Add support for the TI TMP108 temperature sensor with some device
configuration parameters.

Signed-off-by: John Muir 


Nice job. Applied to -next, with a small fixup - see below.

Thanks!
Guenter


---


[ ... ]


+
+#ifdef CONFIG_OF
+static const struct of_device_id tmp108_of_ids[] = {
+   { .compatible = "ti,tmp108", },
+   {}
+};
+MODULE_DEVICE_TABLE(of, tmp108_of_ids);
+#endif
+
+static struct i2c_driver tmp108_driver = {
+   .driver.name= DRIVER_NAME,
+   .driver.pm  = _dev_pm_ops,


Made this
.driver = {
.name   = DRIVER_NAME,
.pm = _dev_pm_ops,
.of_match_table = of_match_ptr(tmp108_of_ids),
},


+   .probe  = tmp108_probe,
+   .id_table   = tmp108_i2c_ids,
+};
+
+module_i2c_driver(tmp108_driver);
+
+MODULE_AUTHOR("John Muir ");
+MODULE_DESCRIPTION("Texas Instruments TMP108 temperature sensor driver");
+MODULE_LICENSE("GPL");



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


[PATCH v3 2/2] devicetree: hwmon: Add documentation for TMP108 driver.

2016-12-01 Thread John Muir
Simple hwmon binding documentation.

Signed-off-by: John Muir 
---
 Documentation/devicetree/bindings/hwmon/tmp108.txt | 14 ++
 1 file changed, 14 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/tmp108.txt

diff --git a/Documentation/devicetree/bindings/hwmon/tmp108.txt 
b/Documentation/devicetree/bindings/hwmon/tmp108.txt
new file mode 100644
index 000..8c4b10d
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/tmp108.txt
@@ -0,0 +1,14 @@
+TMP108 temperature sensor
+-
+
+This device supports I2C only.
+
+Requires node properties:
+- compatible : "ti,tmp108"
+- reg : the I2C address of the device. This is 0x48, 0x49, 0x4a, or 0x4b.
+
+Example:
+   tmp108@48 {
+   compatible = "ti,tmp108";
+   reg = <0x48>;
+   };
-- 
2.8.0.rc3.226.g39d4020

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


[PATCH v3 1/2] hwmon: Add Texas Instruments TMP108 temperature sensor driver.

2016-12-01 Thread John Muir
Add support for the TI TMP108 temperature sensor with some device
configuration parameters.

Signed-off-by: John Muir 
---
 Documentation/hwmon/tmp108 |  36 
 drivers/hwmon/Kconfig  |  11 ++
 drivers/hwmon/Makefile |   1 +
 drivers/hwmon/tmp108.c | 466 +
 4 files changed, 514 insertions(+)
 create mode 100644 Documentation/hwmon/tmp108
 create mode 100644 drivers/hwmon/tmp108.c

diff --git a/Documentation/hwmon/tmp108 b/Documentation/hwmon/tmp108
new file mode 100644
index 000..25802df
--- /dev/null
+++ b/Documentation/hwmon/tmp108
@@ -0,0 +1,36 @@
+Kernel driver tmp108
+
+
+Supported chips:
+  * Texas Instruments TMP108
+Prefix: 'tmp108'
+Addresses scanned: none
+Datasheet: http://www.ti.com/product/tmp108
+
+Author:
+   John Muir 
+
+Description
+---
+
+The Texas Instruments TMP108 implements one temperature sensor. An alert pin
+can be set when temperatures exceed minimum or maximum values plus or minus a
+hysteresis value. (This driver does not support interrupts for the alert pin,
+and the device runs in comparator mode.)
+
+The sensor is accurate to 0.75C over the range of -25 to +85 C, and to 1.0
+degree from -40 to +125 C. Resolution of the sensor is 0.0625 degree. The
+operating temperature has a minimum of -55 C and a maximum of +150 C.
+Hysteresis values can be set to 0, 1, 2, or 4C.
+
+The TMP108 has a programmable update rate that can select between 8, 4, 1, and
+0.5 Hz.
+
+By default the TMP108 reads the temperature continuously. To conserve power,
+the TMP108 has a one-shot mode where the device is normally shut-down. When a
+one shot is requested the temperature is read, the result can be retrieved,
+and then the device is shut down automatically. (This driver only supports
+continuous mode.)
+
+The driver provides the common sysfs-interface for temperatures (see
+Documentation/hwmon/sysfs-interface under Temperatures).
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 45cef3d..4c173de 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -1591,6 +1591,17 @@ config SENSORS_TMP103
  This driver can also be built as a module.  If so, the module
  will be called tmp103.
 
+config SENSORS_TMP108
+   tristate "Texas Instruments TMP108"
+   depends on I2C
+   select REGMAP_I2C
+   help
+ If you say yes here you get support for Texas Instruments TMP108
+ sensor chips.
+
+ This driver can also be built as a module.  If so, the module
+ will be called tmp108.
+
 config SENSORS_TMP401
tristate "Texas Instruments TMP401 and compatibles"
depends on I2C
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
index aecf4ba..51e5256 100644
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
@@ -152,6 +152,7 @@ obj-$(CONFIG_SENSORS_TC74)  += tc74.o
 obj-$(CONFIG_SENSORS_THMC50)   += thmc50.o
 obj-$(CONFIG_SENSORS_TMP102)   += tmp102.o
 obj-$(CONFIG_SENSORS_TMP103)   += tmp103.o
+obj-$(CONFIG_SENSORS_TMP108)   += tmp108.o
 obj-$(CONFIG_SENSORS_TMP401)   += tmp401.o
 obj-$(CONFIG_SENSORS_TMP421)   += tmp421.o
 obj-$(CONFIG_SENSORS_TWL4030_MADC)+= twl4030-madc-hwmon.o
diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c
new file mode 100644
index 000..895ae82
--- /dev/null
+++ b/drivers/hwmon/tmp108.c
@@ -0,0 +1,466 @@
+/* Texas Instruments TMP108 SMBus temperature sensor driver
+ *
+ * Copyright (C) 2016 John Muir 
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#defineDRIVER_NAME "tmp108"
+
+#defineTMP108_REG_TEMP 0x00
+#defineTMP108_REG_CONF 0x01
+#defineTMP108_REG_TLOW 0x02
+#defineTMP108_REG_THIGH0x03
+
+#define TMP108_TEMP_MIN_MC -5 /* Minimum millicelcius. */
+#define TMP108_TEMP_MAX_MC 127937 /* Maximum millicelcius. */
+
+/* Configuration register bits.
+ * Note: these bit definitions are byte swapped.
+ */
+#define TMP108_CONF_M0 0x0100 /* Sensor mode. */
+#define TMP108_CONF_M1 0x0200
+#define TMP108_CONF_TM 0x0400 /* Thermostat mode. */
+#define TMP108_CONF_FL 0x0800 /* Watchdog flag - TLOW */
+#define TMP108_CONF_FH 0x1000 /* Watchdog flag - THIGH */
+#define TMP108_CONF_CR0 

[PATCH v3 0/2] Texas Instruments TMP108 temperature sensor driver.

2016-12-01 Thread John Muir
This adds a device driver for the Texas Instruments TMP108 temperature
sensor. The driver provides support to read the temperature, read or modify
the update interval, min and max temperature and hysteresis values, as well
as read current alarm status. Support for alarm interrupts will come in a
future patch.

John Muir (2):
  hwmon: Add Texas Instruments TMP108 temperature sensor driver.
  devicetree: hwmon: Add documentation for TMP108 driver.

 Documentation/devicetree/bindings/hwmon/tmp108.txt |  14 +
 Documentation/hwmon/tmp108 |  36 ++
 drivers/hwmon/Kconfig  |  11 +
 drivers/hwmon/Makefile |   1 +
 drivers/hwmon/tmp108.c | 466 +
 5 files changed, 528 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/tmp108.txt
 create mode 100644 Documentation/hwmon/tmp108
 create mode 100644 drivers/hwmon/tmp108.c

-- 
2.8.0.rc3.226.g39d4020

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


Re: [PATCH v8 3/8] thunderbolt: Communication with the ICM (firmware)

2016-12-01 Thread Andy Lutomirski

On 09/28/2016 07:44 AM, Amir Levy wrote:

This patch provides the communication protocol between the
Intel Connection Manager(ICM) firmware that is operational in the
Thunderbolt controller in non-Apple hardware.
The ICM firmware-based controller is used for establishing and maintaining
the Thunderbolt Networking connection - we need to be able to communicate
with it.


I'm a bit late to the party, but here goes.  I have two big questions:

1. Why is this using netlink at all?  A system has zero or more 
Thunderbolt controllers, they're probed just like any other PCI devices 
(by nhi_probe() if I'm understanding correctly), they'll have nodes in 
sysfs, etc.  Shouldn't there be a simple char device per Thunderbolt 
controller that a daemon can connect to?  This will clean up lots of things:


a) You can actually enforce one-daemon-at-a-time in a very natural way. 
Your current code seems to try, but it's rather buggy.  Your 
subscription count is a guess, your unsubscribe is entirely unchecked, 
and you are entirely unable to detect if a daemon crashes AFAICT.


b) You won't need all of the complexity that's currently there to figure 
out *which* Thunderbolt device a daemon is talking to.


c) You can use regular ioctl passing *structs* instead of netlink attrs. 
 There's nothing wrong with netlink attrs, except that your driver 
seems to have a whole lot of boilerplate that just converts back and 
forth to regular structures.


d) The userspace code that does stuff like "send message, wait 150ms, 
receive reply, complain if no reply" goes away because ioctl is 
synchronous.  (Or you can use read and write, but it's still simpler.)


e) You could have one daemon per Thunderbolt device if you were so inclined.

f) You get privilege separation in userspace.  Creating a netlink socket 
and dropping privilege is busted^Winteresting.  Opening a device node 
and dropping privilege works quite nicely.


2. Why do you need a daemon anyway.  Functionally, what exactly does it 
do?  (Okay, I get that it seems to talk to a giant pile of code running 
in SMM, and I get that Intel, for some bizarre reason, wants everyone 
except Apple to use this code in SMM, and that Apple (for entirely 
understandable reasons) turned it off, but that's beside the point. 
What does the user code do that's useful and that the kernel can't do 
all by itself?  The only really interesting bit I can see is the part 
that approves PCI devices.




I'm not going to review this in detail, but here's a tiny bit:


+static int nhi_genl_unsubscribe(__always_unused struct sk_buff *u_skb,
+   __always_unused struct genl_info *info)
+{
+   atomic_dec_if_positive();
+
+   return 0;
+}
+


This, for example, is really quite buggy.



This entire function here:


+static int nhi_genl_query_information(__always_unused struct sk_buff *u_skb,
+ struct genl_info *info)
+{
+   struct tbt_nhi_ctxt *nhi_ctxt;
+   struct sk_buff *skb;
+   bool msg_too_long;
+   int res = -ENODEV;
+   u32 *msg_head;
+
+   if (!info || !info->userhdr)
+   return -EINVAL;
+
+   skb = genlmsg_new(NLMSG_ALIGN(nhi_genl_family.hdrsize) +
+ nla_total_size(sizeof(DRV_VERSION)) +
+ nla_total_size(sizeof(nhi_ctxt->nvm_ver_offset)) +
+ nla_total_size(sizeof(nhi_ctxt->num_ports)) +
+ nla_total_size(sizeof(nhi_ctxt->dma_port)) +
+ nla_total_size(0),/* nhi_ctxt->support_full_e2e */
+ GFP_KERNEL);
+   if (!skb)
+   return -ENOMEM;
+
+   msg_head = genlmsg_put_reply(skb, info, _genl_family, 0,
+NHI_CMD_QUERY_INFORMATION);
+   if (!msg_head) {
+   res = -ENOMEM;
+   goto genl_put_reply_failure;
+   }
+
+   if (mutex_lock_interruptible(_list_mutex)) {
+   res = -ERESTART;
+   goto genl_put_reply_failure;
+   }
+
+   nhi_ctxt = nhi_search_ctxt(*(u32 *)info->userhdr);
+   if (nhi_ctxt && !nhi_ctxt->d0_exit) {
+   *msg_head = nhi_ctxt->id;
+
+   msg_too_long = !!nla_put_string(skb, NHI_ATTR_DRV_VERSION,
+   DRV_VERSION);
+
+   msg_too_long = msg_too_long ||
+  nla_put_u16(skb, NHI_ATTR_NVM_VER_OFFSET,
+  nhi_ctxt->nvm_ver_offset);
+
+   msg_too_long = msg_too_long ||
+  nla_put_u8(skb, NHI_ATTR_NUM_PORTS,
+ nhi_ctxt->num_ports);
+
+   msg_too_long = msg_too_long ||
+  nla_put_u8(skb, NHI_ATTR_DMA_PORT,
+ nhi_ctxt->dma_port);
+
+   if (msg_too_long) {
+   res = -EMSGSIZE;
+  

Re: [PATCH 1/2] hwmon: Add Texas Instruments TMP108 temperature sensor driver.

2016-12-01 Thread John Muir
Hi Guenter,

On Dec 1, 2016, at 2:08 PM, Guenter Roeck  wrote:
> 
>> 
>> Should we be concerned about restoring the configuration here?
>> 
> Interesting question. If the chip was really powered off, you would
> have to restore the entire configuration, not just the configuration
> register. Given that, I think it is sufficient to just restore the
> operational mode, ie the value changed when entering suspend.
> 
OK. Will do.

> Where did you find regmap_sync() ? It seems to be hiding from me.

Sorry, I meant regcache_sync().

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


Re: [PATCH 1/2] hwmon: Add Texas Instruments TMP108 temperature sensor driver.

2016-12-01 Thread Guenter Roeck
Hi John,

On Thu, Dec 01, 2016 at 01:50:22PM -0800, John Muir wrote:
> Hi Guenter,
> 
[ ... ]
> 
> >> +static int __maybe_unused tmp108_resume(struct device *dev)
> >> +{
> >> +  struct tmp108 *tmp108 = dev_get_drvdata(dev);
> >> +  int err;
> >> +
> >> +  err = regmap_write(tmp108->regmap, TMP108_REG_CONF,
> >> + tmp108->curr_config);
> >> +
> >> +  tmp108->ready_time = jiffies;
> >> +  if (tmp108->curr_config & TMP108_MODE_CONTINUOUS)
> > 
> > Since only continuous mode is supported, and it is somewhat unlikely
> > that we'll ever support one-shot mode, I think it would be better to
> > unconditionally set continuous mode and the delay here and drop
> > curr_config entirely. curr_config adds quite some complexity to the
> > driver with no real gain.
> 
> OK. Due to my ignorance I was assuming that the could would need to restore 
> the current configuration during resume, and also the previous versions (that 
> you did not see) of this code was not using regmap. In fact I see that there 
> is also a function called ‘regmap_sync’ which is used (mainly by audio 
> codecs) to do this (i.e.; as part of device reset but there are examples in 
> resume()). The configuration register is now marked volatile so it would be 
> skipped by regmap_sync anyway.
> 
> Should we be concerned about restoring the configuration here?
> 
Interesting question. If the chip was really powered off, you would
have to restore the entire configuration, not just the configuration
register. Given that, I think it is sufficient to just restore the
operational mode, ie the value changed when entering suspend.

Where did you find regmap_sync() ? It seems to be hiding from me.

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


Re: [PATCH 1/2] hwmon: Add Texas Instruments TMP108 temperature sensor driver.

2016-12-01 Thread John Muir
Hi Guenter,

On Dec 1, 2016, at 7:19 AM, Guenter Roeck  wrote:
> 
>> +/* convert 12-bit TMP108 register value to milliCelsius */
>> +static inline int tmp108_temp_reg_to_mC(s16 val)
>> +{
>> +return (val & ~0x01) * 1000 / 256;
> 
> Why ~0x01 and not ~0x0f ? The lower 4 bits are supposed to be 0.

I can probably change it: I will reevaluate this.

>> +tmp108->orig_config = regval;
>> +config = regval;
>> +
> 
> Nitpick, but a separate 'regval' variable is not really necessary.
> Just make config an u32 and use it directly (this actually makes the code
> more efficient on many architectures, since cpu registers tend to be
> at least 32 bit wide and 16 bit accesses result in extra masking).

OK.

>> +if (device_property_read_bool(dev, "ti,thermostat-mode-comparator"))
>> +config &= ~TMP108_CONF_TM;
>> +else
>> +config |= TMP108_CONF_TM;
>> +
> As suggested separately, I would suggest to drop this and always select 
> comparator mode.

Yep.

>> +hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name,
>> + tmp108,
>> + _chip_info,
>> + NULL);
>> +if (IS_ERR(hwmon_dev)) {
>> +err = PTR_ERR(hwmon_dev);
>> +dev_err(dev, "unable to register hwmon device: %d", err);
>> +return err;
>> +}
> 
> Overall I prefer a simeple
>   return PTR_ERR_OR_ZERO(hwmon_dev);

Ack.


>> +static int __maybe_unused tmp108_resume(struct device *dev)
>> +{
>> +struct tmp108 *tmp108 = dev_get_drvdata(dev);
>> +int err;
>> +
>> +err = regmap_write(tmp108->regmap, TMP108_REG_CONF,
>> +   tmp108->curr_config);
>> +
>> +tmp108->ready_time = jiffies;
>> +if (tmp108->curr_config & TMP108_MODE_CONTINUOUS)
> 
> Since only continuous mode is supported, and it is somewhat unlikely
> that we'll ever support one-shot mode, I think it would be better to
> unconditionally set continuous mode and the delay here and drop
> curr_config entirely. curr_config adds quite some complexity to the
> driver with no real gain.

OK. Due to my ignorance I was assuming that the could would need to restore the 
current configuration during resume, and also the previous versions (that you 
did not see) of this code was not using regmap. In fact I see that there is 
also a function called ‘regmap_sync’ which is used (mainly by audio codecs) to 
do this (i.e.; as part of device reset but there are examples in resume()). The 
configuration register is now marked volatile so it would be skipped by 
regmap_sync anyway.

Should we be concerned about restoring the configuration here?

Thanks for your advice,

John.

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


Re: [PATCH] core-api: remove an unexpected unident

2016-12-01 Thread Jonathan Corbet
On Thu,  1 Dec 2016 10:15:11 -0200
Mauro Carvalho Chehab  wrote:

> As complained by Sphinx:
>   Documentation/core-api/assoc_array.rst:13: WARNING: Enumerated list 
> ends without a blank line; unexpected unindent.

Applied to docs-next, thanks.  I should have caught that one...

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


Re: [PATCH][DOC] ppc/idle: Add documentation for powersave=off

2016-12-01 Thread Jonathan Corbet
On Fri, 2 Dec 2016 00:08:26 +1100
Balbir Singh  wrote:

> Update kernel-parameters.txt to add Documentation
> for powersave=off.

Applied to docs-next, thanks.

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


Re: [PATCH] Doc: Correct typo, "Introdution" => "Introduction"

2016-12-01 Thread Jonathan Corbet
On Thu,  1 Dec 2016 23:36:00 +0800
Sanjeev  wrote:

> This corrects a set of spelling mistakes, probably from an
> automated conversion.

That does indeed seem worth fixing.  Applied to the docs tree, thanks.

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


Re: [PATCH v3 4/4] firmware: remove warning at documentation generation time

2016-12-01 Thread Greg Kroah-Hartman
On Thu, Dec 01, 2016 at 05:11:54PM +0100, Luis R. Rodriguez wrote:
> On Fri, Nov 25, 2016 at 06:50:32PM -0200, Mauro Carvalho Chehab wrote:
> > Em Fri, 25 Nov 2016 15:59:47 +0100
> > Silvio Fricke  escreveu:
> > 
> > > This patch removes following error at for `make htmldocs`. No functional
> > > change.
> > > 
> > >   ./drivers/base/firmware_class.c:1348: WARNING: Bullet list ends without 
> > > a blank line; unexpected unindent.
> > > 
> > > Signed-off-by: Silvio Fricke 
> > 
> > Reviewed-by: Mauro Carvalho Chehab 
> 
> Acked-by: Luis R. Rodriguez 
> 
> Jonathan,
> 
> firmware_class changes have been lately going through Greg's tree, he has a 
> few
> more pending changes on his driver-core-next branch for firmware_class but 
> this
> patch not create a conflict. It can go in first or later as such its
> technically fine for it to go either through your tree or Greg's tree.
> 
> I'll let Greg decide. I've bounced him a copy of the patch.

I can just take this one in my tree as it's easy to merge as-is.

thanks,

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


Re: [PATCH v3 4/4] firmware: remove warning at documentation generation time

2016-12-01 Thread Luis R. Rodriguez
On Fri, Nov 25, 2016 at 06:50:32PM -0200, Mauro Carvalho Chehab wrote:
> Em Fri, 25 Nov 2016 15:59:47 +0100
> Silvio Fricke  escreveu:
> 
> > This patch removes following error at for `make htmldocs`. No functional
> > change.
> > 
> > ./drivers/base/firmware_class.c:1348: WARNING: Bullet list ends without 
> > a blank line; unexpected unindent.
> > 
> > Signed-off-by: Silvio Fricke 
> 
> Reviewed-by: Mauro Carvalho Chehab 

Acked-by: Luis R. Rodriguez 

Jonathan,

firmware_class changes have been lately going through Greg's tree, he has a few
more pending changes on his driver-core-next branch for firmware_class but this
patch not create a conflict. It can go in first or later as such its
technically fine for it to go either through your tree or Greg's tree.

I'll let Greg decide. I've bounced him a copy of the patch.

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


Re: [PATCH v4 0/4] core-api ReST: assoc_array, atomic_ops, local_ops

2016-12-01 Thread Luis R. Rodriguez
On Wed, Nov 30, 2016 at 05:51:29PM -0700, Jonathan Corbet wrote:
> Part 4 (firmware_class.c) is a bit off my turf, so I don't think I can
> apply it.  From what I can tell looking at the history, Andrew Morton
> might be a logical target for that patch.

I'll review that patch, as I've recently taken up helping with maintenance
for firmware_class. Provided its fine it could go through you Jonathan as
I am not aware of other documentation changes in the pipeline. Will review
shortly.

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


Re: [PATCH] Typos, no semantics changed

2016-12-01 Thread Sanjeev Gupta
On Mon, Nov 14, 2016 at 4:00 AM, Jonathan Corbet  wrote:
>
> You don't need us to tell you whether a patch applies, right?


My knowledge of git is based on a cheat sheet I got three years ago
from the gpsd project, and I have used the same commands for other
projects since; but I do not really understand the interactions of all
the options of the git format-patch subcommand.  Apologies.

>
> If you want this change to be merged, please send a proper patch with a
> correct subject line and a changelog.  Also note that "followthrough" is
> as intended.


I have re-read, slower, process/submit-checklist.rst , and
process/submitting-patches.rst , and I think I have figured out at
least some of the mistakes I made.  I will resubmit this patch next.

Thank you,


-- 
Sanjeev Gupta
+65 98551208 http://www.linkedin.com/in/ghane
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] hwmon: Add Texas Instruments TMP108 temperature sensor driver.

2016-12-01 Thread Guenter Roeck

Hi John,

On 11/30/2016 12:36 PM, John Muir wrote:

Add support for the TI TMP108 temperature sensor with some device
configuration parameters.



Overall looks pretty good. Just a couple of nitpicks.

Thanks,
Guenter


Signed-off-by: John Muir 
---
 Documentation/hwmon/tmp108 |  38 
 drivers/hwmon/Kconfig  |  11 +
 drivers/hwmon/Makefile |   1 +
 drivers/hwmon/tmp108.c | 495 +
 4 files changed, 545 insertions(+)
 create mode 100644 Documentation/hwmon/tmp108
 create mode 100644 drivers/hwmon/tmp108.c

diff --git a/Documentation/hwmon/tmp108 b/Documentation/hwmon/tmp108
new file mode 100644
index 000..ef2e9a3
--- /dev/null
+++ b/Documentation/hwmon/tmp108
@@ -0,0 +1,38 @@
+Kernel driver tmp108
+
+
+Supported chips:
+  * Texas Instruments TMP108
+Prefix: 'tmp108'
+Addresses scanned: none
+Datasheet: http://www.ti.com/product/tmp108
+
+Author:
+   John Muir 
+
+Description
+---
+
+The Texas Instruments TMP108 implements one temperature sensor. An alert pin
+can be set when temperatures exceed minimum or maximum values plus or minus a
+hysteresis value.
+
+The sensor is accurate to 0.75C over the range of -25 to +85 C, and to 1.0
+degree from -40 to +125 C. Resolution of the sensor is 0.0625 degree. The
+operating temperature has a minimum of -55 C and a maximum of +150 C.
+Hysteresis values can be set to 0, 1, 2, or 4C.
+
+The TMP108 has a programmable update rate that can select between 8, 4, 1, and
+0.5 Hz.
+
+By default the TMP108 reads the temperature continuously. To conserve power,
+the TMP108 has a one-shot mode where the device is normally shut-down. When a
+one shot is requested the temperature is read, the result can be retrieved,
+and then the device is shut down automatically. (This driver only supports
+continuous mode.)
+
+The driver provides the common sysfs-interface for temperatures (see
+Documentation/hwmon/sysfs-interface under Temperatures).
+
+See Documentation/devicetree/bindings/hwmon/tmp108.txt for configuration
+properties.
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 45cef3d..4c173de 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -1591,6 +1591,17 @@ config SENSORS_TMP103
  This driver can also be built as a module.  If so, the module
  will be called tmp103.

+config SENSORS_TMP108
+   tristate "Texas Instruments TMP108"
+   depends on I2C
+   select REGMAP_I2C
+   help
+ If you say yes here you get support for Texas Instruments TMP108
+ sensor chips.
+
+ This driver can also be built as a module.  If so, the module
+ will be called tmp108.
+
 config SENSORS_TMP401
tristate "Texas Instruments TMP401 and compatibles"
depends on I2C
diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
index aecf4ba..51e5256 100644
--- a/drivers/hwmon/Makefile
+++ b/drivers/hwmon/Makefile
@@ -152,6 +152,7 @@ obj-$(CONFIG_SENSORS_TC74)  += tc74.o
 obj-$(CONFIG_SENSORS_THMC50)   += thmc50.o
 obj-$(CONFIG_SENSORS_TMP102)   += tmp102.o
 obj-$(CONFIG_SENSORS_TMP103)   += tmp103.o
+obj-$(CONFIG_SENSORS_TMP108)   += tmp108.o
 obj-$(CONFIG_SENSORS_TMP401)   += tmp401.o
 obj-$(CONFIG_SENSORS_TMP421)   += tmp421.o
 obj-$(CONFIG_SENSORS_TWL4030_MADC)+= twl4030-madc-hwmon.o
diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c
new file mode 100644
index 000..35d598d
--- /dev/null
+++ b/drivers/hwmon/tmp108.c
@@ -0,0 +1,495 @@
+/* Texas Instruments TMP108 SMBus temperature sensor driver
+ *
+ * Copyright (C) 2016 John Muir 
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#defineDRIVER_NAME "tmp108"
+
+#defineTMP108_REG_TEMP 0x00
+#defineTMP108_REG_CONF 0x01
+#defineTMP108_REG_TLOW 0x02
+#defineTMP108_REG_THIGH0x03
+
+#define TMP108_TEMP_MIN_MC -5 /* Minimum millicelcius. */
+#define TMP108_TEMP_MAX_MC 127937 /* Maximum millicelcius. */
+
+/* Configuration register bits.
+ * Note: these bit definitions are byte swapped.
+ */
+#define TMP108_CONF_M0 0x0100 /* Sensor mode. */
+#define TMP108_CONF_M1 0x0200
+#define TMP108_CONF_TM 0x0400 /* Thermostat mode. */
+#define TMP108_CONF_FL 0x0800 /* Watchdog flag 

[PATCH] core-api: remove an unexpected unident

2016-12-01 Thread Mauro Carvalho Chehab
As complained by Sphinx:
Documentation/core-api/assoc_array.rst:13: WARNING: Enumerated list 
ends without a blank line; unexpected unindent.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/core-api/assoc_array.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/core-api/assoc_array.rst 
b/Documentation/core-api/assoc_array.rst
index dcda7c623cec..d83cfff9ea43 100644
--- a/Documentation/core-api/assoc_array.rst
+++ b/Documentation/core-api/assoc_array.rst
@@ -10,7 +10,7 @@ properties:
 
 1. Objects are opaque pointers.  The implementation does not care where they
point (if anywhere) or what they point to (if anything).
-.. note:: Pointers to objects _must_ be zero in the least significant bit.**
+.. note:: Pointers to objects _must_ be zero in the least significant bit.
 
 2. Objects do not need to contain linkage blocks for use by the array.  This
permits an object to be located in multiple arrays simultaneously.
-- 
2.9.3

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