Loading arch/arm/mach-msm/bbif-fsm9900.c +25 −49 Original line number Diff line number Diff line /* Copyright (c) 2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -63,14 +63,17 @@ #define SIGMA_DELTA_VAL_2 0x0B090D0F #define SIGMA_DELTA_VAL_3 0x05070301 #define BBIF_CONFIG_WCDMA_5_DPD 0x80802000 #define BBIF_CONFIG_LTE_5_DPD 0x80802000 #define BBIF_CONFIG_LTE_10 0x80803F00 #define BBIF_CONFIG_LTE_15 0x80803B00 #define BBIF_CONFIG_LTE_20 0x80803100 #define BBIF_CONFIG_LTE_10_DPD 0x98800E00 #define BBIF_CONFIG_WCDMA_5_DPD 0x80802100 #define BBIF_CONFIG_LTE_5_DPD 0x80802100 #define BBIF_CONFIG_LTE_10 0x80803900 #define BBIF_CONFIG_LTE_15 0x80803500 #define BBIF_CONFIG_LTE_20 0x80803200 #define BBIF_CONFIG_LTE_10_DPD 0x98800F00 #define BBIF_CONFIG_LTE_15_DPD 0x98800800 #define BBIF_CONFIG_LTE_20_DPD 0x98800500 #define BBIF_CONFIG_LTE_20_DPD 0x98800600 #define BBIF_CONFIG_LTE_20_DPD_AAF_BYPASS 0x98800602 #define BBIF_CONFIG_LTE_10_AAF_ENABLED 0x80807900 #define BBIF_BBRX_TEST1 0x00000000 #define BBIF_BBRX_TEST2 0x00000000 Loading Loading @@ -243,54 +246,25 @@ static long bbif_ioctl(struct file *file, case BBIF_IOCTL_SET_ADC_BW: { unsigned int bbif_adc_base; struct bbif_bw_param param; struct bbif_bw_config param; bbif_adc_base = (unsigned int)bbif_base + BBIF_MISC; if (copy_from_user(¶m, argp, sizeof(param))) return -EFAULT; if (param.number > BBIF_MAX_ADC) if (param.adc_number > BBIF_MAX_ADC) return -EFAULT; bbif_adc_base = (unsigned int)bbif_base + BBIF_MISC + BBIF_BBRX_CONFIG_BASE + param.number*4; switch (param.bw_id) { case 1: __raw_writel(BBIF_CONFIG_WCDMA_5_DPD, bbif_adc_base); break; case 2: __raw_writel(BBIF_CONFIG_LTE_5_DPD, bbif_adc_base); break; case 3: __raw_writel(BBIF_CONFIG_LTE_10, bbif_adc_base); break; case 4: __raw_writel(BBIF_CONFIG_LTE_15, bbif_adc_base); break; case 5: __raw_writel(BBIF_CONFIG_LTE_20, bbif_adc_base); break; case 6: __raw_writel(BBIF_CONFIG_LTE_10_DPD, bbif_adc_base); break; case 7: __raw_writel(BBIF_CONFIG_LTE_15_DPD, bbif_adc_base); break; case 8: __raw_writel(BBIF_CONFIG_LTE_20_DPD, bbif_adc_base); break; default: pr_info("%s: BW did not change\n", __func__); } __raw_writel(param.bbrx_test1, bbif_adc_base + BBIF_BBRX_TEST1_BASE + param.adc_number*4); __raw_writel(param.bbrx_test1, bbif_adc_base + BBIF_BBRX_TEST2_BASE + param.adc_number*4); __raw_writel(param.bbrx_test1, bbif_adc_base + BBIF_BBRX_TEST3_BASE + param.adc_number*4); __raw_writel(param.bbrx_config, bbif_adc_base + BBIF_BBRX_CONFIG_BASE + param.adc_number*4); } break; default: return -EINVAL; } Loading Loading @@ -383,6 +357,8 @@ static int bbif_probe(struct platform_device *pdev) BBIF_MAP_SIGMA_DELTA_3); __raw_writel(0, bbif_misc_base + BBIF_PRI_MODE); /* If the values are different make sure i=1 & i=2 are reversed */ for (i = 0; i < 6; i++) { __raw_writel(0, bbif_misc_base + BBIF_ADC_CFG + i*4); __raw_writel(BBIF_BBRX_TEST1, bbif_misc_base + Loading include/linux/fsm_rfic.h +26 −4 Original line number Diff line number Diff line /* Copyright (c) 2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading @@ -14,9 +14,11 @@ #define _FSM_RFIC_H_ #include <linux/ioctl.h> #include <mach/gpiomux.h> void fsm9900_gluon_init(void); void fsm9900_rfic_init(void); void fsm9900_mtr_init(void); /* Loading @@ -24,6 +26,7 @@ void fsm9900_rfic_init(void); */ #define RFIC_FTR_DEVICE_NAME "rfic_ftr" #define RFIC_MTR_DEVICE_NAME "rfic_mtr" #define RFIC_WTR_DEVICE_NAME "rfic_wtr" #define RFIC_WGR_DEVICE_NAME "rfic_wgr" #define GRFC_DEVICE_NAME "grfc" Loading Loading @@ -71,9 +74,25 @@ struct bbif_param { unsigned int value; }; struct bbif_bw_param { unsigned int bw_id; unsigned int number; struct bbif_bw_config { unsigned int adc_number; unsigned int bbrx_test1; unsigned int bbrx_test2; unsigned int bbrx_test3; unsigned int bbrx_config; }; struct gpio_alt_config { unsigned char gpio; unsigned char func; unsigned char drv; unsigned char pull; unsigned char dir; }; struct rfic_gpio_param { unsigned int num; struct gpio_alt_config *pArray; }; #define RFIC_IOCTL_MAGIC 'f' Loading @@ -92,6 +111,9 @@ struct bbif_bw_param { #define RFIC_IOCTL_SET_GRFC \ _IOC(_IOC_WRITE, RFIC_IOCTL_MAGIC, 0x11, \ sizeof(struct rfic_grfc_param *)) #define RFIC_IOCTL_GPIO_SETTING \ _IOC(_IOC_WRITE, RFIC_IOCTL_MAGIC, 0x12, \ sizeof(struct gpiomux_config_t *)) #define RFIC_IOCTL_GET_BOARDID \ _IOC(_IOC_READ, RFIC_IOCTL_MAGIC, 0x20, \ sizeof(unsigned int *)) Loading Loading
arch/arm/mach-msm/bbif-fsm9900.c +25 −49 Original line number Diff line number Diff line /* Copyright (c) 2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -63,14 +63,17 @@ #define SIGMA_DELTA_VAL_2 0x0B090D0F #define SIGMA_DELTA_VAL_3 0x05070301 #define BBIF_CONFIG_WCDMA_5_DPD 0x80802000 #define BBIF_CONFIG_LTE_5_DPD 0x80802000 #define BBIF_CONFIG_LTE_10 0x80803F00 #define BBIF_CONFIG_LTE_15 0x80803B00 #define BBIF_CONFIG_LTE_20 0x80803100 #define BBIF_CONFIG_LTE_10_DPD 0x98800E00 #define BBIF_CONFIG_WCDMA_5_DPD 0x80802100 #define BBIF_CONFIG_LTE_5_DPD 0x80802100 #define BBIF_CONFIG_LTE_10 0x80803900 #define BBIF_CONFIG_LTE_15 0x80803500 #define BBIF_CONFIG_LTE_20 0x80803200 #define BBIF_CONFIG_LTE_10_DPD 0x98800F00 #define BBIF_CONFIG_LTE_15_DPD 0x98800800 #define BBIF_CONFIG_LTE_20_DPD 0x98800500 #define BBIF_CONFIG_LTE_20_DPD 0x98800600 #define BBIF_CONFIG_LTE_20_DPD_AAF_BYPASS 0x98800602 #define BBIF_CONFIG_LTE_10_AAF_ENABLED 0x80807900 #define BBIF_BBRX_TEST1 0x00000000 #define BBIF_BBRX_TEST2 0x00000000 Loading Loading @@ -243,54 +246,25 @@ static long bbif_ioctl(struct file *file, case BBIF_IOCTL_SET_ADC_BW: { unsigned int bbif_adc_base; struct bbif_bw_param param; struct bbif_bw_config param; bbif_adc_base = (unsigned int)bbif_base + BBIF_MISC; if (copy_from_user(¶m, argp, sizeof(param))) return -EFAULT; if (param.number > BBIF_MAX_ADC) if (param.adc_number > BBIF_MAX_ADC) return -EFAULT; bbif_adc_base = (unsigned int)bbif_base + BBIF_MISC + BBIF_BBRX_CONFIG_BASE + param.number*4; switch (param.bw_id) { case 1: __raw_writel(BBIF_CONFIG_WCDMA_5_DPD, bbif_adc_base); break; case 2: __raw_writel(BBIF_CONFIG_LTE_5_DPD, bbif_adc_base); break; case 3: __raw_writel(BBIF_CONFIG_LTE_10, bbif_adc_base); break; case 4: __raw_writel(BBIF_CONFIG_LTE_15, bbif_adc_base); break; case 5: __raw_writel(BBIF_CONFIG_LTE_20, bbif_adc_base); break; case 6: __raw_writel(BBIF_CONFIG_LTE_10_DPD, bbif_adc_base); break; case 7: __raw_writel(BBIF_CONFIG_LTE_15_DPD, bbif_adc_base); break; case 8: __raw_writel(BBIF_CONFIG_LTE_20_DPD, bbif_adc_base); break; default: pr_info("%s: BW did not change\n", __func__); } __raw_writel(param.bbrx_test1, bbif_adc_base + BBIF_BBRX_TEST1_BASE + param.adc_number*4); __raw_writel(param.bbrx_test1, bbif_adc_base + BBIF_BBRX_TEST2_BASE + param.adc_number*4); __raw_writel(param.bbrx_test1, bbif_adc_base + BBIF_BBRX_TEST3_BASE + param.adc_number*4); __raw_writel(param.bbrx_config, bbif_adc_base + BBIF_BBRX_CONFIG_BASE + param.adc_number*4); } break; default: return -EINVAL; } Loading Loading @@ -383,6 +357,8 @@ static int bbif_probe(struct platform_device *pdev) BBIF_MAP_SIGMA_DELTA_3); __raw_writel(0, bbif_misc_base + BBIF_PRI_MODE); /* If the values are different make sure i=1 & i=2 are reversed */ for (i = 0; i < 6; i++) { __raw_writel(0, bbif_misc_base + BBIF_ADC_CFG + i*4); __raw_writel(BBIF_BBRX_TEST1, bbif_misc_base + Loading
include/linux/fsm_rfic.h +26 −4 Original line number Diff line number Diff line /* Copyright (c) 2013, The Linux Foundation. All rights reserved. /* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading @@ -14,9 +14,11 @@ #define _FSM_RFIC_H_ #include <linux/ioctl.h> #include <mach/gpiomux.h> void fsm9900_gluon_init(void); void fsm9900_rfic_init(void); void fsm9900_mtr_init(void); /* Loading @@ -24,6 +26,7 @@ void fsm9900_rfic_init(void); */ #define RFIC_FTR_DEVICE_NAME "rfic_ftr" #define RFIC_MTR_DEVICE_NAME "rfic_mtr" #define RFIC_WTR_DEVICE_NAME "rfic_wtr" #define RFIC_WGR_DEVICE_NAME "rfic_wgr" #define GRFC_DEVICE_NAME "grfc" Loading Loading @@ -71,9 +74,25 @@ struct bbif_param { unsigned int value; }; struct bbif_bw_param { unsigned int bw_id; unsigned int number; struct bbif_bw_config { unsigned int adc_number; unsigned int bbrx_test1; unsigned int bbrx_test2; unsigned int bbrx_test3; unsigned int bbrx_config; }; struct gpio_alt_config { unsigned char gpio; unsigned char func; unsigned char drv; unsigned char pull; unsigned char dir; }; struct rfic_gpio_param { unsigned int num; struct gpio_alt_config *pArray; }; #define RFIC_IOCTL_MAGIC 'f' Loading @@ -92,6 +111,9 @@ struct bbif_bw_param { #define RFIC_IOCTL_SET_GRFC \ _IOC(_IOC_WRITE, RFIC_IOCTL_MAGIC, 0x11, \ sizeof(struct rfic_grfc_param *)) #define RFIC_IOCTL_GPIO_SETTING \ _IOC(_IOC_WRITE, RFIC_IOCTL_MAGIC, 0x12, \ sizeof(struct gpiomux_config_t *)) #define RFIC_IOCTL_GET_BOARDID \ _IOC(_IOC_READ, RFIC_IOCTL_MAGIC, 0x20, \ sizeof(unsigned int *)) Loading