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 branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
"I2C has one core and one driver bugfix for you"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: tegra: Fix Maximum transfer size
i2c: dev: prevent adapter retries and timeout being set as minus value

+20 -1
+14 -1
drivers/i2c/busses/i2c-tegra.c
··· 155 155 * @has_mst_fifo: The I2C controller contains the new MST FIFO interface that 156 156 * provides additional features and allows for longer messages to 157 157 * be transferred in one go. 158 + * @quirks: i2c adapter quirks for limiting write/read transfer size and not 159 + * allowing 0 length transfers. 158 160 */ 159 161 struct tegra_i2c_hw_feature { 160 162 bool has_continue_xfer_support; ··· 169 167 bool has_multi_master_mode; 170 168 bool has_slcg_override_reg; 171 169 bool has_mst_fifo; 170 + const struct i2c_adapter_quirks *quirks; 172 171 }; 173 172 174 173 /** ··· 840 837 .max_write_len = 4096, 841 838 }; 842 839 840 + static const struct i2c_adapter_quirks tegra194_i2c_quirks = { 841 + .flags = I2C_AQ_NO_ZERO_LEN, 842 + }; 843 + 843 844 static const struct tegra_i2c_hw_feature tegra20_i2c_hw = { 844 845 .has_continue_xfer_support = false, 845 846 .has_per_pkt_xfer_complete_irq = false, ··· 855 848 .has_multi_master_mode = false, 856 849 .has_slcg_override_reg = false, 857 850 .has_mst_fifo = false, 851 + .quirks = &tegra_i2c_quirks, 858 852 }; 859 853 860 854 static const struct tegra_i2c_hw_feature tegra30_i2c_hw = { ··· 869 861 .has_multi_master_mode = false, 870 862 .has_slcg_override_reg = false, 871 863 .has_mst_fifo = false, 864 + .quirks = &tegra_i2c_quirks, 872 865 }; 873 866 874 867 static const struct tegra_i2c_hw_feature tegra114_i2c_hw = { ··· 883 874 .has_multi_master_mode = false, 884 875 .has_slcg_override_reg = false, 885 876 .has_mst_fifo = false, 877 + .quirks = &tegra_i2c_quirks, 886 878 }; 887 879 888 880 static const struct tegra_i2c_hw_feature tegra124_i2c_hw = { ··· 897 887 .has_multi_master_mode = false, 898 888 .has_slcg_override_reg = true, 899 889 .has_mst_fifo = false, 890 + .quirks = &tegra_i2c_quirks, 900 891 }; 901 892 902 893 static const struct tegra_i2c_hw_feature tegra210_i2c_hw = { ··· 911 900 .has_multi_master_mode = true, 912 901 .has_slcg_override_reg = true, 913 902 .has_mst_fifo = false, 903 + .quirks = &tegra_i2c_quirks, 914 904 }; 915 905 916 906 static const struct tegra_i2c_hw_feature tegra194_i2c_hw = { ··· 925 913 .has_multi_master_mode = true, 926 914 .has_slcg_override_reg = true, 927 915 .has_mst_fifo = true, 916 + .quirks = &tegra194_i2c_quirks, 928 917 }; 929 918 930 919 /* Match table for of_platform binding */ ··· 977 964 i2c_dev->base = base; 978 965 i2c_dev->div_clk = div_clk; 979 966 i2c_dev->adapter.algo = &tegra_i2c_algo; 980 - i2c_dev->adapter.quirks = &tegra_i2c_quirks; 981 967 i2c_dev->irq = irq; 982 968 i2c_dev->cont_id = pdev->id; 983 969 i2c_dev->dev = &pdev->dev; ··· 992 980 i2c_dev->hw = of_device_get_match_data(&pdev->dev); 993 981 i2c_dev->is_dvc = of_device_is_compatible(pdev->dev.of_node, 994 982 "nvidia,tegra20-i2c-dvc"); 983 + i2c_dev->adapter.quirks = i2c_dev->hw->quirks; 995 984 init_completion(&i2c_dev->msg_complete); 996 985 spin_lock_init(&i2c_dev->xfer_lock); 997 986
+6
drivers/i2c/i2c-dev.c
··· 470 470 data_arg.data); 471 471 } 472 472 case I2C_RETRIES: 473 + if (arg > INT_MAX) 474 + return -EINVAL; 475 + 473 476 client->adapter->retries = arg; 474 477 break; 475 478 case I2C_TIMEOUT: 479 + if (arg > INT_MAX) 480 + return -EINVAL; 481 + 476 482 /* For historical reasons, user-space sets the timeout 477 483 * value in units of 10 ms. 478 484 */