aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaja Mani <rmani@qti.qualcomm.com>2016-03-18 05:44:21 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2016-03-23 07:42:46 -0400
commitf454add47adb4133f297e1b7af07bf07b3983044 (patch)
tree206e2110a6cce8a02cfee71b5261c823a87d1c65
parenta47aaa69de88913d1640c4bd28c67fad142c61a3 (diff)
ath10k: pass cal data location as an argument to ath10k_download_cal_{file|dt}
Both ath10k_download_cal_file() and ath10k_download_cal_dt() uses hard coded file pointer (ar->cal_file) and device tree entry (qcom,ath10k-calibration-data) respectively to get calibration data content. There is a need to use those two functions in qca4019 calibration download sequence with different file pointer and device tree entry name. Modify those two functions to take cal data location as an argument. So that it can serve the purpose for other file pointer and device tree entry. This is just preparation before adding actual qca4019 calibration download sequence. No functional changes. Signed-off-by: Raja Mani <rmani@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r--drivers/net/wireless/ath/ath10k/core.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index d5d0b88aa5fe..7c4a9c99b268 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -462,18 +462,18 @@ exit:
462 return ret; 462 return ret;
463} 463}
464 464
465static int ath10k_download_cal_file(struct ath10k *ar) 465static int ath10k_download_cal_file(struct ath10k *ar,
466 const struct firmware *file)
466{ 467{
467 int ret; 468 int ret;
468 469
469 if (!ar->cal_file) 470 if (!file)
470 return -ENOENT; 471 return -ENOENT;
471 472
472 if (IS_ERR(ar->cal_file)) 473 if (IS_ERR(file))
473 return PTR_ERR(ar->cal_file); 474 return PTR_ERR(file);
474 475
475 ret = ath10k_download_board_data(ar, ar->cal_file->data, 476 ret = ath10k_download_board_data(ar, file->data, file->size);
476 ar->cal_file->size);
477 if (ret) { 477 if (ret) {
478 ath10k_err(ar, "failed to download cal_file data: %d\n", ret); 478 ath10k_err(ar, "failed to download cal_file data: %d\n", ret);
479 return ret; 479 return ret;
@@ -484,7 +484,7 @@ static int ath10k_download_cal_file(struct ath10k *ar)
484 return 0; 484 return 0;
485} 485}
486 486
487static int ath10k_download_cal_dt(struct ath10k *ar) 487static int ath10k_download_cal_dt(struct ath10k *ar, const char *dt_name)
488{ 488{
489 struct device_node *node; 489 struct device_node *node;
490 int data_len; 490 int data_len;
@@ -498,8 +498,7 @@ static int ath10k_download_cal_dt(struct ath10k *ar)
498 */ 498 */
499 return -ENOENT; 499 return -ENOENT;
500 500
501 if (!of_get_property(node, "qcom,ath10k-calibration-data", 501 if (!of_get_property(node, dt_name, &data_len)) {
502 &data_len)) {
503 /* The calibration data node is optional */ 502 /* The calibration data node is optional */
504 return -ENOENT; 503 return -ENOENT;
505 } 504 }
@@ -517,8 +516,7 @@ static int ath10k_download_cal_dt(struct ath10k *ar)
517 goto out; 516 goto out;
518 } 517 }
519 518
520 ret = of_property_read_u8_array(node, "qcom,ath10k-calibration-data", 519 ret = of_property_read_u8_array(node, dt_name, data, data_len);
521 data, data_len);
522 if (ret) { 520 if (ret) {
523 ath10k_warn(ar, "failed to read calibration data from DT: %d\n", 521 ath10k_warn(ar, "failed to read calibration data from DT: %d\n",
524 ret); 522 ret);
@@ -1258,7 +1256,7 @@ static int ath10k_download_cal_data(struct ath10k *ar)
1258{ 1256{
1259 int ret; 1257 int ret;
1260 1258
1261 ret = ath10k_download_cal_file(ar); 1259 ret = ath10k_download_cal_file(ar, ar->cal_file);
1262 if (ret == 0) { 1260 if (ret == 0) {
1263 ar->cal_mode = ATH10K_CAL_MODE_FILE; 1261 ar->cal_mode = ATH10K_CAL_MODE_FILE;
1264 goto done; 1262 goto done;
@@ -1268,7 +1266,7 @@ static int ath10k_download_cal_data(struct ath10k *ar)
1268 "boot did not find a calibration file, try DT next: %d\n", 1266 "boot did not find a calibration file, try DT next: %d\n",
1269 ret); 1267 ret);
1270 1268
1271 ret = ath10k_download_cal_dt(ar); 1269 ret = ath10k_download_cal_dt(ar, "qcom,ath10k-calibration-data");
1272 if (ret == 0) { 1270 if (ret == 0) {
1273 ar->cal_mode = ATH10K_CAL_MODE_DT; 1271 ar->cal_mode = ATH10K_CAL_MODE_DT;
1274 goto done; 1272 goto done;