For 2x2, let w, x, y, z be the numbers in the cells at the top left, top right, bottom left, and bottom right respectively. Then, let S be 7(w + x + y + z). The number of clicks you need in each cell are a = S - z, b = S - y, c = S - x, d = S - w, all mod 10. Alternatively, you can multiply the inverse of the matrix [1 1 1 0, 1 1 0 1, 1 0 1 1, 0 1 1 1] by the vector [w, x, y, z] and then multiply by 21 and modulo each number by 10.
Both come from the system of equations w = a + b + c, x = a + b + d, y = a + c + d, z = b + c + d, all mod 10. These come from each click affecting all cells except the one opposite from it. If you add these equations up you get w + x + y + z = 3(a + b + c + d) (mod 10). The modular inverse of 3 mod 10 is 7, as 3 * 7 = 21 = 1 (mod 10). So, the equation can be rewritten S = 7(w + x + y + z) = a + b + c + d (mod 10). To solve for a, subtract b + c + d from both sides, and since b + c + d is z, a = S - z (mod 10). Similar steps can be applied to b, c, and d. The second method is solving the system using linear algebra method and you multiply by 21 to make the resulting vector all integers since 21 = 1 (mod 10).