tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 9317f948b0b188b8d2fded75957e6d42c460df1b commit: cd3f609823a5896a6f4c229b3c2077475531e23d [11918/13311] Input: new da7280 haptic driver config: i386-randconfig-m021-20201215 (attached as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot smatch warnings: drivers/input/misc/da7280.c:866 da7280_parse_properties() warn: inconsistent indenting vim +866 drivers/input/misc/da7280.c 771 772 static void da7280_parse_properties(struct device *dev, 773 struct da7280_haptic *haptics) 774 { 775 unsigned int i, mem[DA7280_SNP_MEM_SIZE]; 776 char gpi_str1[] = "dlg,gpi0-seq-id"; 777 char gpi_str2[] = "dlg,gpi0-mode"; 778 char gpi_str3[] = "dlg,gpi0-polarity"; 779 const char *str; 780 u32 val; 781 int error; 782 783 /* 784 * If there is no property, then use the mode programmed into the chip. 785 */ 786 haptics->dev_type = DA7280_DEV_MAX; 787 error = device_property_read_string(dev, "dlg,actuator-type", &str); 788 if (!error) 789 haptics->dev_type = da7280_haptic_of_mode_str(dev, str); 790 791 haptics->const_op_mode = DA7280_DRO_MODE; 792 error = device_property_read_u32(dev, "dlg,const-op-mode", &val); 793 if (!error && val == DA7280_FF_PERIODIC_PWM) 794 haptics->const_op_mode = DA7280_PWM_MODE; 795 796 haptics->periodic_op_mode = DA7280_RTWM_MODE; 797 error = device_property_read_u32(dev, "dlg,periodic-op-mode", &val); 798 if (!error && val == DA7280_FF_PERIODIC_ETWM) 799 haptics->periodic_op_mode = DA7280_ETWM_MODE; 800 801 haptics->nommax = DA7280_SKIP_INIT; 802 error = device_property_read_u32(dev, "dlg,nom-microvolt", &val); 803 if (!error && val < DA7280_VOLTAGE_RATE_MAX) 804 haptics->nommax = da7280_haptic_of_volt_rating_set(val); 805 806 haptics->absmax = DA7280_SKIP_INIT; 807 error = device_property_read_u32(dev, "dlg,abs-max-microvolt", &val); 808 if (!error && val < DA7280_VOLTAGE_RATE_MAX) 809 haptics->absmax = da7280_haptic_of_volt_rating_set(val); 810 811 haptics->imax = DA7280_IMAX_DEFAULT; 812 error = device_property_read_u32(dev, "dlg,imax-microamp", &val); 813 if (!error && val < DA7280_IMAX_LIMIT) 814 haptics->imax = (val - 28600) / DA7280_IMAX_STEP + 1; 815 816 haptics->impd = DA7280_IMPD_DEFAULT; 817 error = device_property_read_u32(dev, "dlg,impd-micro-ohms", &val); 818 if (!error && val <= DA7280_IMPD_MAX) 819 haptics->impd = val; 820 821 haptics->resonant_freq_h = DA7280_SKIP_INIT; 822 haptics->resonant_freq_l = DA7280_SKIP_INIT; 823 error = device_property_read_u32(dev, "dlg,resonant-freq-hz", &val); 824 if (!error) { 825 if (val < DA7280_MAX_RESONAT_FREQ_HZ && 826 val > DA7280_MIN_RESONAT_FREQ_HZ) { 827 haptics->resonant_freq_h = 828 ((1000000000 / (val * 1333)) >> 7) & 0xFF; 829 haptics->resonant_freq_l = 830 (1000000000 / (val * 1333)) & 0x7F; 831 } else { 832 haptics->resonant_freq_h = DA7280_RESONT_FREQH_DFT; 833 haptics->resonant_freq_l = DA7280_RESONT_FREQL_DFT; 834 } 835 } 836 837 /* If no property, set to zero as default is to do nothing. */ 838 haptics->ps_seq_id = 0; 839 error = device_property_read_u32(dev, "dlg,ps-seq-id", &val); 840 if (!error && val <= DA7280_SEQ_ID_MAX) 841 haptics->ps_seq_id = val; 842 843 haptics->ps_seq_loop = 0; 844 error = device_property_read_u32(dev, "dlg,ps-seq-loop", &val); 845 if (!error && val <= DA7280_SEQ_LOOP_MAX) 846 haptics->ps_seq_loop = val; 847 848 /* GPI0~2 Control */ 849 for (i = 0; i <= DA7280_GPI_SEQ_ID_MAX; i++) { 850 gpi_str1[7] = '0' + i; 851 haptics->gpi_ctl[i].seq_id = DA7280_GPI_SEQ_ID_DFT + i; 852 error = device_property_read_u32 (dev, gpi_str1, &val); 853 if (!error && val <= DA7280_SEQ_ID_MAX) 854 haptics->gpi_ctl[i].seq_id = val; 855 856 gpi_str2[7] = '0' + i; 857 haptics->gpi_ctl[i].mode = 0; 858 error = device_property_read_string(dev, gpi_str2, &str); 859 if (!error) 860 haptics->gpi_ctl[i].mode = 861 da7280_haptic_of_gpi_mode_str(dev, str); 862 863 gpi_str3[7] = '0' + i; 864 haptics->gpi_ctl[i].polarity = 0; 865 error = device_property_read_string(dev, gpi_str3, &str); > 866 haptics->gpi_ctl[i].polarity = 867 da7280_haptic_of_gpi_pol_str(dev, str); 868 } 869 870 haptics->bemf_sense_en = 871 device_property_read_bool(dev, "dlg,bemf-sens-enable"); 872 haptics->freq_track_en = 873 device_property_read_bool(dev, "dlg,freq-track-enable"); 874 haptics->acc_en = 875 device_property_read_bool(dev, "dlg,acc-enable"); 876 haptics->rapid_stop_en = 877 device_property_read_bool(dev, "dlg,rapid-stop-enable"); 878 haptics->amp_pid_en = 879 device_property_read_bool(dev, "dlg,amp-pid-enable"); 880 881 haptics->mem_update = false; 882 error = device_property_read_u32_array(dev, "dlg,mem-array", 883 &mem[0], DA7280_SNP_MEM_SIZE); 884 if (!error) { 885 haptics->mem_update = true; 886 memset(haptics->snp_mem, 0, DA7280_SNP_MEM_SIZE); 887 for (i = 0; i < DA7280_SNP_MEM_SIZE; i++) { 888 if (mem[i] <= 0xff) { 889 haptics->snp_mem[i] = (u8)mem[i]; 890 } else { 891 dev_err(haptics->dev, 892 "Invalid data in mem-array at %d: %x\n", 893 i, mem[i]); 894 haptics->mem_update = false; 895 break; 896 } 897 } 898 } 899 } 900 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org