Searched refs:moxart_rtc (Results 1 - 1 of 1) sorted by relevance
/linux-4.1.27/drivers/rtc/ |
H A D | rtc-moxart.c | 58 struct moxart_rtc { struct 69 struct moxart_rtc *moxart_rtc = dev_get_drvdata(dev); moxart_rtc_write_byte() local 73 gpio_set_value(moxart_rtc->gpio_sclk, 0); moxart_rtc_write_byte() 74 gpio_set_value(moxart_rtc->gpio_data, ((data & 1) == 1)); moxart_rtc_write_byte() 76 gpio_set_value(moxart_rtc->gpio_sclk, 1); moxart_rtc_write_byte() 83 struct moxart_rtc *moxart_rtc = dev_get_drvdata(dev); moxart_rtc_read_byte() local 88 gpio_set_value(moxart_rtc->gpio_sclk, 0); moxart_rtc_read_byte() 90 gpio_set_value(moxart_rtc->gpio_sclk, 1); moxart_rtc_read_byte() 92 if (gpio_get_value(moxart_rtc->gpio_data)) moxart_rtc_read_byte() 101 struct moxart_rtc *moxart_rtc = dev_get_drvdata(dev); moxart_rtc_read_register() local 107 gpio_direction_output(moxart_rtc->gpio_data, 0); moxart_rtc_read_register() 108 gpio_set_value(moxart_rtc->gpio_reset, 1); moxart_rtc_read_register() 111 gpio_direction_input(moxart_rtc->gpio_data); moxart_rtc_read_register() 114 gpio_set_value(moxart_rtc->gpio_sclk, 0); moxart_rtc_read_register() 115 gpio_set_value(moxart_rtc->gpio_reset, 0); moxart_rtc_read_register() 125 struct moxart_rtc *moxart_rtc = dev_get_drvdata(dev); moxart_rtc_write_register() local 130 gpio_direction_output(moxart_rtc->gpio_data, 0); moxart_rtc_write_register() 131 gpio_set_value(moxart_rtc->gpio_reset, 1); moxart_rtc_write_register() 135 gpio_set_value(moxart_rtc->gpio_sclk, 0); moxart_rtc_write_register() 136 gpio_set_value(moxart_rtc->gpio_reset, 0); moxart_rtc_write_register() 144 struct moxart_rtc *moxart_rtc = dev_get_drvdata(dev); moxart_rtc_set_time() local 146 spin_lock_irq(&moxart_rtc->rtc_lock); moxart_rtc_set_time() 175 spin_unlock_irq(&moxart_rtc->rtc_lock); moxart_rtc_set_time() 187 struct moxart_rtc *moxart_rtc = dev_get_drvdata(dev); moxart_rtc_read_time() local 190 spin_lock_irq(&moxart_rtc->rtc_lock); moxart_rtc_read_time() 234 spin_unlock_irq(&moxart_rtc->rtc_lock); moxart_rtc_read_time() 246 struct moxart_rtc *moxart_rtc; moxart_rtc_probe() local 249 moxart_rtc = devm_kzalloc(&pdev->dev, sizeof(*moxart_rtc), GFP_KERNEL); moxart_rtc_probe() 250 if (!moxart_rtc) moxart_rtc_probe() 253 moxart_rtc->gpio_data = of_get_named_gpio(pdev->dev.of_node, moxart_rtc_probe() 255 if (!gpio_is_valid(moxart_rtc->gpio_data)) { moxart_rtc_probe() 257 moxart_rtc->gpio_data); moxart_rtc_probe() 258 return moxart_rtc->gpio_data; moxart_rtc_probe() 261 moxart_rtc->gpio_sclk = of_get_named_gpio(pdev->dev.of_node, moxart_rtc_probe() 263 if (!gpio_is_valid(moxart_rtc->gpio_sclk)) { moxart_rtc_probe() 265 moxart_rtc->gpio_sclk); moxart_rtc_probe() 266 return moxart_rtc->gpio_sclk; moxart_rtc_probe() 269 moxart_rtc->gpio_reset = of_get_named_gpio(pdev->dev.of_node, moxart_rtc_probe() 271 if (!gpio_is_valid(moxart_rtc->gpio_reset)) { moxart_rtc_probe() 273 moxart_rtc->gpio_reset); moxart_rtc_probe() 274 return moxart_rtc->gpio_reset; moxart_rtc_probe() 277 spin_lock_init(&moxart_rtc->rtc_lock); moxart_rtc_probe() 278 platform_set_drvdata(pdev, moxart_rtc); moxart_rtc_probe() 280 ret = devm_gpio_request(&pdev->dev, moxart_rtc->gpio_data, "rtc_data"); moxart_rtc_probe() 286 ret = devm_gpio_request_one(&pdev->dev, moxart_rtc->gpio_sclk, moxart_rtc_probe() 293 ret = devm_gpio_request_one(&pdev->dev, moxart_rtc->gpio_reset, moxart_rtc_probe() 300 moxart_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, moxart_rtc_probe() 303 if (IS_ERR(moxart_rtc->rtc)) { moxart_rtc_probe() 305 return PTR_ERR(moxart_rtc->rtc); moxart_rtc_probe()
|
Completed in 44 milliseconds