aboutsummaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@google.com>2017-04-21 09:48:33 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2017-04-21 09:48:33 +0200
commita2659b2b785a4e01ad5fbd7c891c0c0fbc3a0d27 (patch)
tree264b440ac6591396df7e9df8c6a9ada016a4ff29 /drivers/rtc
parent67f252c89db4af5a7c8df9163967c06e80133ff7 (diff)
parent2f5e58ec793f56f9ac1c6736b4638a4b81d6f099 (diff)
Merge 4.9.24 into android-4.9
Changes in 4.9.24: cgroup, kthread: close race window where new kthreads can be migrated to non-root cgroups tcmu: Fix possible overwrite of t_data_sg's last iov[] tcmu: Fix wrongly calculating of the base_command_size tcmu: Skip Data-Out blocks before gathering Data-In buffer for BIDI case thp: fix MADV_DONTNEED vs. MADV_FREE race thp: fix MADV_DONTNEED vs clear soft dirty race zsmalloc: expand class bit orangefs: free superblock when mount fails drm/nouveau/mpeg: mthd returns true on success now drm/nouveau/mmu/nv4a: use nv04 mmu rather than the nv44 one drm/etnaviv: fix missing unlock on error in etnaviv_gpu_submit() CIFS: reconnect thread reschedule itself CIFS: store results of cifs_reopen_file to avoid infinite wait Input: xpad - add support for Razer Wildcat gamepad perf/x86: Avoid exposing wrong/stale data in intel_pmu_lbr_read_32() x86/efi: Don't try to reserve runtime regions x86/signals: Fix lower/upper bound reporting in compat siginfo x86, pmem: fix broken __copy_user_nocache cache-bypass assumptions x86/vdso: Ensure vdso32_enabled gets set to valid values only x86/vdso: Plug race between mapping and ELF header setup acpi, nfit, libnvdimm: fix interleave set cookie calculation (64-bit comparison) ACPI / scan: Set the visited flag for all enumerated devices parisc: fix bugs in pa_memcpy efi/libstub: Skip GOP with PIXEL_BLT_ONLY format efi/fb: Avoid reconfiguration of BAR that covers the framebuffer iscsi-target: Fix TMR reference leak during session shutdown iscsi-target: Drop work-around for legacy GlobalSAN initiator scsi: sr: Sanity check returned mode data scsi: sd: Consider max_xfer_blocks if opt_xfer_blocks is unusable scsi: qla2xxx: Add fix to read correct register value for ISP82xx. scsi: sd: Fix capacity calculation with 32-bit sector_t target: Avoid mappedlun symlink creation during lun shutdown xen, fbfront: fix connecting to backend new privimitive: iov_iter_revert() make skb_copy_datagram_msg() et.al. preserve ->msg_iter on error libnvdimm: fix blk free space accounting libnvdimm: fix reconfig_mutex, mmap_sem, and jbd2_handle lockdep splat can: ifi: use correct register to read rx status pwm: rockchip: State of PWM clock should synchronize with PWM enabled state cpufreq: Bring CPUs up even if cpufreq_online() failed irqchip/irq-imx-gpcv2: Fix spinlock initialization ftrace: Fix removing of second function probe char: lack of bool string made CONFIG_DEVPORT always on Revert "MIPS: Lantiq: Fix cascaded IRQ setup" kvm: fix page struct leak in handle_vmon zram: do not use copy_page with non-page aligned address ftrace: Fix function pid filter on instances crypto: algif_aead - Fix bogus request dereference in completion function crypto: ahash - Fix EINPROGRESS notification callback parisc: Fix get_user() for 64-bit value on 32-bit kernel ath9k: fix NULL pointer dereference dvb-usb-v2: avoid use-after-free ext4: fix inode checksum calculation problem if i_extra_size is small mm: memcontrol: use special workqueue for creating per-memcg caches drm/nouveau/disp/mcp7x: disable dptmds workaround nbd: use loff_t for blocksize and nbd_set_size args nbd: fix 64-bit division ASoC: Intel: select DW_DMAC_CORE since it's mandatory platform/x86: acer-wmi: setup accelerometer when machine has appropriate notify event x86/xen: Fix APIC id mismatch warning on Intel ACPI / EC: Use busy polling mode when GPE is not enabled rtc: tegra: Implement clock handling mm: Tighten x86 /dev/mem with zeroing reads dvb-usb: don't use stack for firmware load dvb-usb-firmware: don't do DMA on stack cxusb: Use a dma capable buffer also for reading virtio-console: avoid DMA from stack net: ipv6: check route protocol when deleting routes sctp: deny peeloff operation on asocs with threads sleeping on it Linux 4.9.24 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-tegra.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c
index 3853ba963bb5..19e03d0b956b 100644
--- a/drivers/rtc/rtc-tegra.c
+++ b/drivers/rtc/rtc-tegra.c
@@ -18,6 +18,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <linux/kernel.h>
+#include <linux/clk.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/slab.h>
@@ -59,6 +60,7 @@ struct tegra_rtc_info {
struct platform_device *pdev;
struct rtc_device *rtc_dev;
void __iomem *rtc_base; /* NULL if not initialized. */
+ struct clk *clk;
int tegra_rtc_irq; /* alarm and periodic irq */
spinlock_t tegra_rtc_lock;
};
@@ -326,6 +328,14 @@ static int __init tegra_rtc_probe(struct platform_device *pdev)
if (info->tegra_rtc_irq <= 0)
return -EBUSY;
+ info->clk = devm_clk_get(&pdev->dev, NULL);
+ if (IS_ERR(info->clk))
+ return PTR_ERR(info->clk);
+
+ ret = clk_prepare_enable(info->clk);
+ if (ret < 0)
+ return ret;
+
/* set context info. */
info->pdev = pdev;
spin_lock_init(&info->tegra_rtc_lock);
@@ -346,7 +356,7 @@ static int __init tegra_rtc_probe(struct platform_device *pdev)
ret = PTR_ERR(info->rtc_dev);
dev_err(&pdev->dev, "Unable to register device (err=%d).\n",
ret);
- return ret;
+ goto disable_clk;
}
ret = devm_request_irq(&pdev->dev, info->tegra_rtc_irq,
@@ -356,12 +366,25 @@ static int __init tegra_rtc_probe(struct platform_device *pdev)
dev_err(&pdev->dev,
"Unable to request interrupt for device (err=%d).\n",
ret);
- return ret;
+ goto disable_clk;
}
dev_notice(&pdev->dev, "Tegra internal Real Time Clock\n");
return 0;
+
+disable_clk:
+ clk_disable_unprepare(info->clk);
+ return ret;
+}
+
+static int tegra_rtc_remove(struct platform_device *pdev)
+{
+ struct tegra_rtc_info *info = platform_get_drvdata(pdev);
+
+ clk_disable_unprepare(info->clk);
+
+ return 0;
}
#ifdef CONFIG_PM_SLEEP
@@ -413,6 +436,7 @@ static void tegra_rtc_shutdown(struct platform_device *pdev)
MODULE_ALIAS("platform:tegra_rtc");
static struct platform_driver tegra_rtc_driver = {
+ .remove = tegra_rtc_remove,
.shutdown = tegra_rtc_shutdown,
.driver = {
.name = "tegra_rtc",