Lines Matching refs:i2c_bus

142 static int hsi2c_get_clk_details(struct s3c24x0_i2c_bus *i2c_bus)  in hsi2c_get_clk_details()  argument
144 struct exynos5_hsi2c *hsregs = i2c_bus->hsregs; in hsi2c_get_clk_details()
146 unsigned int op_clk = i2c_bus->clock_frequency; in hsi2c_get_clk_details()
168 i2c_bus->clk_cycle = utemp1 - 2; in hsi2c_get_clk_details()
169 i2c_bus->clk_div = i; in hsi2c_get_clk_details()
176 static void hsi2c_ch_init(struct s3c24x0_i2c_bus *i2c_bus) in hsi2c_ch_init() argument
178 struct exynos5_hsi2c *hsregs = i2c_bus->hsregs; in hsi2c_ch_init()
190 n_clkdiv = i2c_bus->clk_div; in hsi2c_ch_init()
191 t_scl_l = i2c_bus->clk_cycle / 2; in hsi2c_ch_init()
192 t_scl_h = i2c_bus->clk_cycle / 2; in hsi2c_ch_init()
198 t_sr_release = i2c_bus->clk_cycle; in hsi2c_ch_init()
227 static void exynos5_i2c_reset(struct s3c24x0_i2c_bus *i2c_bus) in exynos5_i2c_reset() argument
229 struct exynos5_hsi2c *i2c = i2c_bus->hsregs; in exynos5_i2c_reset()
242 hsi2c_ch_init(i2c_bus); in exynos5_i2c_reset()
469 struct s3c24x0_i2c_bus *i2c_bus = dev_get_priv(dev); in exynos_hs_i2c_xfer() local
470 struct exynos5_hsi2c *hsregs = i2c_bus->hsregs; in exynos_hs_i2c_xfer()
482 exynos5_i2c_reset(i2c_bus); in exynos_hs_i2c_xfer()
492 struct s3c24x0_i2c_bus *i2c_bus = dev_get_priv(dev); in s3c24x0_i2c_set_bus_speed() local
494 i2c_bus->clock_frequency = speed; in s3c24x0_i2c_set_bus_speed()
496 if (hsi2c_get_clk_details(i2c_bus)) in s3c24x0_i2c_set_bus_speed()
498 hsi2c_ch_init(i2c_bus); in s3c24x0_i2c_set_bus_speed()
505 struct s3c24x0_i2c_bus *i2c_bus = dev_get_priv(dev); in s3c24x0_i2c_probe() local
516 ret = hsi2c_read(i2c_bus->hsregs, chip, 0, 0, buf, 1); in s3c24x0_i2c_probe()
524 struct s3c24x0_i2c_bus *i2c_bus = dev_get_priv(dev); in s3c_i2c_of_to_plat() local
529 i2c_bus->hsregs = dev_read_addr_ptr(dev); in s3c_i2c_of_to_plat()
531 i2c_bus->id = pinmux_decode_periph_id(blob, node); in s3c_i2c_of_to_plat()
533 i2c_bus->clock_frequency = in s3c_i2c_of_to_plat()
536 i2c_bus->node = node; in s3c_i2c_of_to_plat()
537 i2c_bus->bus_num = dev_seq(dev); in s3c_i2c_of_to_plat()
539 exynos_pinmux_config(i2c_bus->id, PINMUX_FLAG_HS_MODE); in s3c_i2c_of_to_plat()
541 i2c_bus->active = true; in s3c_i2c_of_to_plat()