Re: [RFC 06/12] mtd: nand: add reworked Marvell NAND controller driver

2017-10-19 Thread Boris Brezillon
On Wed, 18 Oct 2017 16:36:23 +0200
Miquel Raynal  wrote:


> +
> +enum marvell_nfc_variant {
> + MARVELL_NFC_VARIANT_PXA3XX,
> + MARVELL_NFC_VARIANT_ARMADA370,
> + MARVELL_NFC_VARIANT_ARMADA_8K,
> +};
> +
> +/*
> + * NAND controller capabilities for distinction between compatible strings
> + *
> + * @variant: Board type
> + * @max_cs_nb:   Number of Chip Select lines available
> + * @max_rb_nb:   Number of Ready/Busy lines available
> + * @legacy_of_bindings   Indicates if DT parsing must be done using the 
> old
> + *   fashion way
> + */
> +struct marvell_nfc_caps {
> + enum marvell_nfc_variant variant;

Do you really need this variant field. It seems you're only using it to
detect if you should MUX the NAND pins using the Special Function
registers on armada8k. Maybe you should just have:

bool need_system_controller;

and set it to true for the "armada8k" compatible.

> + unsigned int max_cs_nb;
> + unsigned int max_rb_nb;
> + bool legacy_of_bindings;
> +};
> +
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 3/4] Staging: rtl8188eu: core: rtw_mlme_ext: Use list_for_each_entry_safe

2017-10-19 Thread Dan Carpenter
On Thu, Oct 19, 2017 at 01:01:39AM +0530, Srishti Sharma wrote:
> This is a cleanup patch and doesn't change runtime behaviour. It
> changes an open coded list traversal to use list_for_each_entry_safe.
> Done using the following semantic patch by coccinelle.
> 
> @r@
> struct list_head* l;
> expression e;
> identifier m,list_del_init,f;
> type T1;
> T1* pos;
> iterator name list_for_each_entry_safe;
> @@
> 
> f(...){
> 
> +T1* tmp;
> <+...
> -while(...)
> +list_for_each_entry_safe(pos,tmp,l,m)
> {
> ...
> -pos = container_of(l,T1,m);
> ...
> -l=e;
>  <+...
>  list_del_init(&pos->m)
>  ...+>
> }
> ...+>
> 
> }
> 
> Signed-off-by: Srishti Sharma 
> ---
>  drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 9 -
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c 
> b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> index 685c071..cf85fb4 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
> @@ -5463,6 +5463,8 @@ u8 mlme_evt_hdl(struct adapter *padapter, unsigned char 
> *pbuf)
>  
>  u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf)
>  {
> + struct xmit_frame *tmp;
> +
>   if (send_beacon(padapter) == _FAIL) {
>   DBG_88E("issue_beacon, fail!\n");
>   return H2C_PARAMETERS_ERROR;
> @@ -5486,11 +5488,8 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned 
> char *pbuf)
>   xmitframe_phead = get_list_head(&psta_bmc->sleep_q);
>   xmitframe_plist = xmitframe_phead->next;
>  
> - while (xmitframe_phead != xmitframe_plist) {
> - pxmitframe = container_of(xmitframe_plist, 
> struct xmit_frame, list);
> -
> - xmitframe_plist = xmitframe_plist->next;
> -
> + list_for_each_entry_safe(pxmitframe, tmp,
> +  xmitframe_plist, list) {

I'm pretty sure we should get rid of the xmitframe_plist variable and
use xmitframe_phead here.

regards,
dan carpenter 

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/4] Staging: rtl8188eu: core: rtw_ap: Use list_for_each_entry_safe

2017-10-19 Thread Dan Carpenter
On Thu, Oct 19, 2017 at 01:01:14AM +0530, Srishti Sharma wrote:
> This is a cleanup patch and doesn't change runtime behaviour. It
> changes an open coded list traversal to use list_for_each_entry_safe.
> Done using the following semantic patch by coccinelle.
> 
> @r@
> struct list_head* l;
> expression e;
> identifier m,list_del_init,f;
> type T1;
> T1* pos;
> iterator name list_for_each_entry_safe;
> @@
> 
> f(...){
> 
> +T1* tmp;
> <+...
> -while(...)
> +list_for_each_entry_safe(pos,tmp,l,m)
> {
> ...
> -pos = container_of(l,T1,m);
> ...
> -l=e;
>  <+...
>  list_del_init(&pos->m)
>  ...+>
> }
> ...+>
> 
> }
> 
> Signed-off-by: Srishti Sharma 
> ---
>  drivers/staging/rtl8188eu/core/rtw_ap.c | 34 
> +
>  1 file changed, 9 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c 
> b/drivers/staging/rtl8188eu/core/rtw_ap.c
> index 32a4837..551af9e 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_ap.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_ap.c
> @@ -280,7 +280,7 @@ void  expire_timeout_chk(struct adapter *padapter)
>  {
>   struct list_head *phead, *plist;
>   u8 updated = 0;
> - struct sta_info *psta = NULL;
> + struct sta_info *psta = NULL, *tmp;
>   struct sta_priv *pstapriv = &padapter->stapriv;
>   u8 chk_alive_num = 0;
>   char chk_alive_list[NUM_STA];
> @@ -292,10 +292,7 @@ void expire_timeout_chk(struct adapter *padapter)
>   plist = phead->next;
>  
>   /* check auth_queue */
> - while (phead != plist) {
> - psta = container_of(plist, struct sta_info, auth_list);
> - plist = plist->next;
> -
> + list_for_each_entry_safe(psta, tmp, plist, auth_list) {


This one as well.  (I'm reviewing in reverse order)  We don't need
plist, just phead.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] staging: wlan-ng: Remove unnecessary parentheses

2017-10-19 Thread kbuild test robot
Hi Frank,

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.14-rc5 next-20171018]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Frank-A-Cancio-Bello/staging-wlan-ng-Remove-unnecessary-parentheses/20171018-202349
config: i386-randconfig-b0-10191645 (attached as .config)
compiler: gcc-5 (Debian 5.4.1-2) 5.4.1 20160904
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from include/uapi/linux/stddef.h:1:0,
from include/linux/stddef.h:4,
from include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/linux/list.h:4,
from include/linux/module.h:9,
from drivers/staging/wlan-ng/hfa384x_usb.c:113,
from drivers/staging/wlan-ng/prism2usb.c:1:
   drivers/staging/wlan-ng/hfa384x_usb.c: In function 'hfa384x_drvr_enable':
   drivers/staging/wlan-ng/hfa384x_usb.c:1784:16: warning: suggest parentheses 
around '&&' within '||' [-Wparentheses]
 if (!hw->isap && macport != 0 ||
   ^
   include/linux/compiler.h:156:30: note: in definition of macro '__trace_if'
 if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
 ^
>> drivers/staging/wlan-ng/hfa384x_usb.c:1784:2: note: in expansion of macro 
>> 'if'
 if (!hw->isap && macport != 0 ||
 ^
   drivers/staging/wlan-ng/hfa384x_usb.c:1784:16: warning: suggest parentheses 
around '&&' within '||' [-Wparentheses]
 if (!hw->isap && macport != 0 ||
   ^
   include/linux/compiler.h:156:42: note: in definition of macro '__trace_if'
 if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
 ^
>> drivers/staging/wlan-ng/hfa384x_usb.c:1784:2: note: in expansion of macro 
>> 'if'
 if (!hw->isap && macport != 0 ||
 ^
   drivers/staging/wlan-ng/hfa384x_usb.c:1784:16: warning: suggest parentheses 
around '&&' within '||' [-Wparentheses]
 if (!hw->isap && macport != 0 ||
   ^
   include/linux/compiler.h:167:16: note: in definition of macro '__trace_if'
  __r = !!(cond); \
   ^
>> drivers/staging/wlan-ng/hfa384x_usb.c:1784:2: note: in expansion of macro 
>> 'if'
 if (!hw->isap && macport != 0 ||
 ^
--
   In file included from include/uapi/linux/stddef.h:1:0,
from include/linux/stddef.h:4,
from include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/linux/list.h:4,
from include/linux/module.h:9,
from drivers/staging/wlan-ng/p80211netdev.c:52:
   drivers/staging/wlan-ng/cfg80211.c: In function 'prism2_connect':
   drivers/staging/wlan-ng/cfg80211.c:479:51: warning: suggest parentheses 
around '&&' within '||' [-Wparentheses]
 sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC && !is_wep)
  ^
   include/linux/compiler.h:156:30: note: in definition of macro '__trace_if'
 if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
 ^
>> drivers/staging/wlan-ng/cfg80211.c:478:2: note: in expansion of macro 'if'
 if (sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM ||
 ^
   drivers/staging/wlan-ng/cfg80211.c:479:51: warning: suggest parentheses 
around '&&' within '||' [-Wparentheses]
 sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC && !is_wep)
  ^
   include/linux/compiler.h:156:42: note: in definition of macro '__trace_if'
 if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
 ^
>> drivers/staging/wlan-ng/cfg80211.c:478:2: note: in expansion of macro 'if'
 if (sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM ||
 ^
   drivers/staging/wlan-ng/cfg80211.c:479:51: warning: suggest parentheses 
around '&&' within '||' [-Wparentheses]
 sme->auth_type == NL80211_AUTHTYPE_AUTOMATIC && !is_wep)
  ^
   include/linux/compiler.h:167:16: note: in definition of macro '__trace_if'
  __r = !!(cond); \
   ^
>> drivers/staging/wlan-ng/cfg80211.c:478:2: note: in expansion of macro 'if'
 if (sme->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM ||
 ^

vim +/if +1784 drivers/staging/wlan-ng/hfa384x_usb.c

  1756  
  1757  /*
  1758   * hfa384x_drvr_enable
  1759   *
  1760   * Issues the enable command to enable communications on one of
  1761   * t

Re: [PATCH V2] scsi: storvsc: Allow only one remove lun work item to be issued per lun

2017-10-19 Thread Christoph Hellwig
On Tue, Oct 17, 2017 at 01:35:21PM -0400, Cathy Avery wrote:
> + /*
> +  * Set the error handler work queue.
> +  */
> + snprintf(host_dev->work_q_name, sizeof(host_dev->work_q_name),
> +  "storvsc_error_wq_%d", host->host_no);
> + host_dev->handle_error_wq =
> + create_singlethread_workqueue(host_dev->work_q_name);

If you use alloc_ordered_workqueue directly instead of
create_singlethread_workqueue you can pass a format string and don't
need the separate allocation.

But I'm not sure if Tejun is fine with using __WQ_LEGACY directly..

Except for this nit this looks fine to me:

Reviewed-by: Christoph Hellwig 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 02/13] staging: iio: tsl2x7x: remove unused tsl2x7x_parse_result structure

2017-10-19 Thread Brian Masney
The structure tsl2x7x_parse_result is not used so this patch removes its
definition.

Signed-off-by: Brian Masney 
---
 drivers/staging/iio/light/tsl2x7x.c | 5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x.c 
b/drivers/staging/iio/light/tsl2x7x.c
index 2dd8c502fd7a..094ab76b5d60 100644
--- a/drivers/staging/iio/light/tsl2x7x.c
+++ b/drivers/staging/iio/light/tsl2x7x.c
@@ -142,11 +142,6 @@ enum {
TSL2X7X_CHIP_SUSPENDED = 2
 };
 
-struct tsl2x7x_parse_result {
-   int integer;
-   int fract;
-};
-
 /* Per-device data */
 struct tsl2x7x_als_info {
u16 als_ch0;
-- 
2.13.6

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/13] staging: iio: tsl2x7x: convert in_proximity0_calibscale_available to use IIO_CONST_ATTR

2017-10-19 Thread Brian Masney
The sysfs attribute in_proximity0_calibscale_available is currently
created by using DEVICE_ATTR_RO(). Convert this over to use
IIO_CONST_ATTR().

Signed-off-by: Brian Masney 
---
 drivers/staging/iio/light/tsl2x7x.c | 15 ---
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x.c 
b/drivers/staging/iio/light/tsl2x7x.c
index 3a3340aadc1a..80968dd456a0 100644
--- a/drivers/staging/iio/light/tsl2x7x.c
+++ b/drivers/staging/iio/light/tsl2x7x.c
@@ -886,12 +886,7 @@ static ssize_t 
in_illuminance0_calibscale_available_show(struct device *dev,
return snprintf(buf, PAGE_SIZE, "%s\n", "1 8 16 120");
 }
 
-static ssize_t in_proximity0_calibscale_available_show(struct device *dev,
-   struct device_attribute *attr,
-   char *buf)
-{
-   return snprintf(buf, PAGE_SIZE, "%s\n", "1 2 4 8");
-}
+static IIO_CONST_ATTR(in_proximity0_calibscale_available, "1 2 4 8");
 
 static IIO_CONST_ATTR(in_illuminance0_integration_time_available,
".00272 - .696");
@@ -1371,8 +1366,6 @@ static int tsl2x7x_write_raw(struct iio_dev *indio_dev,
return tsl2x7x_invoke_change(indio_dev);
 }
 
-static DEVICE_ATTR_RO(in_proximity0_calibscale_available);
-
 static DEVICE_ATTR_RO(in_illuminance0_calibscale_available);
 
 static DEVICE_ATTR_RW(in_illuminance0_target_input);
@@ -1468,13 +1461,13 @@ static struct attribute *tsl2x7x_ALSPRX_device_attrs[] 
= {
&dev_attr_in_illuminance0_target_input.attr,
&dev_attr_in_illuminance0_calibrate.attr,
&dev_attr_in_illuminance0_lux_table.attr,
-   &dev_attr_in_proximity0_calibrate.attr,
+   &iio_const_attr_in_proximity0_calibscale_available.dev_attr.attr,
NULL
 };
 
 static struct attribute *tsl2x7x_PRX2_device_attrs[] = {
&dev_attr_in_proximity0_calibrate.attr,
-   &dev_attr_in_proximity0_calibscale_available.attr,
+   &iio_const_attr_in_proximity0_calibscale_available.dev_attr.attr,
NULL
 };
 
@@ -1485,7 +1478,7 @@ static struct attribute *tsl2x7x_ALSPRX2_device_attrs[] = 
{
&dev_attr_in_illuminance0_calibrate.attr,
&dev_attr_in_illuminance0_lux_table.attr,
&dev_attr_in_proximity0_calibrate.attr,
-   &dev_attr_in_proximity0_calibscale_available.attr,
+   &iio_const_attr_in_proximity0_calibscale_available.dev_attr.attr,
NULL
 };
 
-- 
2.13.6

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 13/13] staging: iio: tsl2x7x: add goto for TSL2X7X_LUX_CALC_OVER_FLOW

2017-10-19 Thread Brian Masney
This patch adds a return_max label for the two cases that need to set
the lux to TSL2X7X_LUX_CALC_OVER_FLOW and return.

Signed-off-by: Brian Masney 
---
 drivers/staging/iio/light/tsl2x7x.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x.c 
b/drivers/staging/iio/light/tsl2x7x.c
index 42ed9c015aaf..898304d65f64 100644
--- a/drivers/staging/iio/light/tsl2x7x.c
+++ b/drivers/staging/iio/light/tsl2x7x.c
@@ -364,10 +364,8 @@ static int tsl2x7x_get_lux(struct iio_dev *indio_dev)
chip->als_cur_info.als_ch0 = ch0;
chip->als_cur_info.als_ch1 = ch1;
 
-   if (ch0 >= chip->als_saturation || ch1 >= chip->als_saturation) {
-   lux = TSL2X7X_LUX_CALC_OVER_FLOW;
+   if (ch0 >= chip->als_saturation || ch1 >= chip->als_saturation)
goto return_max;
-   }
 
if (!ch0) {
/* have no data, so return LAST VALUE */
@@ -418,11 +416,12 @@ static int tsl2x7x_get_lux(struct iio_dev *indio_dev)
lux = lux64;
lux = (lux + 500) / 1000;
 
-   if (lux > TSL2X7X_LUX_CALC_OVER_FLOW) /* check for overflow */
+   if (lux > TSL2X7X_LUX_CALC_OVER_FLOW) { /* check for overflow */
+return_max:
lux = TSL2X7X_LUX_CALC_OVER_FLOW;
+   }
 
/* Update the structure with the latest lux. */
-return_max:
chip->als_cur_info.lux = lux;
ret = lux;
 
-- 
2.13.6

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 12/13] staging: iio: tsl2x7x: put function definitions on a single line

2017-10-19 Thread Brian Masney
The functions tsl2x7x_invoke_change() and tsl2x7x_prox_calculate() are
short enough that the return value and static declaration can be moved
onto the same line with the function name. This patch makes that change
to increase code readability.

Signed-off-by: Brian Masney 
---
 drivers/staging/iio/light/tsl2x7x.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x.c 
b/drivers/staging/iio/light/tsl2x7x.c
index f12ab1239a46..42ed9c015aaf 100644
--- a/drivers/staging/iio/light/tsl2x7x.c
+++ b/drivers/staging/iio/light/tsl2x7x.c
@@ -752,8 +752,7 @@ static int tsl2x7x_chip_off(struct iio_dev *indio_dev)
  * put device back into proper state, and unlock
  * resource.
  */
-static
-int tsl2x7x_invoke_change(struct iio_dev *indio_dev)
+static int tsl2x7x_invoke_change(struct iio_dev *indio_dev)
 {
struct tsl2X7X_chip *chip = iio_priv(indio_dev);
int device_status = chip->tsl2x7x_chip_status;
@@ -777,9 +776,8 @@ int tsl2x7x_invoke_change(struct iio_dev *indio_dev)
return ret;
 }
 
-static
-void tsl2x7x_prox_calculate(int *data, int length,
-   struct tsl2x7x_prox_stat *statP)
+static void tsl2x7x_prox_calculate(int *data, int length,
+  struct tsl2x7x_prox_stat *statP)
 {
int i;
int sample_sum;
-- 
2.13.6

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/13] staging: iio: tsl2x7x: correct alignment of parenthesis

2017-10-19 Thread Brian Masney
Correct error from checkpatch.pl to improve code readibility: Alignment
should match open parenthesis. This involved shortening the name of
tsl2x7x_als_gainadj and tsl2x7x_prx_gainadj to tsl2x7x_als_gain and
tsl2x7x_prx_gain respectively. This also required removing the
ch0lux and ch1lux local variables in order to get the line short
enough.

Signed-off-by: Brian Masney 
---
 drivers/staging/iio/light/tsl2x7x.c | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x.c 
b/drivers/staging/iio/light/tsl2x7x.c
index 6cc89cd6505e..886be9aa3c0f 100644
--- a/drivers/staging/iio/light/tsl2x7x.c
+++ b/drivers/staging/iio/light/tsl2x7x.c
@@ -243,14 +243,14 @@ static const struct tsl2x7x_settings 
tsl2x7x_default_settings = {
.prox_pulse_count = 8
 };
 
-static const s16 tsl2X7X_als_gainadj[] = {
+static const s16 tsl2x7x_als_gain[] = {
1,
8,
16,
120
 };
 
-static const s16 tsl2X7X_prx_gainadj[] = {
+static const s16 tsl2x7x_prx_gain[] = {
1,
2,
4,
@@ -384,11 +384,10 @@ static int tsl2x7x_get_lux(struct iio_dev *indio_dev)
if (p->ratio == 0) {
lux = 0;
} else {
-   ch0lux = DIV_ROUND_UP(ch0 * p->ch0,
-   tsl2X7X_als_gainadj[chip->settings.als_gain]);
-   ch1lux = DIV_ROUND_UP(ch1 * p->ch1,
-   tsl2X7X_als_gainadj[chip->settings.als_gain]);
-   lux = ch0lux - ch1lux;
+   lux = DIV_ROUND_UP(ch0 * p->ch0,
+  tsl2x7x_als_gain[chip->settings.als_gain]) -
+ DIV_ROUND_UP(ch1 * p->ch1,
+  tsl2x7x_als_gain[chip->settings.als_gain]);
}
 
/* note: lux is 31 bit max at this point */
@@ -1263,9 +1262,9 @@ static int tsl2x7x_read_raw(struct iio_dev *indio_dev,
break;
case IIO_CHAN_INFO_CALIBSCALE:
if (chan->type == IIO_LIGHT)
-   *val = tsl2X7X_als_gainadj[chip->settings.als_gain];
+   *val = tsl2x7x_als_gain[chip->settings.als_gain];
else
-   *val = tsl2X7X_prx_gainadj[chip->settings.prox_gain];
+   *val = tsl2x7x_prx_gain[chip->settings.prox_gain];
ret = IIO_VAL_INT;
break;
case IIO_CHAN_INFO_CALIBBIAS:
-- 
2.13.6

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/13] staging: iio: tsl2x7x: remove unnecessary parentheses

2017-10-19 Thread Brian Masney
This patch fixes the error 'Unnecessary parentheses around 'XXX' from
checkpatch.pl. It also fixes several other places with unnecessary
parentheses that checkpatch.pl did not detect.

Signed-off-by: Brian Masney 
---
 drivers/staging/iio/light/tsl2x7x.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x.c 
b/drivers/staging/iio/light/tsl2x7x.c
index 80968dd456a0..6cc89cd6505e 100644
--- a/drivers/staging/iio/light/tsl2x7x.c
+++ b/drivers/staging/iio/light/tsl2x7x.c
@@ -348,9 +348,9 @@ static int tsl2x7x_get_lux(struct iio_dev *indio_dev)
 
/* clear any existing interrupt status */
ret = i2c_smbus_write_byte(chip->client,
-  (TSL2X7X_CMD_REG |
+  TSL2X7X_CMD_REG |
   TSL2X7X_CMD_SPL_FN |
-  TSL2X7X_CMD_ALS_INT_CLR));
+  TSL2X7X_CMD_ALS_INT_CLR);
if (ret < 0) {
dev_err(&chip->client->dev,
"i2c_write_command failed - err = %d\n", ret);
@@ -364,7 +364,7 @@ static int tsl2x7x_get_lux(struct iio_dev *indio_dev)
chip->als_cur_info.als_ch0 = ch0;
chip->als_cur_info.als_ch1 = ch1;
 
-   if ((ch0 >= chip->als_saturation) || (ch1 >= chip->als_saturation)) {
+   if (ch0 >= chip->als_saturation || ch1 >= chip->als_saturation) {
lux = TSL2X7X_LUX_CALC_OVER_FLOW;
goto return_max;
}
@@ -697,14 +697,14 @@ static int tsl2x7x_chip_on(struct iio_dev *indio_dev)
dev_info(&chip->client->dev, "Setting Up Interrupt(s)\n");
 
reg_val = TSL2X7X_CNTL_PWR_ON | TSL2X7X_CNTL_ADC_ENBL;
-   if ((chip->settings.interrupts_en == 0x20) ||
-   (chip->settings.interrupts_en == 0x30))
+   if (chip->settings.interrupts_en == 0x20 ||
+   chip->settings.interrupts_en == 0x30)
reg_val |= TSL2X7X_CNTL_PROX_DET_ENBL;
 
reg_val |= chip->settings.interrupts_en;
ret = i2c_smbus_write_byte_data(chip->client,
-   (TSL2X7X_CMD_REG |
-   TSL2X7X_CNTRL), reg_val);
+   TSL2X7X_CMD_REG | TSL2X7X_CNTRL,
+   reg_val);
if (ret < 0)
dev_err(&chip->client->dev,
"%s: failed in tsl2x7x_IOCTL_INT_SET.\n",
@@ -1721,7 +1721,7 @@ static int tsl2x7x_probe(struct i2c_client *clientp,
return -EINVAL;
}
 
-   ret = i2c_smbus_write_byte(clientp, (TSL2X7X_CMD_REG | TSL2X7X_CNTRL));
+   ret = i2c_smbus_write_byte(clientp, TSL2X7X_CMD_REG | TSL2X7X_CNTRL);
if (ret < 0) {
dev_err(&clientp->dev, "write to cmd reg failed. err = %d\n",
ret);
-- 
2.13.6

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/13] staging: iio: tsl2x7x: fix alignment of break statements

2017-10-19 Thread Brian Masney
Correct the alignment of the break statements to match the alignment of
the rest of the code within the case statements.

Signed-off-by: Brian Masney 
---
 drivers/staging/iio/light/tsl2x7x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x.c 
b/drivers/staging/iio/light/tsl2x7x.c
index bb9fb60509cf..f12ab1239a46 100644
--- a/drivers/staging/iio/light/tsl2x7x.c
+++ b/drivers/staging/iio/light/tsl2x7x.c
@@ -466,7 +466,7 @@ static int tsl2x7x_get_prox(struct iio_dev *indio_dev)
case tmd2771:
if (!(ret & TSL2X7X_STA_ADC_VALID))
goto prox_poll_err;
-   break;
+   break;
case tsl2572:
case tsl2672:
case tmd2672:
@@ -474,7 +474,7 @@ static int tsl2x7x_get_prox(struct iio_dev *indio_dev)
case tmd2772:
if (!(ret & TSL2X7X_STA_PRX_VALID))
goto prox_poll_err;
-   break;
+   break;
}
 
for (i = 0; i < 2; i++) {
-- 
2.13.6

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/13] staging: iio: tsl2x7x: remove unnecessary struct iio_dev definition

2017-10-19 Thread Brian Masney
tsl2x7x.h has a blank definition for 'struct iio_dev' that is not
needed. This patch removes that definition.

Signed-off-by: Brian Masney 
---
 drivers/staging/iio/light/tsl2x7x.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x.h 
b/drivers/staging/iio/light/tsl2x7x.h
index a216c6943a84..df00f2ec1719 100644
--- a/drivers/staging/iio/light/tsl2x7x.h
+++ b/drivers/staging/iio/light/tsl2x7x.h
@@ -23,8 +23,6 @@
 #define __TSL2X7X_H
 #include 
 
-struct iio_dev;
-
 struct tsl2x7x_lux {
unsigned int ratio;
unsigned int ch0;
-- 
2.13.6

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/13] staging: iio: tsl2x7x: migrate *_thresh_period sysfs attributes to iio_event_spec

2017-10-19 Thread Brian Masney
The sysfs attributes in_intensity0_thresh_period and
in_proximity0_thresh_period are currently directly created by the driver.
This patch migrates the creation of these sysfs attributes from the driver
to using the IIO core via iio_event_spec.

Signed-off-by: Brian Masney 
---
Changes since v1:
- Use IIO_EV_DIR_EITHER instead of IIO_EV_DIR_NONE

 drivers/staging/iio/light/tsl2x7x.c | 196 ++--
 1 file changed, 52 insertions(+), 144 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x.c 
b/drivers/staging/iio/light/tsl2x7x.c
index e6a71f5fc9cb..2dd8c502fd7a 100644
--- a/drivers/staging/iio/light/tsl2x7x.c
+++ b/drivers/staging/iio/light/tsl2x7x.c
@@ -932,108 +932,6 @@ static ssize_t in_illuminance0_target_input_store(struct 
device *dev,
return len;
 }
 
-/* persistence settings */
-static ssize_t in_intensity0_thresh_period_show(struct device *dev,
-   struct device_attribute *attr,
-   char *buf)
-{
-   struct tsl2X7X_chip *chip = iio_priv(dev_to_iio_dev(dev));
-   int y, z, filter_delay;
-
-   /* Determine integration time */
-   y = (TSL2X7X_MAX_TIMER_CNT - (u8)chip->settings.als_time) + 1;
-   z = y * TSL2X7X_MIN_ITIME;
-   filter_delay = z * (chip->settings.persistence & 0x0F);
-   y = filter_delay / 1000;
-   z = filter_delay % 1000;
-
-   return snprintf(buf, PAGE_SIZE, "%d.%03d\n", y, z);
-}
-
-static ssize_t in_intensity0_thresh_period_store(struct device *dev,
-struct device_attribute *attr,
-const char *buf, size_t len)
-{
-   struct iio_dev *indio_dev = dev_to_iio_dev(dev);
-   struct tsl2X7X_chip *chip = iio_priv(indio_dev);
-   struct tsl2x7x_parse_result result;
-   int y, z, filter_delay;
-   int ret;
-
-   ret = iio_str_to_fixpoint(buf, 100, &result.integer, &result.fract);
-   if (ret)
-   return ret;
-
-   y = (TSL2X7X_MAX_TIMER_CNT - (u8)chip->settings.als_time) + 1;
-   z = y * TSL2X7X_MIN_ITIME;
-
-   filter_delay =
-   DIV_ROUND_UP((result.integer * 1000) + result.fract, z);
-
-   chip->settings.persistence &= 0xF0;
-   chip->settings.persistence |= (filter_delay & 0x0F);
-
-   dev_info(&chip->client->dev, "%s: als persistence = %d",
-__func__, filter_delay);
-
-   ret = tsl2x7x_invoke_change(indio_dev);
-   if (ret < 0)
-   return ret;
-
-   return IIO_VAL_INT_PLUS_MICRO;
-}
-
-static ssize_t in_proximity0_thresh_period_show(struct device *dev,
-struct device_attribute *attr,
-char *buf)
-{
-   struct tsl2X7X_chip *chip = iio_priv(dev_to_iio_dev(dev));
-   int y, z, filter_delay;
-
-   /* Determine integration time */
-   y = (TSL2X7X_MAX_TIMER_CNT - (u8)chip->settings.prx_time) + 1;
-   z = y * TSL2X7X_MIN_ITIME;
-   filter_delay = z * ((chip->settings.persistence & 0xF0) >> 4);
-   y = filter_delay / 1000;
-   z = filter_delay % 1000;
-
-   return snprintf(buf, PAGE_SIZE, "%d.%03d\n", y, z);
-}
-
-static ssize_t in_proximity0_thresh_period_store(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t len)
-{
-   struct iio_dev *indio_dev = dev_to_iio_dev(dev);
-   struct tsl2X7X_chip *chip = iio_priv(indio_dev);
-   struct tsl2x7x_parse_result result;
-   int y, z, filter_delay;
-   int ret;
-
-   ret = iio_str_to_fixpoint(buf, 100, &result.integer, &result.fract);
-   if (ret)
-   return ret;
-
-   y = (TSL2X7X_MAX_TIMER_CNT - (u8)chip->settings.prx_time) + 1;
-   z = y * TSL2X7X_MIN_ITIME;
-
-   filter_delay =
-   DIV_ROUND_UP((result.integer * 1000) + result.fract, z);
-
-   chip->settings.persistence &= 0x0F;
-   chip->settings.persistence |= ((filter_delay << 4) & 0xF0);
-
-   dev_info(&chip->client->dev, "%s: prox persistence = %d",
-__func__, filter_delay);
-
-   ret = tsl2x7x_invoke_change(indio_dev);
-   if (ret < 0)
-   return ret;
-
-
-   return IIO_VAL_INT_PLUS_MICRO;
-}
-
 static ssize_t in_illuminance0_calibrate_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t len)
@@ -1198,7 +1096,8 @@ static int tsl2x7x_write_event_value(struct iio_dev 
*indio_dev,
 int val, int val2)
 {
struct tsl2X7X_chip *chip = iio_priv(indio_dev);
-   int ret = -EINVAL;
+   int ret = -EINVAL, y, z, filter_delay;
+   u8 time;
 
switch (info) {
case IIO_EV_INFO_VALUE:
@@ -1230,6 +1129,33 @@ static int tsl2x7x_write_eve

[PATCH 05/13] staging: iio: tsl2x7x: changed #defines to be aligned on the same column

2017-10-19 Thread Brian Masney
Some of the existing #defines have tabs between the name, and the value,
while others have spaces. The alignment of the values mostly has a
consistent layout, but there are some that don't. Change all of the
defines so that the name and value is separated by tabs and all of the
values start on the same column to increase code readability. This patch
also removes the unnecessary parentheses around the value of
TSL2X7X_MAX_TIMER_CNT.

Signed-off-by: Brian Masney 
---
 drivers/staging/iio/light/tsl2x7x.c | 132 ++--
 1 file changed, 66 insertions(+), 66 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x.c 
b/drivers/staging/iio/light/tsl2x7x.c
index d407c3ad7e2f..3a3340aadc1a 100644
--- a/drivers/staging/iio/light/tsl2x7x.c
+++ b/drivers/staging/iio/light/tsl2x7x.c
@@ -29,98 +29,98 @@
 #include "tsl2x7x.h"
 
 /* Cal defs*/
-#define PROX_STAT_CAL0
-#define PROX_STAT_SAMP   1
-#define MAX_SAMPLES_CAL  200
+#define PROX_STAT_CAL  0
+#define PROX_STAT_SAMP 1
+#define MAX_SAMPLES_CAL200
 
 /* TSL2X7X Device ID */
-#define TRITON_ID0x00
-#define SWORDFISH_ID 0x30
-#define HALIBUT_ID   0x20
+#define TRITON_ID  0x00
+#define SWORDFISH_ID   0x30
+#define HALIBUT_ID 0x20
 
 /* Lux calculation constants */
-#define TSL2X7X_LUX_CALC_OVER_FLOW 65535
+#define TSL2X7X_LUX_CALC_OVER_FLOW 65535
 
 /* TAOS Register definitions - note:
  * depending on device, some of these register are not used and the
  * register address is benign.
  */
 /* 2X7X register offsets */
-#define TSL2X7X_MAX_CONFIG_REG 16
+#define TSL2X7X_MAX_CONFIG_REG 16
 
 /* Device Registers and Masks */
-#define TSL2X7X_CNTRL  0x00
-#define TSL2X7X_ALS_TIME   0X01
-#define TSL2X7X_PRX_TIME   0x02
-#define TSL2X7X_WAIT_TIME  0x03
-#define TSL2X7X_ALS_MINTHRESHLO0X04
-#define TSL2X7X_ALS_MINTHRESHHI0X05
-#define TSL2X7X_ALS_MAXTHRESHLO0X06
-#define TSL2X7X_ALS_MAXTHRESHHI0X07
-#define TSL2X7X_PRX_MINTHRESHLO0X08
-#define TSL2X7X_PRX_MINTHRESHHI0X09
-#define TSL2X7X_PRX_MAXTHRESHLO0X0A
-#define TSL2X7X_PRX_MAXTHRESHHI0X0B
-#define TSL2X7X_PERSISTENCE0x0C
-#define TSL2X7X_PRX_CONFIG 0x0D
-#define TSL2X7X_PRX_COUNT  0x0E
-#define TSL2X7X_GAIN   0x0F
-#define TSL2X7X_NOTUSED0x10
-#define TSL2X7X_REVID  0x11
-#define TSL2X7X_CHIPID 0x12
-#define TSL2X7X_STATUS 0x13
-#define TSL2X7X_ALS_CHAN0LO0x14
-#define TSL2X7X_ALS_CHAN0HI0x15
-#define TSL2X7X_ALS_CHAN1LO0x16
-#define TSL2X7X_ALS_CHAN1HI0x17
-#define TSL2X7X_PRX_LO 0x18
-#define TSL2X7X_PRX_HI 0x19
+#define TSL2X7X_CNTRL  0x00
+#define TSL2X7X_ALS_TIME   0X01
+#define TSL2X7X_PRX_TIME   0x02
+#define TSL2X7X_WAIT_TIME  0x03
+#define TSL2X7X_ALS_MINTHRESHLO0X04
+#define TSL2X7X_ALS_MINTHRESHHI0X05
+#define TSL2X7X_ALS_MAXTHRESHLO0X06
+#define TSL2X7X_ALS_MAXTHRESHHI0X07
+#define TSL2X7X_PRX_MINTHRESHLO0X08
+#define TSL2X7X_PRX_MINTHRESHHI0X09
+#define TSL2X7X_PRX_MAXTHRESHLO0X0A
+#define TSL2X7X_PRX_MAXTHRESHHI0X0B
+#define TSL2X7X_PERSISTENCE0x0C
+#define TSL2X7X_PRX_CONFIG 0x0D
+#define TSL2X7X_PRX_COUNT  0x0E
+#define TSL2X7X_GAIN   0x0F
+#define TSL2X7X_NOTUSED0x10
+#define TSL2X7X_REVID  0x11
+#define TSL2X7X_CHIPID 0x12
+#define TSL2X7X_STATUS 0x13
+#define TSL2X7X_ALS_CHAN0LO0x14
+#define TSL2X7X_ALS_CHAN0HI0x15
+#define TSL2X7X_ALS_CHAN1LO0x16
+#define TSL2X7X_ALS_CHAN1HI0x17
+#define TSL2X7X_PRX_LO 0x18
+#define TSL2X7X_PRX_HI 0x19
 
 /* tsl2X7X cmd reg masks */
-#define TSL2X7X_CMD_REG0x80
-#define TSL2X7X_CMD_SPL_FN 0x60
+#define TSL2X7X_CMD_REG0x80
+#define TSL2X7X_CMD_SPL_FN 0x60
 
-#define TSL2X7X_CMD_PROX_INT_CLR   0X05
-#define TSL2X7X_CMD_ALS_INT_CLR0x06
-#define TSL2X7X_CMD_PROXALS_INT_CLR0X07
+#define TSL2X7X_CMD_PROX_INT_CLR   0X05
+#define TSL2X7X_CMD_ALS_INT_CLR0x06
+#define TSL2X7X_CMD_PROXALS_INT_CLR0X07
 
 /* tsl2X7X cntrl reg masks */
-#define TSL2X7X_CNTL_ADC_ENBL  0x02
-#define TSL2X7X_CNTL_PWR_ON0x01
+#define TSL2X7X_CNTL_ADC_ENBL  0x02
+#define TSL2X7X_CNTL_PWR_ON0x01
 
 /* tsl2X7X status reg masks */
-#define TSL2X7X_STA_ADC_VALID  0x01
-#define TSL2X7X_STA_P

[PATCH 00/13] staging: iio: tsl2x7x: staging cleanups

2017-10-19 Thread Brian Masney
Here are some cleanup patches to work towards eventually moving this
driver out of staging. The most interesting changes are converting
in_intensity0_thresh_period and in_proximity0_thresh_period to be
created by the IIO core instead of directly by the driver. The rest of
the changes are trivial code cleanups to improve code readability
that will be required for a staging graduation:

- Convert in_proximity0_calibscale_available to IIO_CONST_ATTR
- Remove unused structures
- Sort #includes
- Remove unnecessary parentheses
- Code alignment cleanups

Brian Masney (13):
  staging: iio: tsl2x7x: migrate *_thresh_period sysfs attributes to
iio_event_spec
  staging: iio: tsl2x7x: remove unused tsl2x7x_parse_result structure
  staging: iio: tsl2x7x: sort #includes
  staging: iio: tsl2x7x: remove unnecessary struct iio_dev definition
  staging: iio: tsl2x7x: changed #defines to be aligned on the same
column
  staging: iio: tsl2x7x: convert in_proximity0_calibscale_available to
use IIO_CONST_ATTR
  staging: iio: tsl2x7x: remove unnecessary parentheses
  staging: iio: tsl2x7x: correct alignment of parenthesis
  staging: iio: tsl2x7x: correct alignment of parenthesis
  staging: iio: tsl2x7x: rename power defines to improve code
readability
  staging: iio: tsl2x7x: fix alignment of break statements
  staging: iio: tsl2x7x: put function definitions on a single line
  staging: iio: tsl2x7x: add goto for TSL2X7X_LUX_CALC_OVER_FLOW

 drivers/staging/iio/light/tsl2x7x.c | 447 ++--
 drivers/staging/iio/light/tsl2x7x.h |   2 -
 2 files changed, 170 insertions(+), 279 deletions(-)

-- 
2.13.6

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/13] staging: iio: tsl2x7x: rename power defines to improve code readability

2017-10-19 Thread Brian Masney
The LED power defines are named like TSL2X7X_mAXXX. Rename these values
to TSL2X7X_XXX_mA to improve code readability.

Signed-off-by: Brian Masney 
---
 drivers/staging/iio/light/tsl2x7x.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x.c 
b/drivers/staging/iio/light/tsl2x7x.c
index 70007117d985..bb9fb60509cf 100644
--- a/drivers/staging/iio/light/tsl2x7x.c
+++ b/drivers/staging/iio/light/tsl2x7x.c
@@ -114,10 +114,10 @@
 #define TSL2X7X_DIODE_BOTH 0x30
 
 /* LED Power */
-#define TSL2X7X_mA100  0x00
-#define TSL2X7X_mA50   0x40
-#define TSL2X7X_mA25   0x80
-#define TSL2X7X_mA13   0xD0
+#define TSL2X7X_100_mA 0x00
+#define TSL2X7X_50_mA  0x40
+#define TSL2X7X_25_mA  0x80
+#define TSL2X7X_13_mA  0xD0
 #define TSL2X7X_MAX_TIMER_CNT  0xFF
 
 #define TSL2X7X_MIN_ITIME  3
@@ -636,7 +636,7 @@ static int tsl2x7x_chip_on(struct iio_dev *indio_dev)
/* Set the gain based on tsl2x7x_settings struct */
chip->tsl2x7x_config[TSL2X7X_GAIN] =
chip->settings.als_gain |
-   (TSL2X7X_mA100 | TSL2X7X_DIODE1) |
+   (TSL2X7X_100_mA | TSL2X7X_DIODE1) |
(chip->settings.prox_gain << 2);
 
/* set chip struct re scaling and saturation */
-- 
2.13.6

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/13] staging: iio: tsl2x7x: correct alignment of parenthesis

2017-10-19 Thread Brian Masney
Correct error from checkpatch.pl to improve code readibility: Alignment
should match open parenthesis. An unnecessary cast to 'struct
tsl2x7x_lux *' was removed and the return value of static definition of
in_illuminance0_calibscale_available_show() was put on its own line
due to the length of that sysfs attribute.

Signed-off-by: Brian Masney 
---
 drivers/staging/iio/light/tsl2x7x.c | 35 ++-
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x.c 
b/drivers/staging/iio/light/tsl2x7x.c
index 886be9aa3c0f..70007117d985 100644
--- a/drivers/staging/iio/light/tsl2x7x.c
+++ b/drivers/staging/iio/light/tsl2x7x.c
@@ -521,8 +521,8 @@ static void tsl2x7x_defaults(struct tsl2X7X_chip *chip)
   sizeof(chip->pdata->platform_lux_table));
else
memcpy(chip->tsl2x7x_device_lux,
-   (struct tsl2x7x_lux *)tsl2x7x_default_lux_table_group[chip->id],
-   TSL2X7X_DEFAULT_TABLE_BYTES);
+  tsl2x7x_default_lux_table_group[chip->id],
+  TSL2X7X_DEFAULT_TABLE_BYTES);
 }
 
 /**
@@ -867,9 +867,10 @@ static void tsl2x7x_prox_cal(struct iio_dev *indio_dev)
tsl2x7x_chip_on(indio_dev);
 }
 
-static ssize_t in_illuminance0_calibscale_available_show(struct device *dev,
-  struct device_attribute *attr,
-  char *buf)
+static ssize_t
+in_illuminance0_calibscale_available_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
 {
struct tsl2X7X_chip *chip = iio_priv(dev_to_iio_dev(dev));
 
@@ -891,8 +892,8 @@ static 
IIO_CONST_ATTR(in_illuminance0_integration_time_available,
".00272 - .696");
 
 static ssize_t in_illuminance0_target_input_show(struct device *dev,
-  struct device_attribute *attr,
-  char *buf)
+struct device_attribute *attr,
+char *buf)
 {
struct tsl2X7X_chip *chip = iio_priv(dev_to_iio_dev(dev));
 
@@ -900,8 +901,8 @@ static ssize_t in_illuminance0_target_input_show(struct 
device *dev,
 }
 
 static ssize_t in_illuminance0_target_input_store(struct device *dev,
-   struct device_attribute *attr,
-   const char *buf, size_t len)
+ struct device_attribute *attr,
+ const char *buf, size_t len)
 {
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct tsl2X7X_chip *chip = iio_priv(indio_dev);
@@ -922,8 +923,8 @@ static ssize_t in_illuminance0_target_input_store(struct 
device *dev,
 }
 
 static ssize_t in_illuminance0_calibrate_store(struct device *dev,
-   struct device_attribute *attr,
-   const char *buf, size_t len)
+  struct device_attribute *attr,
+  const char *buf, size_t len)
 {
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
bool value;
@@ -943,8 +944,8 @@ static ssize_t in_illuminance0_calibrate_store(struct 
device *dev,
 }
 
 static ssize_t in_illuminance0_lux_table_show(struct device *dev,
-struct device_attribute *attr,
-char *buf)
+ struct device_attribute *attr,
+ char *buf)
 {
struct tsl2X7X_chip *chip = iio_priv(dev_to_iio_dev(dev));
int i = 0;
@@ -971,8 +972,8 @@ static ssize_t in_illuminance0_lux_table_show(struct device 
*dev,
 }
 
 static ssize_t in_illuminance0_lux_table_store(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t len)
+  struct device_attribute *attr,
+  const char *buf, size_t len)
 {
struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct tsl2X7X_chip *chip = iio_priv(indio_dev);
@@ -1013,8 +1014,8 @@ static ssize_t in_illuminance0_lux_table_store(struct 
device *dev,
 }
 
 static ssize_t in_proximity0_calibrate_store(struct device *dev,
-struct device_attribute *attr,
-const char *buf, size_t len)
+struct device_attribute *attr,
+const char *buf, size_t len)
 {
struct iio_dev *indio_dev = dev_to_iio

[PATCH 03/13] staging: iio: tsl2x7x: sort #includes

2017-10-19 Thread Brian Masney
Sort the #include statements for increased code readability.

Signed-off-by: Brian Masney 
---
 drivers/staging/iio/light/tsl2x7x.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x.c 
b/drivers/staging/iio/light/tsl2x7x.c
index 094ab76b5d60..d407c3ad7e2f 100644
--- a/drivers/staging/iio/light/tsl2x7x.c
+++ b/drivers/staging/iio/light/tsl2x7x.c
@@ -15,14 +15,14 @@
  * more details.
  */
 
-#include 
-#include 
-#include 
 #include 
-#include 
+#include 
+#include 
 #include 
-#include 
+#include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
-- 
2.13.6

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3 1/2] staging: Introduce NVIDIA Tegra20 video decoder driver

2017-10-19 Thread Rob Herring
On Tue, Oct 17, 2017 at 4:26 PM, Dmitry Osipenko  wrote:
> On 18.10.2017 00:13, Rob Herring wrote:
>> On Tue, Oct 17, 2017 at 3:24 PM, Thierry Reding
>>  wrote:
>>> On Tue, Oct 17, 2017 at 03:13:54PM -0500, Rob Herring wrote:
>>> [...]
> diff --git 
> a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-vde.txt 
> b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-vde.txt
>>> [...]
> +- resets : Must contain an entry for each entry in reset-names.
> +  See ../reset/reset.txt for details.
> +- reset-names : Must include the following entries:
> +  - vde

 -names is pointless when there is only one.
>>>
>>> I'd prefer to keep it. In the past we occasionally had to add clocks or
>>> resets to a device tree node where only one had been present (and hence
>>> no -names property) and that caused some awkwardness because verbiage
>>> had to be added to the bindings that clarified that one particular entry
>>> (the original one) always had to come first.
>>
>> The order should be specified regardless of -names and the original
>> one has to come first if you add any. That's not awkwardness, but how
>> bindings work.
>
> Probably it would be okay to remove '-names' from the binding doc, but keep 
> them
> in the actual DT, wouldn't it?

No. Then where are the names documented?

Rob
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 2/5] media: dt: bindings: Add binding for NVIDIA Tegra Video Decoder Engine

2017-10-19 Thread Dmitry Osipenko
Add binding documentation for the Video Decoder Engine which is found
on NVIDIA Tegra20/30/114/124/132 SoC's.

Signed-off-by: Dmitry Osipenko 
---
 .../devicetree/bindings/media/nvidia,tegra-vde.txt | 55 ++
 1 file changed, 55 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/nvidia,tegra-vde.txt

diff --git a/Documentation/devicetree/bindings/media/nvidia,tegra-vde.txt 
b/Documentation/devicetree/bindings/media/nvidia,tegra-vde.txt
new file mode 100644
index ..470237ed6fe5
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/nvidia,tegra-vde.txt
@@ -0,0 +1,55 @@
+NVIDIA Tegra Video Decoder Engine
+
+Required properties:
+- compatible : Must contain one of the following values:
+   - "nvidia,tegra20-vde"
+   - "nvidia,tegra30-vde"
+   - "nvidia,tegra114-vde"
+   - "nvidia,tegra124-vde"
+   - "nvidia,tegra132-vde"
+- reg : Must contain an entry for each entry in reg-names.
+- reg-names : Must include the following entries:
+  - sxe
+  - bsev
+  - mbe
+  - ppe
+  - mce
+  - tfe
+  - ppb
+  - vdma
+  - frameid
+- iram : Must contain phandle to the mmio-sram device node that represents
+ IRAM region used by VDE.
+- interrupts : Must contain an entry for each entry in interrupt-names.
+- interrupt-names : Must include the following entries:
+  - sync-token
+  - bsev
+  - sxe
+- clocks : Must include the following entries:
+  - vde
+- resets : Must include the following entries:
+  - vde
+
+Example:
+
+video-codec@6001a000 {
+   compatible = "nvidia,tegra20-vde";
+   reg = <0x6001a000 0x1000 /* Syntax Engine */
+  0x6001b000 0x1000 /* Video Bitstream Engine */
+  0x6001c000  0x100 /* Macroblock Engine */
+  0x6001c200  0x100 /* Post-processing Engine */
+  0x6001c400  0x100 /* Motion Compensation Engine */
+  0x6001c600  0x100 /* Transform Engine */
+  0x6001c800  0x100 /* Pixel prediction block */
+  0x6001ca00  0x100 /* Video DMA */
+  0x6001d800  0x300 /* Video frame controls */>;
+   reg-names = "sxe", "bsev", "mbe", "ppe", "mce",
+   "tfe", "ppb", "vdma", "frameid";
+   iram = <&vde_pool>; /* IRAM region */
+   interrupts = , /* Sync token interrupt 
*/
+, /* BSE-V interrupt */
+; /* SXE interrupt */
+   interrupt-names = "sync-token", "bsev", "sxe";
+   clocks = <&tegra_car TEGRA20_CLK_VDE>;
+   resets = <&tegra_car 61>;
+};
-- 
2.14.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 4/5] ARM: dts: tegra20: Add video decoder node

2017-10-19 Thread Dmitry Osipenko
Add Video Decoder Engine device node.

Signed-off-by: Dmitry Osipenko 
---
 arch/arm/boot/dts/tegra20.dtsi | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
index aaf32f96f1e8..6b2d7bf5c707 100644
--- a/arch/arm/boot/dts/tegra20.dtsi
+++ b/arch/arm/boot/dts/tegra20.dtsi
@@ -15,6 +15,11 @@
#address-cells = <1>;
#size-cells = <1>;
ranges = <0 0x4000 0x4>;
+
+   vde_pool: vde {
+   reg = <0x400 0x3fc00>;
+   pool;
+   };
};
 
host1x@5000 {
@@ -257,6 +262,28 @@
*/
};
 
+   vde@6001a000 {
+   compatible = "nvidia,tegra20-vde";
+   reg = <0x6001a000 0x1000   /* Syntax Engine */
+  0x6001b000 0x1000   /* Video Bitstream Engine */
+  0x6001c000  0x100   /* Macroblock Engine */
+  0x6001c200  0x100   /* Post-processing Engine */
+  0x6001c400  0x100   /* Motion Compensation Engine */
+  0x6001c600  0x100   /* Transform Engine */
+  0x6001c800  0x100   /* Pixel prediction block */
+  0x6001ca00  0x100   /* Video DMA */
+  0x6001d800  0x300>; /* Video frame controls */
+   reg-names = "sxe", "bsev", "mbe", "ppe", "mce",
+   "tfe", "ppb", "vdma", "frameid";
+   iram = <&vde_pool>; /* IRAM region */
+   interrupts = , /* Sync token 
interrupt */
+, /* BSE-V 
interrupt */
+; /* SXE interrupt 
*/
+   interrupt-names = "sync-token", "bsev", "sxe";
+   clocks = <&tegra_car TEGRA20_CLK_VDE>;
+   resets = <&tegra_car 61>;
+   };
+
apbmisc@7800 {
compatible = "nvidia,tegra20-apbmisc";
reg = <0x7800 0x64   /* Chip revision */
-- 
2.14.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 5/5] ARM: defconfig: tegra: Enable Video Decoder driver

2017-10-19 Thread Dmitry Osipenko
Compile Tegra VDE driver as a module.

Signed-off-by: Dmitry Osipenko 
---
 arch/arm/configs/tegra_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig
index 6678f2929356..c931bd48f7fd 100644
--- a/arch/arm/configs/tegra_defconfig
+++ b/arch/arm/configs/tegra_defconfig
@@ -29,7 +29,6 @@ CONFIG_PCI_MSI=y
 CONFIG_PCI_TEGRA=y
 CONFIG_SMP=y
 CONFIG_PREEMPT=y
-CONFIG_AEABI=y
 CONFIG_HIGHMEM=y
 CONFIG_CMA=y
 CONFIG_ZBOOT_ROM_TEXT=0x0
@@ -256,6 +255,7 @@ CONFIG_KEYBOARD_NVEC=y
 CONFIG_SERIO_NVEC_PS2=y
 CONFIG_NVEC_POWER=y
 CONFIG_NVEC_PAZ00=y
+CONFIG_TEGRA_VDE=m
 CONFIG_TEGRA_IOMMU_GART=y
 CONFIG_TEGRA_IOMMU_SMMU=y
 CONFIG_ARCH_TEGRA_2x_SOC=y
-- 
2.14.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 1/5] ARM: tegra: Add device tree node to describe IRAM

2017-10-19 Thread Dmitry Osipenko
From: Vladimir Zapolskiy 

All Tegra SoCs contain 256KiB IRAM, which is used to store CPU resume code
and by hardware engines like a video decoder.

Signed-off-by: Vladimir Zapolskiy 
---
 arch/arm/boot/dts/tegra114.dtsi | 8 
 arch/arm/boot/dts/tegra124.dtsi | 8 
 arch/arm/boot/dts/tegra20.dtsi  | 8 
 arch/arm/boot/dts/tegra30.dtsi  | 8 
 4 files changed, 32 insertions(+)

diff --git a/arch/arm/boot/dts/tegra114.dtsi b/arch/arm/boot/dts/tegra114.dtsi
index 8932ea3afd5f..13f6087790c8 100644
--- a/arch/arm/boot/dts/tegra114.dtsi
+++ b/arch/arm/boot/dts/tegra114.dtsi
@@ -10,6 +10,14 @@
compatible = "nvidia,tegra114";
interrupt-parent = <&lic>;
 
+   iram@4000 {
+   compatible = "mmio-sram";
+   reg = <0x4000 0x4>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges = <0 0x4000 0x4>;
+   };
+
host1x@5000 {
compatible = "nvidia,tegra114-host1x", "simple-bus";
reg = <0x5000 0x00028000>;
diff --git a/arch/arm/boot/dts/tegra124.dtsi b/arch/arm/boot/dts/tegra124.dtsi
index 8baf00b89efb..a3585ed82646 100644
--- a/arch/arm/boot/dts/tegra124.dtsi
+++ b/arch/arm/boot/dts/tegra124.dtsi
@@ -14,6 +14,14 @@
#address-cells = <2>;
#size-cells = <2>;
 
+   iram@4000 {
+   compatible = "mmio-sram";
+   reg = <0x0 0x4000 0x0 0x4>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges = <0 0x0 0x4000 0x4>;
+   };
+
pcie@1003000 {
compatible = "nvidia,tegra124-pcie";
device_type = "pci";
diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
index 7c85f97f72ea..aaf32f96f1e8 100644
--- a/arch/arm/boot/dts/tegra20.dtsi
+++ b/arch/arm/boot/dts/tegra20.dtsi
@@ -9,6 +9,14 @@
compatible = "nvidia,tegra20";
interrupt-parent = <&lic>;
 
+   iram@4000 {
+   compatible = "mmio-sram";
+   reg = <0x4000 0x4>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges = <0 0x4000 0x4>;
+   };
+
host1x@5000 {
compatible = "nvidia,tegra20-host1x", "simple-bus";
reg = <0x5000 0x00024000>;
diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
index 13960fda7471..3b447c64bf69 100644
--- a/arch/arm/boot/dts/tegra30.dtsi
+++ b/arch/arm/boot/dts/tegra30.dtsi
@@ -10,6 +10,14 @@
compatible = "nvidia,tegra30";
interrupt-parent = <&lic>;
 
+   iram@4000 {
+   compatible = "mmio-sram";
+   reg = <0x4000 0x4>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges = <0 0x4000 0x4>;
+   };
+
pcie@3000 {
compatible = "nvidia,tegra30-pcie";
device_type = "pci";
-- 
2.14.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v4 3/5] staging: Introduce NVIDIA Tegra video decoder driver

2017-10-19 Thread Dmitry Osipenko
NVIDIA Tegra20/30/114/124/132 SoC's have video decoder engine that
supports standard set of video formats like H.264 / MPEG-4 / WMV / VC1.
Currently implemented decoding of CAVLC H.264 on Tegra20 only.

Signed-off-by: Dmitry Osipenko 
---
 drivers/staging/Kconfig|2 +
 drivers/staging/Makefile   |1 +
 drivers/staging/tegra-vde/Kconfig  |7 +
 drivers/staging/tegra-vde/Makefile |1 +
 drivers/staging/tegra-vde/TODO |5 +
 drivers/staging/tegra-vde/uapi.h   |  101 +++
 drivers/staging/tegra-vde/vde.c| 1209 
 7 files changed, 1326 insertions(+)
 create mode 100644 drivers/staging/tegra-vde/Kconfig
 create mode 100644 drivers/staging/tegra-vde/Makefile
 create mode 100644 drivers/staging/tegra-vde/TODO
 create mode 100644 drivers/staging/tegra-vde/uapi.h
 create mode 100644 drivers/staging/tegra-vde/vde.c

diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index 554683912cff..10c982811093 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -118,4 +118,6 @@ source "drivers/staging/vboxvideo/Kconfig"
 
 source "drivers/staging/pi433/Kconfig"
 
+source "drivers/staging/tegra-vde/Kconfig"
+
 endif # STAGING
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 8951c37d8d80..c5ef39767f22 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -49,3 +49,4 @@ obj-$(CONFIG_BCM2835_VCHIQ)   += vc04_services/
 obj-$(CONFIG_CRYPTO_DEV_CCREE) += ccree/
 obj-$(CONFIG_DRM_VBOXVIDEO)+= vboxvideo/
 obj-$(CONFIG_PI433)+= pi433/
+obj-$(CONFIG_TEGRA_VDE)+= tegra-vde/
diff --git a/drivers/staging/tegra-vde/Kconfig 
b/drivers/staging/tegra-vde/Kconfig
new file mode 100644
index ..ec3ebdaa
--- /dev/null
+++ b/drivers/staging/tegra-vde/Kconfig
@@ -0,0 +1,7 @@
+config TEGRA_VDE
+   tristate "NVIDIA Tegra Video Decoder Engine driver"
+   depends on ARCH_TEGRA || COMPILE_TEST
+   select SRAM
+   help
+   Say Y here to enable support for the NVIDIA Tegra video decoder
+   driver.
diff --git a/drivers/staging/tegra-vde/Makefile 
b/drivers/staging/tegra-vde/Makefile
new file mode 100644
index ..e7c0df1174bf
--- /dev/null
+++ b/drivers/staging/tegra-vde/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_TEGRA_VDE)+= vde.o
diff --git a/drivers/staging/tegra-vde/TODO b/drivers/staging/tegra-vde/TODO
new file mode 100644
index ..e98bbc7b3c19
--- /dev/null
+++ b/drivers/staging/tegra-vde/TODO
@@ -0,0 +1,5 @@
+TODO:
+   - Figure out how generic V4L2 API could be utilized by this driver,
+ implement it.
+
+Contact: Dmitry Osipenko 
diff --git a/drivers/staging/tegra-vde/uapi.h b/drivers/staging/tegra-vde/uapi.h
new file mode 100644
index ..8502032b5ee2
--- /dev/null
+++ b/drivers/staging/tegra-vde/uapi.h
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2016-2017 Dmitry Osipenko 
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _UAPI_TEGRA_VDE_H_
+#define _UAPI_TEGRA_VDE_H_
+
+#include 
+#include 
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#define FLAG_B_FRAME   (1 << 0)
+#define FLAG_REFERENCE (1 << 1)
+
+struct tegra_vde_h264_frame {
+   __s32 y_fd;
+   __s32 cb_fd;
+   __s32 cr_fd;
+   __s32 aux_fd;
+   __u32 y_offset;
+   __u32 cb_offset;
+   __u32 cr_offset;
+   __u32 aux_offset;
+   __u32 frame_num;
+   __u32 flags;
+
+   __u32 reserved;
+} __attribute__((packed));
+
+struct tegra_vde_h264_decoder_ctx {
+   __s32 bitstream_data_fd;
+   __u32 bitstream_data_offset;
+
+   __u64 dpb_frames_ptr;
+   __u8  dpb_frames_nb;
+   __u8  dpb_ref_frames_with_earlier_poc_nb;
+
+   // SPS
+   __u8  baseline_profile;
+   __u8  level_idc;
+   __u8  log2_max_pic_order_cnt_lsb;
+   __u8  log2_max

[PATCH v4 0/5] NVIDIA Tegra20 video decoder driver

2017-10-19 Thread Dmitry Osipenko
VDE driver provides accelerated video decoding to NVIDIA Tegra SoC's,
it is a result of reverse-engineering efforts. Driver has been tested on
Toshiba AC100 and Acer A500, it should work on any Tegra20 device.

In userspace this driver is utilized by libvdpau-tegra [0] that implements
VDPAU interface, so any video player that supports VDPAU can provide
accelerated video decoding on Tegra20 on Linux.

[0] https://github.com/grate-driver/libvdpau-tegra

Change log:
v4:
- Added mmio-sram "IRAM DT node" patch from Vladimir Zapolskiy to
  the series, I modified it to cover all Tegra's and not only Tegra20
- Utilized genalloc for the reservation of IRAM region as per
  Vladimir's suggestion, VDE driver now selects SRAM driver in Kconfig
- Added defconfig patch to the series
- Described VDE registers in DT per HW unit, excluding BSE-A / UCQ
  and holes between the units
- Extended DT compatibility property with Tegra30/114/124/132 in the
  binding doc.
- Removed BSE-A interrupt from the DT binding because it's very
  likely that Audio Bitstream Engine isn't integrated with VDE
- Removed UCQ interrupt from the DT binding because in TRM it is
  represented as a distinct HW block that probably should have
  its own driver
- Addressed v3 review comments: factored out DT binding addition
  into a standalone patch, moved binding to media/, removed
  clocks/resets-names

v3:
- Suppressed compilation warnings reported by 'kbuild test robot'

v2:
- Addressed v1 review comments from Stephen Warren and Dan Carpenter
- Implemented runtime PM
- Miscellaneous code cleanups
- Changed 'TODO'
- CC'd media maintainers for the review as per Greg's K-H request,
  v1 can be viewed at https://lkml.org/lkml/2017/9/25/606

Dmitry Osipenko (4):
  media: dt: bindings: Add binding for NVIDIA Tegra Video Decoder Engine
  staging: Introduce NVIDIA Tegra video decoder driver
  ARM: dts: tegra20: Add video decoder node
  ARM: defconfig: tegra: Enable Video Decoder driver

Vladimir Zapolskiy (1):
  ARM: tegra: Add device tree node to describe IRAM

 .../devicetree/bindings/media/nvidia,tegra-vde.txt |   55 +
 arch/arm/boot/dts/tegra114.dtsi|8 +
 arch/arm/boot/dts/tegra124.dtsi|8 +
 arch/arm/boot/dts/tegra20.dtsi |   35 +
 arch/arm/boot/dts/tegra30.dtsi |8 +
 arch/arm/configs/tegra_defconfig   |2 +-
 drivers/staging/Kconfig|2 +
 drivers/staging/Makefile   |1 +
 drivers/staging/tegra-vde/Kconfig  |7 +
 drivers/staging/tegra-vde/Makefile |1 +
 drivers/staging/tegra-vde/TODO |5 +
 drivers/staging/tegra-vde/uapi.h   |  101 ++
 drivers/staging/tegra-vde/vde.c| 1209 
 13 files changed, 1441 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/media/nvidia,tegra-vde.txt
 create mode 100644 drivers/staging/tegra-vde/Kconfig
 create mode 100644 drivers/staging/tegra-vde/Makefile
 create mode 100644 drivers/staging/tegra-vde/TODO
 create mode 100644 drivers/staging/tegra-vde/uapi.h
 create mode 100644 drivers/staging/tegra-vde/vde.c

-- 
2.14.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH V2] scsi: storvsc: Allow only one remove lun work item to be issued per lun

2017-10-19 Thread Long Li
> On Tue, Oct 17, 2017 at 01:35:21PM -0400, Cathy Avery wrote:
> > +   /*
> > +* Set the error handler work queue.
> > +*/
> > +   snprintf(host_dev->work_q_name, sizeof(host_dev-
> >work_q_name),
> > +"storvsc_error_wq_%d", host->host_no);
> > +   host_dev->handle_error_wq =
> > +   create_singlethread_workqueue(host_dev-
> >work_q_name);
> 
> If you use alloc_ordered_workqueue directly instead of
> create_singlethread_workqueue you can pass a format string and don't need
> the separate allocation.
> 
> But I'm not sure if Tejun is fine with using __WQ_LEGACY directly..
> 
> Except for this nit this looks fine to me:
> 
> Reviewed-by: Christoph Hellwig 

The work storvsc_host_scan (scheduled from function storvsc_on_receive) should 
also use this workqueue. We can do it in another patch.

Reviewed-by: Long Li 

> ___
> devel mailing list
> de...@linuxdriverproject.org
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdriverd
> ev.linuxdriverproject.org%2Fmailman%2Flistinfo%2Fdriverdev-
> devel&data=02%7C01%7Clongli%40microsoft.com%7C9c303c3630ef490cecc3
> 08d5170702a2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636440
> 241242573253&sdata=tbCBOnKxtRR38rAdsBDa7zA0Jc2XwrySTsH3uyRxHxA%
> 3D&reserved=0
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[staging:staging-next 256/294] drivers/staging/rtl8723bs/hal/hal_btcoex.c:1415: warning: unused variable 'ret2'

2017-10-19 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git 
staging-next
head:   4bdd439fe2a7ce14f2b86bf138b24e2fa3615507
commit: 95b3b4238581e72756505d601948f955e8baccf7 [256/294] staging: rtl8723bs: 
remove ternary operators in assignmet statments
config: x86_64-randconfig-v0-10200632 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
git checkout 95b3b4238581e72756505d601948f955e8baccf7
# save the attached .config to linux build tree
make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   drivers/staging/rtl8723bs/hal/hal_btcoex.c: In function 
'hal_btcoex_Initialize':
>> drivers/staging/rtl8723bs/hal/hal_btcoex.c:1415: warning: unused variable 
>> 'ret2'
>> drivers/staging/rtl8723bs/hal/hal_btcoex.c:1414: warning: unused variable 
>> 'ret1'

vim +/ret2 +1415 drivers/staging/rtl8723bs/hal/hal_btcoex.c

554c0a3ab Hans de Goede 2017-03-29  1411  
554c0a3ab Hans de Goede 2017-03-29  1412  u8 hal_btcoex_Initialize(struct 
adapter *padapter)
554c0a3ab Hans de Goede 2017-03-29  1413  {
554c0a3ab Hans de Goede 2017-03-29 @1414u8 ret1;
554c0a3ab Hans de Goede 2017-03-29 @1415u8 ret2;
554c0a3ab Hans de Goede 2017-03-29  1416  
554c0a3ab Hans de Goede 2017-03-29  1417  
554c0a3ab Hans de Goede 2017-03-29  1418memset(&GLBtCoexist, 0, 
sizeof(GLBtCoexist));
95b3b4238 Aastha Gupta  2017-10-08  1419return 
EXhalbtcoutsrc_InitlizeVariables((void *)padapter);
554c0a3ab Hans de Goede 2017-03-29  1420  }
554c0a3ab Hans de Goede 2017-03-29  1421  

:: The code at line 1415 was first introduced by commit
:: 554c0a3abf216c991c5ebddcdb2c08689ecd290b staging: Add rtl8723bs sdio 
wifi driver

:: TO: Hans de Goede 
:: CC: Greg Kroah-Hartman 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] Staging: rtl8188eu: core: rtw_mlme_ext: Use list_for_each_entry_safe

2017-10-19 Thread kbuild test robot
Hi Srishti,

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.14-rc5 next-20171018]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Srishti-Sharma/Staging-rtl8188eu-core-rtw_mlme_ext-Use-list_for_each_entry_safe/20171007-080024
config: x86_64-randconfig-v0-10200632 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   drivers/staging//rtl8188eu/core/rtw_mlme_ext.c: In function 'tx_beacon_hdl':
>> drivers/staging//rtl8188eu/core/rtw_mlme_ext.c:5449: warning: unused 
>> variable 'tmp'

vim +/tmp +5449 drivers/staging//rtl8188eu/core/rtw_mlme_ext.c

  5446  
  5447  u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf)
  5448  {
> 5449  struct xmit_frame *tmp;
  5450  if (send_beacon(padapter) == _FAIL) {
  5451  DBG_88E("issue_beacon, fail!\n");
  5452  return H2C_PARAMETERS_ERROR;
  5453  }
  5454  #ifdef CONFIG_88EU_AP_MODE
  5455  else { /* tx bc/mc frames after update TIM */
  5456  struct sta_info *psta_bmc;
  5457  struct list_head *xmitframe_plist, *xmitframe_phead;
  5458  struct xmit_frame *pxmitframe = NULL;
  5459  struct sta_priv  *pstapriv = &padapter->stapriv;
  5460  
  5461  /* for BC/MC Frames */
  5462  psta_bmc = rtw_get_bcmc_stainfo(padapter);
  5463  if (!psta_bmc)
  5464  return H2C_SUCCESS;
  5465  
  5466  if ((pstapriv->tim_bitmap&BIT(0)) && 
(psta_bmc->sleepq_len > 0)) {
  5467  msleep(10);/*  10ms, ATIM(HIQ) Windows */
  5468  spin_lock_bh(&psta_bmc->sleep_q.lock);
  5469  
  5470  xmitframe_phead = 
get_list_head(&psta_bmc->sleep_q);
  5471  xmitframe_plist = xmitframe_phead->next;
  5472  
  5473  list_for_each_entry_safe(pxmitframe, tmp,
  5474   xmitframe_plist, list) 
{
  5475  list_del_init(&pxmitframe->list);
  5476  
  5477  psta_bmc->sleepq_len--;
  5478  if (psta_bmc->sleepq_len > 0)
  5479  pxmitframe->attrib.mdata = 1;
  5480  else
  5481  pxmitframe->attrib.mdata = 0;
  5482  
  5483  pxmitframe->attrib.triggered = 1;
  5484  
  5485  pxmitframe->attrib.qsel = 0x11;/* HIQ */
  5486  
  5487  spin_unlock_bh(&psta_bmc->sleep_q.lock);
  5488  if (rtw_hal_xmit(padapter, pxmitframe))
  5489  rtw_os_xmit_complete(padapter, 
pxmitframe);
  5490  spin_lock_bh(&psta_bmc->sleep_q.lock);
  5491  }
  5492  spin_unlock_bh(&psta_bmc->sleep_q.lock);
  5493  }
  5494  }
  5495  #endif
  5496  return H2C_SUCCESS;
  5497  }
  5498  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Destaging most drivers

2017-10-19 Thread PrasannaKumar Muralidharan
Hi Christian,

It has been a couple of years since most was added to the staging
tree. Except for review the TODO list does not mention things that are
required to destage it. Wondering why most is still in staging tree.

Thanks,
PrasannaKumar
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel