Because this driver will support multiple configurations for software,
the software configuration was made generic.
Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
The device dependent options which are going to be different for devices
which will be supported in the future by this driver,
were moved in chip info for a more generic driver. This patch allows
supporting more devices by the driver. Also, it is an intermediate
step of adding support for ad7616 in software mode.
Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This patch adds a MAINTAINERS entry for the AD7780 ADC driver.
Signed-off-by: Renato Lui Geh <renatogeh@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This patch adds a YAML binding for the Analog Devices AD7780/1 and
AD7170/1 analog-to-digital converters.
Signed-off-by: Renato Lui Geh <renatogeh@gmail.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Some ultrabooks, like Teclast F6 Pro, use KIOX010A sensor on display
and KIOX020A sensor on keyboard base, to detect tablet mode or screen
orientation.
Signed-off-by: Luís Ferreira <luis@aurorafoss.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
The documentation give some exemple on what format can be expected
from sampling_frequency_available sysfs attribute
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
The DPS310 supports measurement of pressure, so support that in the
driver. Use background measurement like the temperature sensing and
default to lowest precision and lowest measurement rate.
Signed-off-by: Eddie James <eajames@linux.ibm.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add a manufacturer's suggested workaround to deal with early revisions
of chip that don't indicate correct temperature. Readings can be in the
~60C range when they should be in the ~20's.
Signed-off-by: Christopher Bostic <cbostic@linux.vnet.ibm.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Eddie James <eajames@linux.ibm.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
The DPS310 is a temperature and pressure sensor. It can be accessed over
i2c and SPI, but this driver only supports polling over i2c.
Signed-off-by: Eddie James <eajames@linux.ibm.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This patch adds of_match_table entry in device driver in order to
enable spi fallback probing.
Signed-off-by: Rodrigo Ribeiro <rodrigorsdc@gmail.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add a of_device_id struct variable and subsequent call to
MODULE_DEVICE_TABLE macro to support device tree.
Signed-off-by: João Seckler <joaoseckler@gmail.com>
Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
Co-developed-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add a of_device_id struct and MODULE_DEVICE_TABLE call, in order to add
device-tree support for this driver.
Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Rodrigo Ribeiro <rodrigorsdc@gmail.com>
Co-developed-by: Rodrigo Ribeiro <rodrigorsdc@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Create structure of type of_device_id in order to register all devices
the driver is able to manage.
Signed-off-by: Bárbara Fernandes <barbara.fernandes@usp.br>
Signed-off-by: Wilson Sales <spoonm@spoonm.org>
Co-developed-by: Wilson Sales <spoonm@spoonm.org>
Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Accomplish device tree compatibility to driver ADIS16203
by adding of_device_id table and making a subsequent call to
MODULE_DEVICE_TABLE.
Signed-off-by: Thiago Estrela <thiagestrela@gmail.com>
Signed-off-by: Tiago Napoli <napoli.tiago96@gmail.com>
Co-developed-by: Tiago Napoli <napoli.tiago96@gmail.com>
Signed-off-by: Pedro Sousa <pedroteosousa@gmail.com>
Co-developed-by: Pedro Sousa <pedroteosousa@gmail.com>
Reviewed-by: Matheus Tavares <matheus.bernardino@usp.br>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add a of_device_id struct array of_match_table variable and subsequent
call to MODULE_DEVICE_TABLE macro to enable explicit device tree support.
Co-developed-by: Thiago L. A. Miller <tmiller@mochsl.org.br>
Signed-off-by: Thiago L. A. Miller <tmiller@mochsl.org.br>
Co-developed-by: Osvaldo M. Yasuda <omyasuda@yahoo.com.br>
Signed-off-by: Osvaldo M. Yasuda <omyasuda@yahoo.com.br>
Signed-off-by: João Victor Marques de Oliveira <joao.marques.oliveira@usp.br>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Create macro for capacitance channels in order to remove the repeated
code and improve its readability.
Signed-off-by: Bárbara Fernandes <barbara.fernandes@usp.br>
Signed-off-by: Wilson Sales <spoonm@spoonm.org>
Co-developed-by: Wilson Sales <spoonm@spoonm.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Add myself as the maintainer of the anybuss bus driver, and its client
drivers.
Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add myself as the maintainer of the fieldbus subsystem.
Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixes checkpatch.pl warnings "braces {} are not necessary for single
statement blocks".
Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixes checkpatch.pl warnings "Alignment should match open parenthesis"
and "Lines should not end with a '('".
Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixes checkpatch.pl error "code indent should use tabs where possible".
Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixes checkpatch.pl warning "Prefer using '"%s...", __func__' to using
'<function name>', this function's name, in a string".
Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixes checkpatch.pl warning "Missing a blank line after declarations".
Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The variable retval is assigned constant values twice, and can therefore
be replaced by its values.
Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixes checkpatch.pl error "else should follow close brace '}'" and
"trailing statements should be on next line".
Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixes checkpatch.pl error "space required before the open brace '{'".
Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Use tabs instead of spaces for indentation.
Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fix below warning reported by checkpatch
CHECK: Comparison to NULL could be written
"!precvpriv->pallocated_frame_buf"
CHECK: Comparison to NULL could be written "padapter"
Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
-----
changes in v2:
Corected few erorrs like (!*psta == NULL) pointed in
review
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/kpc2000/kpc2000_i2c.c:652:3-8: No need to set .owner here. The core will do it.
Remove .owner field if calls are used which set it automatically
Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci
Fixes: 43ad381918 ("staging: kpc2000: kpc_i2c: add static qual to local symbols in kpc_i2c.c")
CC: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
As per below information
GFP_KERNEL FLAG
This is a normal allocation and might block. This is the flag to use in
process context code when it is safe to sleep.
GFP_ATOMIC FLAG
The allocation is high-priority and does not sleep. This is the flag to
use in interrupt handlers, bottom halves and other situations where you
cannot sleep
And we can take advantage of GFP_KERNEL , as when system is in low
memory chances of getting success is high compared to GFP_ATOMIC.
As visornic_probe is in process context we can use GPF_KERNEL.
Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kpc_i2c.c declares:
- two functions
- pi2c_probe()
- pi2c_remove()
- one struct
- i2c_plat_driver_i
which are local to the file, yet missing the static qualifier. Add the
static qualifier to these symbols.
Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Many of the functions in kpc_i2c log debug-level messages to the
kernel log message buffer upon invocation. This is unnecessary, as
debugging tools like kgdb, kdb, etc. or the tracing tool ftrace
should be able to provide this same information. Therefore, remove
these print statements.
Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Rather than include asm/io.h, include linux/io.h. Issue reported
by the script checkpatch.pl.
Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The linux coding style document states:
1) That braces should not be used where a single single statement
will do. Therefore all instances of single block statements
wrapped in braces that do not meet the qualifications of any
of the exceptions to the rule should be fixed up.
2) That the declaration of variables local to a given function
should be immediately followed by a blank newline. Therefore,
the single instance of this in kpc2000_i2c.c should be fixed
up.
Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The module parameter 'disable_features' is currently unused. Therefore,
it should be removed.
Signed-off-by: Geordan Neukum <gneukum1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Clang warns:
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2663:47: warning:
address of array 'param->u.wpa_ie.data' will always evaluate to 'true'
[-Wpointer-bool-conversion]
(param->u.wpa_ie.len && !param->u.wpa_ie.data))
~~~~~~~~~~~~~~~~~^~~~
This was exposed by commit deabe03523 ("Staging: rtl8192u: ieee80211:
Use !x in place of NULL comparisons") because we disable the warning
that would have pointed out the comparison against NULL is also false:
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2663:46: warning:
comparison of array 'param->u.wpa_ie.data' equal to a null pointer is
always false [-Wtautological-pointer-compare]
(param->u.wpa_ie.len && param->u.wpa_ie.data == NULL))
~~~~~~~~~~~~~~~~^~~~ ~~~~
Remove it so clang no longer warns.
Link: https://github.com/ClangBuiltLinux/linux/issues/487
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
All the attribute show call-backs check whether pcard is NULL. However,
pci_set_drvdata(pdev, pcard) is called before the sysfs files are
created during probe, and pci_set_drvdata(pdev, NULL) is not called
until after they are destroyed during remove; therefore, pcard will not
be NULL, and we can drop the checks.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
All the call-backs used the same formula to retrieve the pcard from dev:
struct pci_dev *pdev = to_pci_dev(dev);
struct kp2000_device *pcard;
if (!pdev)
return NULL;
pcard = pci_get_drvdata(pdev);
Since to_pci_dev is a wrapper for container_of, it will not return NULL,
and since pci_get_drvdata just calls dev_get_drvdata on the dev member
of pdev, this is equivalent to:
struct kp2000_device *pcard = dev_get_drvdata(&(container_of(dev, struct pci_dev, dev)->dev));
and we can simplify it to:
struct kp2000_device *pcard = dev_get_drvdata(dev);
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Previously the next card number was assigned from a static int local
variable. Replaced it with an IDA. Avoids the assignment of ever-
increasing card-numbers by allowing them to be reused.
Updated TODO.
Corrected format-specifier for unsigned pcard->card_num.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Defined separate simple show functions for each attribute instead of
having a one big one containing a chain of conditionals.
Replaced calls to scnprintf with sprintf since all the outputs are
single integers.
All the readable device attributes are read-only, so used DEVICE_ATTR_RO
to define them.
The definitions are only used to populate the kp_attr_list attribute
array, so declared them as static.
Fixes the following sparse warnings:
drivers/staging/kpc2000/kpc2000/core.c:152:1: warning: symbol 'dev_attr_ssid' was not declared. Should it be static?
drivers/staging/kpc2000/kpc2000/core.c:153:1: warning: symbol 'dev_attr_ddna' was not declared. Should it be static?
drivers/staging/kpc2000/kpc2000/core.c:154:1: warning: symbol 'dev_attr_card_id' was not declared. Should it be static?
drivers/staging/kpc2000/kpc2000/core.c:155:1: warning: symbol 'dev_attr_hw_rev' was not declared. Should it be static?
drivers/staging/kpc2000/kpc2000/core.c:156:1: warning: symbol 'dev_attr_build' was not declared. Should it be static?
drivers/staging/kpc2000/kpc2000/core.c:157:1: warning: symbol 'dev_attr_build_date' was not declared. Should it be static?
drivers/staging/kpc2000/kpc2000/core.c:158:1: warning: symbol 'dev_attr_build_time' was not declared. Should it be static?
drivers/staging/kpc2000/kpc2000/core.c:159:1: warning: symbol 'dev_attr_cpld_reg' was not declared. Should it be static?
drivers/staging/kpc2000/kpc2000/core.c:161:1: warning: symbol 'dev_attr_cpld_reconfigure' was not declared. Should it be static?
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The attribute call-backs all use the same formula to get the pcard from
dev:
struct pci_dev *pdev = to_pci_dev(dev);
struct kp2000_device *pcard;
if (!pdev)
return -ENXIO;
pcard = pci_get_drvdata(pdev);
if (!pcard)
return -ENXIO;
Added a function to reduce the duplicated code.
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>