[PATCH] Staging:sm750fb:ddk750_chip.c:Fixed coding style in comments

2016-06-12 Thread Rithvik Patibandla
The following patch fixes format of some comments.

Signed-off-by: Rithvik Patibandla 
---
 drivers/staging/sm750fb/ddk750_chip.c | 71 +++
 1 file changed, 38 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_chip.c 
b/drivers/staging/sm750fb/ddk750_chip.c
index f80ee77..8cb5cb9 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -70,11 +70,11 @@ static void setChipClock(unsigned int frequency)
pll.inputFreq = DEFAULT_INPUT_CLOCK; /* Defined in CLOCK.H */
pll.clockType = MXCLK_PLL;
 
-   /*
-   * Call calcPllValue() to fill up the other fields for PLL 
structure.
-   * Sometime, the chip cannot set up the exact clock required by 
User.
-   * Return value from calcPllValue() gives the actual possible 
clock.
-   */
+   /*
+* Call calcPllValue() to fill up the other fields for PLL structure.
+* Sometime, the chip cannot set up the exact clock required by User.
+* Return value from calcPllValue() gives the actual possible clock.
+*/
ulActualMxClk = calcPllValue(frequency, &pll);
 
/* Master Clock Control: MXCLK_PLL */
@@ -86,13 +86,15 @@ static void setMemoryClock(unsigned int frequency)
 {
unsigned int reg, divisor;
 
-   /* Cheok_0509: For SM750LE, the memory clock is fixed. Nothing to set. 
*/
+/* Cheok_0509: For SM750LE, the memory clock is fixed. Nothing to set. */
if (getChipType() == SM750LE)
return;
 
if (frequency) {
-   /* Set the frequency to the maximum frequency that the DDR 
Memory can take
-   which is 336MHz. */
+   /*
+* Set the frequency to the maximum frequency that the DDR Memory can
+* take which is 336MHz.
+*/
if (frequency > MHz(336))
frequency = MHz(336);
 
@@ -133,13 +135,15 @@ static void setMasterClock(unsigned int frequency)
 {
unsigned int reg, divisor;
 
-   /* Cheok_0509: For SM750LE, the memory clock is fixed. Nothing to set. 
*/
+/* Cheok_0509: For SM750LE, the memory clock is fixed. Nothing to set. */
if (getChipType() == SM750LE)
return;
 
if (frequency) {
-   /* Set the frequency to the maximum frequency that the SM750 
engine can
-   run, which is about 190 MHz. */
+   /*
+* Set the frequency to the maximum frequency that the SM750 engine can
+* run, which is about 190 MHz.
+*/
if (frequency > MHz(190))
frequency = MHz(190);
 
@@ -236,9 +240,10 @@ int ddk750_initHw(initchip_param_t *pInitParam)
setMasterClock(MHz(pInitParam->masterClock));
 
 
-   /* Reset the memory controller. If the memory controller is not reset 
in SM750,
-  the system might hang when sw accesses the memory.
-  The memory should be resetted after changing the MXCLK.
+   /*
+* Reset the memory controller. If the memory controller is not reset
+* in SM750, the system might hang when sw accesses the memory.The
+* memory should be resetted after changing the MXCLK.
 */
if (pInitParam->resetMemory == 1) {
reg = PEEK32(MISC_CTRL);
@@ -282,24 +287,23 @@ int ddk750_initHw(initchip_param_t *pInitParam)
 }
 
 /*
-   monk liu @ 4/6/2011:
-  re-write the calculatePLL function of ddk750.
-  the original version function does not use some mathematics 
tricks and shortcut
-  when it doing the calculation of the best N,M,D combination
-  I think this version gives a little upgrade in speed
-
-   750 pll clock formular:
-   Request Clock = (Input Clock * M )/(N * X)
-
-   Input Clock = 14318181 hz
-   X = 2 power D
-   D ={0,1,2,3,4,5,6}
-   M = {1,...,255}
-   N = {2,...,15}
-*/
+ * monk liu @ 4/6/2011:
+ * re-write the calculatePLL function of ddk750. the original version
+ * function does not use some mathematics tricks and shortcut when it
+ * doing the calculation of the best N,M,D combination. I think this
+ * version gives a little upgrade in speed
+ *
+ * 750 pll clock formular:
+*  Request Clock = (Input Clock * M )/(N * X)
+ * Input Clock = 14318181 hz
+ * X = 2 power D
+ * D ={0,1,2,3,4,5,6}
+ * M = {1,...,255}
+ * N = {2,...,15}
+ */
 unsigned int calcPllValue(unsigned int request_orig, pll_value_t *pll)
 {
-   /* as sm750 register definition, N located in 2,15 and M located in 
1,255   */
+/* as sm750 register definition, N located in 2,15 and M located in  1,255 */
int N, M, X, d;
int mini_diff;
unsigned int RN, quo, rem, fl_quo;
@@ -310,7 +314,8 @@ unsigned int calcPllValue(u

Re: [PATCH v2] Add tw5864 driver

2016-06-12 Thread Andrey Utkin
Update: added local change
 - to require fewer DMA buffers;
 - to require fewer vb2_queue buffers;
 - don't require vb2_queue buffers to be DMA-capable.
https://github.com/bluecherrydvr/linux/commit/410a86b08d230ff2a401ac9f5be3b30f8b29f30d
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/6] staging: wilc1000: change data type of result in handle_cfg_param

2016-06-12 Thread Chaehyun Lim
This patch changes data type of result variable from s32 to int. result
is used to get return value from wilc_send_config_pkt that has return
type of int.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index aeb355e..0220045 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -420,7 +420,7 @@ static void handle_get_mac_address(struct wilc_vif *vif,
 static void handle_cfg_param(struct wilc_vif *vif,
 struct cfg_param_attr *cfg_param_attr)
 {
-   s32 result = 0;
+   int result = 0;
struct wid wid_list[32];
struct host_if_drv *hif_drv = vif->hif_drv;
int i = 0;
-- 
2.8.4

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


[PATCH 4/6] staging: wilc1000: remove unused struct set_mac_addr

2016-06-12 Thread Chaehyun Lim
struct set_mac_addr is not used anymore, so just remove it.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 1 -
 drivers/staging/wilc1000/host_interface.h | 4 
 2 files changed, 5 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index ea5cb2d..96821f6 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -181,7 +181,6 @@ union message_body {
struct drv_handler drv;
struct set_multicast multicast_info;
struct op_mode mode;
-   struct set_mac_addr set_mac_info;
struct get_mac_addr get_mac_info;
struct ba_session_info session_info;
struct remain_ch remain_on_ch;
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 8d2dd0d..ddfea29 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -224,10 +224,6 @@ struct op_mode {
u32 mode;
 };
 
-struct set_mac_addr {
-   u8 mac_addr[ETH_ALEN];
-};
-
 struct get_mac_addr {
u8 *mac_addr;
 };
-- 
2.8.4

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


[PATCH 5/6] staging: wilc1000: add bss_type to remove line over 80 characters

2016-06-12 Thread Chaehyun Lim
A local bss_type variable is added to remove checkpatch warning of
line over 80 characters.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 96821f6..828efff 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -427,12 +427,14 @@ static void handle_cfg_param(struct wilc_vif *vif,
mutex_lock(&hif_drv->cfg_values_lock);
 
if (cfg_param_attr->flag & BSS_TYPE) {
-   if (cfg_param_attr->bss_type < 6) {
+   u8 bss_type = cfg_param_attr->bss_type;
+
+   if (bss_type < 6) {
wid_list[i].id = WID_BSS_TYPE;
-   wid_list[i].val = (s8 *)&cfg_param_attr->bss_type;
+   wid_list[i].val = (s8 *)&bss_type;
wid_list[i].type = WID_CHAR;
wid_list[i].size = sizeof(char);
-   hif_drv->cfg_values.bss_type = 
(u8)cfg_param_attr->bss_type;
+   hif_drv->cfg_values.bss_type = (u8)bss_type;
} else {
netdev_err(vif->ndev, "check value 6 over\n");
goto unlock;
-- 
2.8.4

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


[PATCH 6/6] staging: wilc1000: remove unnecesary type cast of bss_type

2016-06-12 Thread Chaehyun Lim
There is no need to use type cast of bss_type because
hif_drv->cfg_values.bss_type is u8.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 828efff..5b2278b 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -434,7 +434,7 @@ static void handle_cfg_param(struct wilc_vif *vif,
wid_list[i].val = (s8 *)&bss_type;
wid_list[i].type = WID_CHAR;
wid_list[i].size = sizeof(char);
-   hif_drv->cfg_values.bss_type = (u8)bss_type;
+   hif_drv->cfg_values.bss_type = bss_type;
} else {
netdev_err(vif->ndev, "check value 6 over\n");
goto unlock;
-- 
2.8.4

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


[PATCH 3/6] staging: wilc1000: rename result in handle_cfg_param

2016-06-12 Thread Chaehyun Lim
This patch renames result to ret that is used to get return value from
wilc_send_config_pkt. Some handle_*() functions are used as result,
others are used as ret. It will be changed as ret in all handle_*()
functions to match variable name.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 0220045..ea5cb2d 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -420,7 +420,7 @@ static void handle_get_mac_address(struct wilc_vif *vif,
 static void handle_cfg_param(struct wilc_vif *vif,
 struct cfg_param_attr *cfg_param_attr)
 {
-   int result = 0;
+   int ret = 0;
struct wid wid_list[32];
struct host_if_drv *hif_drv = vif->hif_drv;
int i = 0;
@@ -682,10 +682,10 @@ static void handle_cfg_param(struct wilc_vif *vif,
i++;
}
 
-   result = wilc_send_config_pkt(vif, SET_CFG, wid_list,
- i, wilc_get_vif_idx(vif));
+   ret = wilc_send_config_pkt(vif, SET_CFG, wid_list,
+  i, wilc_get_vif_idx(vif));
 
-   if (result)
+   if (ret)
netdev_err(vif->ndev, "Error in setting CFG params\n");
 
 unlock:
-- 
2.8.4

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


[PATCH 1/6] staging: wilc1000: change handle_cfg_param's return type to void

2016-06-12 Thread Chaehyun Lim
When handle_cfg_param is called in hostIFthread that is a kernel thread,
it is not checked return type of this function. This patch changes
return type to void.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 23 ++-
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 9535842..aeb355e 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -417,8 +417,8 @@ static void handle_get_mac_address(struct wilc_vif *vif,
complete(&hif_wait_response);
 }
 
-static s32 handle_cfg_param(struct wilc_vif *vif,
-   struct cfg_param_attr *cfg_param_attr)
+static void handle_cfg_param(struct wilc_vif *vif,
+struct cfg_param_attr *cfg_param_attr)
 {
s32 result = 0;
struct wid wid_list[32];
@@ -436,7 +436,6 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
hif_drv->cfg_values.bss_type = 
(u8)cfg_param_attr->bss_type;
} else {
netdev_err(vif->ndev, "check value 6 over\n");
-   result = -EINVAL;
goto unlock;
}
i++;
@@ -452,7 +451,6 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
hif_drv->cfg_values.auth_type = 
(u8)cfg_param_attr->auth_type;
} else {
netdev_err(vif->ndev, "Impossible value\n");
-   result = -EINVAL;
goto unlock;
}
i++;
@@ -467,7 +465,6 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
hif_drv->cfg_values.auth_timeout = 
cfg_param_attr->auth_timeout;
} else {
netdev_err(vif->ndev, "Range(1 ~ 65535) over\n");
-   result = -EINVAL;
goto unlock;
}
i++;
@@ -481,7 +478,6 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
hif_drv->cfg_values.power_mgmt_mode = 
(u8)cfg_param_attr->power_mgmt_mode;
} else {
netdev_err(vif->ndev, "Invalid power mode\n");
-   result = -EINVAL;
goto unlock;
}
i++;
@@ -496,7 +492,6 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
hif_drv->cfg_values.short_retry_limit = 
cfg_param_attr->short_retry_limit;
} else {
netdev_err(vif->ndev, "Range(1~256) over\n");
-   result = -EINVAL;
goto unlock;
}
i++;
@@ -511,7 +506,6 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
hif_drv->cfg_values.long_retry_limit = 
cfg_param_attr->long_retry_limit;
} else {
netdev_err(vif->ndev, "Range(1~256) over\n");
-   result = -EINVAL;
goto unlock;
}
i++;
@@ -526,7 +520,6 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
hif_drv->cfg_values.frag_threshold = 
cfg_param_attr->frag_threshold;
} else {
netdev_err(vif->ndev, "Threshold Range fail\n");
-   result = -EINVAL;
goto unlock;
}
i++;
@@ -541,7 +534,6 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
hif_drv->cfg_values.rts_threshold = 
cfg_param_attr->rts_threshold;
} else {
netdev_err(vif->ndev, "Threshold Range fail\n");
-   result = -EINVAL;
goto unlock;
}
i++;
@@ -555,7 +547,6 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
hif_drv->cfg_values.preamble_type = 
cfg_param_attr->preamble_type;
} else {
netdev_err(vif->ndev, "Preamle Range(0~2) over\n");
-   result = -EINVAL;
goto unlock;
}
i++;
@@ -569,7 +560,6 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
hif_drv->cfg_values.short_slot_allowed = 
(u8)cfg_param_attr->short_slot_allowed;
} else {
netdev_err(vif->ndev, "Short slot(2) over\n");
-   result = -EINVAL;
goto unlock;
}
i++;
@@ -583,7 +573,6 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
hif_drv->cfg_values.txop_prot_disabled = 
(u8)cfg_param_attr->txop_prot_disabled;
} else {
netdev_err(vif->nd