Aims . Non-local thermodynamical equilibrium ( NLTE ) line formation for neutral and singly-ionized calcium is considered through a range of spectral types when the Ca abundance varies from the solar value down to [ Ca/H ] = - 5 . We evaluate the influence of departures from LTE on Ca abundance determinations and inspect the possibility of using Ca i / Ca ii line-strength ratios as indicators of surface gravity for extremely metal-poor stars . Methods . A comprehensive model atom for Ca i and Ca ii is presented . Accurate radiative and electron collisional atomic data are incorporated . The role of inelastic collisions with hydrogen atoms in the statistical equilibrium of Ca i/ii is estimated empirically from inspection of their different influence on the Ca i and Ca ii lines in selected stars with well determined stellar parameters and high-quality observed spectra . Results . The dependence of NLTE effects on the atmospheric parameters is discussed . Departures from LTE significantly affect the profiles of Ca i lines over the whole range of stellar parameters considered . However , at [ Ca/H ] \geq - 2 , NLTE abundance correction of individual lines may be small in absolute value due to the different influence of NLTE effects on line wings and the line core . At lower Ca abundances , NLTE leads to systematically depleted total absorption in the line and positive abundance corrections , exceeding +0.5 dex for Ca i \lambda 4226 at [ Ca/H ] = - 4.9 . In contrast , NLTE effects strengthen the Ca ii lines and lead to negative abundance corrections . NLTE corrections are small , \leq 0.02 dex , for the Ca ii resonance lines over the whole range of stellar parameters considered . For the IR lines of multiplet 3 d - 4 p , they grow in absolute value with decreasing Ca abundance exceeding 0.4 dex in metal-poor stars with [ Fe/H ] \leq - 3 . As a test and first application of the Ca i/ii model atom , Ca abundances are determined on the basis of plane-parallel LTE model atmospheres for the Sun , Procyon ( F IV-V ) , and seven metal-poor stars , using high S/N and high-resolution spectra at visual and near-IR wavelengths . Lines of Ca i and Ca ii give consistent abundances for all objects ( except Procyon ) when collisions with hydrogen atoms are taken into account . The derived absolute solar Ca abundance ( from Ca i and Ca ii lines ) is \log \varepsilon _ { Ca, \odot } = 6.38 \pm 0.06 . For Procyon , the mean Ca abundance from Ca i lines is markedly subsolar , [ Ca/H ] = –0.14 \pm 0.03 . All metal-poor stars within our sample show an overabundance of calcium relative to iron with [ Ca/Fe ] abundance ratios of 0.26 to 0.46 typical for the halo population . The W ( Ca i 4226 ) / W ( Ca ii 8498 ) equivalent width ratio is predicted to be sensitive to surface gravity for extremely metal-poor stars , while this is not the case for the ratio involving the Ca ii resonance line ( s ) .