Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'staging-3.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging/IIO driver fixes from Greg KH:
"Here are some staging and IIO driver fixes for 3.18-rc7 that resolve a
number of reported issues, and a new device id for a staging wireless
driver.

All of these have been in linux-next"

* tag 'staging-3.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
staging: r8188eu: Add new device ID for DLink GO-USB-N150
staging: r8188eu: Fix scheduling while atomic error introduced in commit fadbe0cd
iio: accel: bmc150: set low default thresholds
iio: accel: bmc150: Fix iio_event_spec direction
iio: accel: bmc150: Send x, y and z motion separately
iio: accel: bmc150: Error handling when mode set fails
iio: gyro: bmg160: Fix iio_event_spec direction
iio: gyro: bmg160: Send x, y and z motion separately
iio: gyro: bmg160: Don't let interrupt mode to be open drain
iio: gyro: bmg160: Error handling when mode set fails
iio: adc: men_z188_adc: Add terminating entry for men_z188_ids
iio: accel: kxcjk-1013: Fix kxcjk10013_set_range
iio: Fix IIO_EVENT_CODE_EXTRACT_DIR bit mask

+105 -30
+33 -7
drivers/iio/accel/bmc150-accel.c
··· 44 44 45 45 #define BMC150_ACCEL_REG_INT_STATUS_2 0x0B 46 46 #define BMC150_ACCEL_ANY_MOTION_MASK 0x07 47 + #define BMC150_ACCEL_ANY_MOTION_BIT_X BIT(0) 48 + #define BMC150_ACCEL_ANY_MOTION_BIT_Y BIT(1) 49 + #define BMC150_ACCEL_ANY_MOTION_BIT_Z BIT(2) 47 50 #define BMC150_ACCEL_ANY_MOTION_BIT_SIGN BIT(3) 48 51 49 52 #define BMC150_ACCEL_REG_PMU_LPW 0x11 ··· 95 92 #define BMC150_ACCEL_SLOPE_THRES_MASK 0xFF 96 93 97 94 /* Slope duration in terms of number of samples */ 98 - #define BMC150_ACCEL_DEF_SLOPE_DURATION 2 95 + #define BMC150_ACCEL_DEF_SLOPE_DURATION 1 99 96 /* in terms of multiples of g's/LSB, based on range */ 100 - #define BMC150_ACCEL_DEF_SLOPE_THRESHOLD 5 97 + #define BMC150_ACCEL_DEF_SLOPE_THRESHOLD 1 101 98 102 99 #define BMC150_ACCEL_REG_XOUT_L 0x02 103 100 ··· 539 536 if (ret < 0) { 540 537 dev_err(&data->client->dev, 541 538 "Failed: bmc150_accel_set_power_state for %d\n", on); 539 + if (on) 540 + pm_runtime_put_noidle(&data->client->dev); 541 + 542 542 return ret; 543 543 } 544 544 ··· 817 811 818 812 ret = bmc150_accel_setup_any_motion_interrupt(data, state); 819 813 if (ret < 0) { 814 + bmc150_accel_set_power_state(data, false); 820 815 mutex_unlock(&data->mutex); 821 816 return ret; 822 817 } ··· 853 846 854 847 static const struct iio_event_spec bmc150_accel_event = { 855 848 .type = IIO_EV_TYPE_ROC, 856 - .dir = IIO_EV_DIR_RISING | IIO_EV_DIR_FALLING, 849 + .dir = IIO_EV_DIR_EITHER, 857 850 .mask_separate = BIT(IIO_EV_INFO_VALUE) | 858 851 BIT(IIO_EV_INFO_ENABLE) | 859 852 BIT(IIO_EV_INFO_PERIOD) ··· 1061 1054 else 1062 1055 ret = bmc150_accel_setup_new_data_interrupt(data, state); 1063 1056 if (ret < 0) { 1057 + bmc150_accel_set_power_state(data, false); 1064 1058 mutex_unlock(&data->mutex); 1065 1059 return ret; 1066 1060 } ··· 1100 1092 else 1101 1093 dir = IIO_EV_DIR_RISING; 1102 1094 1103 - if (ret & BMC150_ACCEL_ANY_MOTION_MASK) 1095 + if (ret & BMC150_ACCEL_ANY_MOTION_BIT_X) 1104 1096 iio_push_event(indio_dev, IIO_MOD_EVENT_CODE(IIO_ACCEL, 1105 1097 0, 1106 - IIO_MOD_X_OR_Y_OR_Z, 1098 + IIO_MOD_X, 1107 1099 IIO_EV_TYPE_ROC, 1108 - IIO_EV_DIR_EITHER), 1100 + dir), 1101 + data->timestamp); 1102 + if (ret & BMC150_ACCEL_ANY_MOTION_BIT_Y) 1103 + iio_push_event(indio_dev, IIO_MOD_EVENT_CODE(IIO_ACCEL, 1104 + 0, 1105 + IIO_MOD_Y, 1106 + IIO_EV_TYPE_ROC, 1107 + dir), 1108 + data->timestamp); 1109 + if (ret & BMC150_ACCEL_ANY_MOTION_BIT_Z) 1110 + iio_push_event(indio_dev, IIO_MOD_EVENT_CODE(IIO_ACCEL, 1111 + 0, 1112 + IIO_MOD_Z, 1113 + IIO_EV_TYPE_ROC, 1114 + dir), 1109 1115 data->timestamp); 1110 1116 ack_intr_status: 1111 1117 if (!data->dready_trigger_on) ··· 1376 1354 { 1377 1355 struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); 1378 1356 struct bmc150_accel_data *data = iio_priv(indio_dev); 1357 + int ret; 1379 1358 1380 1359 dev_dbg(&data->client->dev, __func__); 1360 + ret = bmc150_accel_set_mode(data, BMC150_ACCEL_SLEEP_MODE_SUSPEND, 0); 1361 + if (ret < 0) 1362 + return -EAGAIN; 1381 1363 1382 - return bmc150_accel_set_mode(data, BMC150_ACCEL_SLEEP_MODE_SUSPEND, 0); 1364 + return 0; 1383 1365 } 1384 1366 1385 1367 static int bmc150_accel_runtime_resume(struct device *dev)
+2
drivers/iio/accel/kxcjk-1013.c
··· 269 269 return ret; 270 270 } 271 271 272 + ret &= ~(KXCJK1013_REG_CTRL1_BIT_GSEL0 | 273 + KXCJK1013_REG_CTRL1_BIT_GSEL1); 272 274 ret |= (KXCJK1013_scale_table[range_index].gsel_0 << 3); 273 275 ret |= (KXCJK1013_scale_table[range_index].gsel_1 << 4); 274 276
+1
drivers/iio/adc/men_z188_adc.c
··· 152 152 153 153 static const struct mcb_device_id men_z188_ids[] = { 154 154 { .device = 0xbc }, 155 + { } 155 156 }; 156 157 MODULE_DEVICE_TABLE(mcb, men_z188_ids); 157 158
+49 -4
drivers/iio/gyro/bmg160.c
··· 67 67 #define BMG160_REG_INT_EN_0 0x15 68 68 #define BMG160_DATA_ENABLE_INT BIT(7) 69 69 70 + #define BMG160_REG_INT_EN_1 0x16 71 + #define BMG160_INT1_BIT_OD BIT(1) 72 + 70 73 #define BMG160_REG_XOUT_L 0x02 71 74 #define BMG160_AXIS_TO_REG(axis) (BMG160_REG_XOUT_L + (axis * 2)) 72 75 ··· 85 82 86 83 #define BMG160_REG_INT_STATUS_2 0x0B 87 84 #define BMG160_ANY_MOTION_MASK 0x07 85 + #define BMG160_ANY_MOTION_BIT_X BIT(0) 86 + #define BMG160_ANY_MOTION_BIT_Y BIT(1) 87 + #define BMG160_ANY_MOTION_BIT_Z BIT(2) 88 88 89 89 #define BMG160_REG_TEMP 0x08 90 90 #define BMG160_TEMP_CENTER_VAL 23 ··· 228 222 data->slope_thres = ret; 229 223 230 224 /* Set default interrupt mode */ 225 + ret = i2c_smbus_read_byte_data(data->client, BMG160_REG_INT_EN_1); 226 + if (ret < 0) { 227 + dev_err(&data->client->dev, "Error reading reg_int_en_1\n"); 228 + return ret; 229 + } 230 + ret &= ~BMG160_INT1_BIT_OD; 231 + ret = i2c_smbus_write_byte_data(data->client, 232 + BMG160_REG_INT_EN_1, ret); 233 + if (ret < 0) { 234 + dev_err(&data->client->dev, "Error writing reg_int_en_1\n"); 235 + return ret; 236 + } 237 + 231 238 ret = i2c_smbus_write_byte_data(data->client, 232 239 BMG160_REG_INT_RST_LATCH, 233 240 BMG160_INT_MODE_LATCH_INT | ··· 269 250 if (ret < 0) { 270 251 dev_err(&data->client->dev, 271 252 "Failed: bmg160_set_power_state for %d\n", on); 253 + if (on) 254 + pm_runtime_put_noidle(&data->client->dev); 255 + 272 256 return ret; 273 257 } 274 258 #endif ··· 727 705 728 706 ret = bmg160_setup_any_motion_interrupt(data, state); 729 707 if (ret < 0) { 708 + bmg160_set_power_state(data, false); 730 709 mutex_unlock(&data->mutex); 731 710 return ret; 732 711 } ··· 766 743 767 744 static const struct iio_event_spec bmg160_event = { 768 745 .type = IIO_EV_TYPE_ROC, 769 - .dir = IIO_EV_DIR_RISING | IIO_EV_DIR_FALLING, 746 + .dir = IIO_EV_DIR_EITHER, 770 747 .mask_shared_by_type = BIT(IIO_EV_INFO_VALUE) | 771 748 BIT(IIO_EV_INFO_ENABLE) 772 749 }; ··· 894 871 else 895 872 ret = bmg160_setup_new_data_interrupt(data, state); 896 873 if (ret < 0) { 874 + bmg160_set_power_state(data, false); 897 875 mutex_unlock(&data->mutex); 898 876 return ret; 899 877 } ··· 932 908 else 933 909 dir = IIO_EV_DIR_FALLING; 934 910 935 - if (ret & BMG160_ANY_MOTION_MASK) 911 + if (ret & BMG160_ANY_MOTION_BIT_X) 936 912 iio_push_event(indio_dev, IIO_MOD_EVENT_CODE(IIO_ANGL_VEL, 937 913 0, 938 - IIO_MOD_X_OR_Y_OR_Z, 914 + IIO_MOD_X, 915 + IIO_EV_TYPE_ROC, 916 + dir), 917 + data->timestamp); 918 + if (ret & BMG160_ANY_MOTION_BIT_Y) 919 + iio_push_event(indio_dev, IIO_MOD_EVENT_CODE(IIO_ANGL_VEL, 920 + 0, 921 + IIO_MOD_Y, 922 + IIO_EV_TYPE_ROC, 923 + dir), 924 + data->timestamp); 925 + if (ret & BMG160_ANY_MOTION_BIT_Z) 926 + iio_push_event(indio_dev, IIO_MOD_EVENT_CODE(IIO_ANGL_VEL, 927 + 0, 928 + IIO_MOD_Z, 939 929 IIO_EV_TYPE_ROC, 940 930 dir), 941 931 data->timestamp); ··· 1207 1169 { 1208 1170 struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); 1209 1171 struct bmg160_data *data = iio_priv(indio_dev); 1172 + int ret; 1210 1173 1211 - return bmg160_set_mode(data, BMG160_MODE_SUSPEND); 1174 + ret = bmg160_set_mode(data, BMG160_MODE_SUSPEND); 1175 + if (ret < 0) { 1176 + dev_err(&data->client->dev, "set mode failed\n"); 1177 + return -EAGAIN; 1178 + } 1179 + 1180 + return 0; 1212 1181 } 1213 1182 1214 1183 static int bmg160_runtime_resume(struct device *dev)
+11 -11
drivers/staging/rtl8188eu/core/rtw_cmd.c
··· 275 275 if (check_fwstate(pmlmepriv, _FW_LINKED) == true) 276 276 rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SCAN, 1); 277 277 278 - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); 278 + ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); 279 279 if (ph2c == NULL) 280 280 return _FAIL; 281 281 282 - psurveyPara = kzalloc(sizeof(struct sitesurvey_parm), GFP_KERNEL); 282 + psurveyPara = kzalloc(sizeof(struct sitesurvey_parm), GFP_ATOMIC); 283 283 if (psurveyPara == NULL) { 284 284 kfree(ph2c); 285 285 return _FAIL; ··· 405 405 else 406 406 RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+Join cmd: SSid =[%s]\n", pmlmepriv->assoc_ssid.Ssid)); 407 407 408 - pcmd = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); 408 + pcmd = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); 409 409 if (pcmd == NULL) { 410 410 res = _FAIL; 411 411 RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("rtw_joinbss_cmd: memory allocate for cmd_obj fail!!!\n")); ··· 755 755 u8 res = _SUCCESS; 756 756 757 757 758 - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); 758 + ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); 759 759 if (ph2c == NULL) { 760 760 res = _FAIL; 761 761 goto exit; 762 762 } 763 763 764 - pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_KERNEL); 764 + pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_ATOMIC); 765 765 if (pdrvextra_cmd_parm == NULL) { 766 766 kfree(ph2c); 767 767 res = _FAIL; ··· 967 967 u8 res = _SUCCESS; 968 968 969 969 if (enqueue) { 970 - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); 970 + ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); 971 971 if (ph2c == NULL) { 972 972 res = _FAIL; 973 973 goto exit; 974 974 } 975 975 976 - pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_KERNEL); 976 + pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_ATOMIC); 977 977 if (pdrvextra_cmd_parm == NULL) { 978 978 kfree(ph2c); 979 979 res = _FAIL; ··· 1010 1010 1011 1011 u8 res = _SUCCESS; 1012 1012 1013 - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); 1013 + ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); 1014 1014 if (ph2c == NULL) { 1015 1015 res = _FAIL; 1016 1016 goto exit; 1017 1017 } 1018 1018 1019 - pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_KERNEL); 1019 + pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_ATOMIC); 1020 1020 if (pdrvextra_cmd_parm == NULL) { 1021 1021 kfree(ph2c); 1022 1022 res = _FAIL; ··· 1088 1088 1089 1089 u8 res = _SUCCESS; 1090 1090 1091 - ppscmd = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); 1091 + ppscmd = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); 1092 1092 if (ppscmd == NULL) { 1093 1093 res = _FAIL; 1094 1094 goto exit; 1095 1095 } 1096 1096 1097 - pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_KERNEL); 1097 + pdrvextra_cmd_parm = kzalloc(sizeof(struct drvextra_cmd_parm), GFP_ATOMIC); 1098 1098 if (pdrvextra_cmd_parm == NULL) { 1099 1099 kfree(ppscmd); 1100 1100 res = _FAIL;
+6 -6
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
··· 4241 4241 pcmdpriv = &padapter->cmdpriv; 4242 4242 4243 4243 4244 - pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); 4244 + pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); 4245 4245 if (pcmd_obj == NULL) 4246 4246 return; 4247 4247 4248 4248 cmdsz = (sizeof(struct survey_event) + sizeof(struct C2HEvent_Header)); 4249 - pevtcmd = kzalloc(cmdsz, GFP_KERNEL); 4249 + pevtcmd = kzalloc(cmdsz, GFP_ATOMIC); 4250 4250 if (pevtcmd == NULL) { 4251 4251 kfree(pcmd_obj); 4252 4252 return; ··· 4339 4339 struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); 4340 4340 struct cmd_priv *pcmdpriv = &padapter->cmdpriv; 4341 4341 4342 - pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); 4342 + pcmd_obj = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); 4343 4343 if (pcmd_obj == NULL) 4344 4344 return; 4345 4345 4346 4346 cmdsz = (sizeof(struct joinbss_event) + sizeof(struct C2HEvent_Header)); 4347 - pevtcmd = kzalloc(cmdsz, GFP_KERNEL); 4347 + pevtcmd = kzalloc(cmdsz, GFP_ATOMIC); 4348 4348 if (pevtcmd == NULL) { 4349 4349 kfree(pcmd_obj); 4350 4350 return; ··· 4854 4854 pmlmeext->scan_abort = false;/* reset */ 4855 4855 } 4856 4856 4857 - ph2c = kzalloc(sizeof(struct cmd_obj), GFP_KERNEL); 4857 + ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); 4858 4858 if (ph2c == NULL) 4859 4859 goto exit_survey_timer_hdl; 4860 4860 4861 - psurveyPara = kzalloc(sizeof(struct sitesurvey_parm), GFP_KERNEL); 4861 + psurveyPara = kzalloc(sizeof(struct sitesurvey_parm), GFP_ATOMIC); 4862 4862 if (psurveyPara == NULL) { 4863 4863 kfree(ph2c); 4864 4864 goto exit_survey_timer_hdl;
+1 -1
drivers/staging/rtl8188eu/core/rtw_wlan_util.c
··· 935 935 return true; 936 936 } 937 937 938 - bssid = kzalloc(sizeof(struct wlan_bssid_ex), GFP_KERNEL); 938 + bssid = kzalloc(sizeof(struct wlan_bssid_ex), GFP_ATOMIC); 939 939 940 940 subtype = GetFrameSubType(pframe) >> 4; 941 941
+1
drivers/staging/rtl8188eu/os_dep/usb_intf.c
··· 47 47 {USB_DEVICE(0x07b8, 0x8179)}, /* Abocom - Abocom */ 48 48 {USB_DEVICE(0x2001, 0x330F)}, /* DLink DWA-125 REV D1 */ 49 49 {USB_DEVICE(0x2001, 0x3310)}, /* Dlink DWA-123 REV D1 */ 50 + {USB_DEVICE(0x2001, 0x3311)}, /* DLink GO-USB-N150 REV B1 */ 50 51 {USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */ 51 52 {} /* Terminating entry */ 52 53 };
+1 -1
include/linux/iio/events.h
··· 72 72 73 73 #define IIO_EVENT_CODE_EXTRACT_TYPE(mask) ((mask >> 56) & 0xFF) 74 74 75 - #define IIO_EVENT_CODE_EXTRACT_DIR(mask) ((mask >> 48) & 0xCF) 75 + #define IIO_EVENT_CODE_EXTRACT_DIR(mask) ((mask >> 48) & 0x7F) 76 76 77 77 #define IIO_EVENT_CODE_EXTRACT_CHAN_TYPE(mask) ((mask >> 32) & 0xFF) 78 78