View | Details | Raw Unified | Return to bug 11411 | Differences between
and this patch

Collapse All | Expand All

(-)linux-2.6/drivers/rtc/rtc-cmos.c (-2 / +22 lines)
Lines 800-806 static void __exit cmos_do_remove(struct Link Here
800
static int cmos_suspend(struct device *dev, pm_message_t mesg)
800
static int cmos_suspend(struct device *dev, pm_message_t mesg)
801
{
801
{
802
	struct cmos_rtc	*cmos = dev_get_drvdata(dev);
802
	struct cmos_rtc	*cmos = dev_get_drvdata(dev);
803
	int		do_wake = device_may_wakeup(dev);
804
	unsigned char	tmp;
803
	unsigned char	tmp;
805
804
806
	/* only the alarm might be a wakeup event source */
805
	/* only the alarm might be a wakeup event source */
Lines 809-815 static int cmos_suspend(struct device *d Link Here
809
	if (tmp & (RTC_PIE|RTC_AIE|RTC_UIE)) {
808
	if (tmp & (RTC_PIE|RTC_AIE|RTC_UIE)) {
810
		unsigned char	mask;
809
		unsigned char	mask;
811
810
812
		if (do_wake)
811
		if (device_may_wakeup(dev))
813
			mask = RTC_IRQMASK & ~RTC_AIE;
812
			mask = RTC_IRQMASK & ~RTC_AIE;
814
		else
813
		else
815
			mask = RTC_IRQMASK;
814
			mask = RTC_IRQMASK;
Lines 837-842 static int cmos_suspend(struct device *d Link Here
837
	return 0;
836
	return 0;
838
}
837
}
839
838
839
static inline int cmos_poweroff(struct device *dev)
840
{
841
	return cmos_suspend(dev, PMSG_HIBERNATE);
842
}
843
840
static int cmos_resume(struct device *dev)
844
static int cmos_resume(struct device *dev)
841
{
845
{
842
	struct cmos_rtc	*cmos = dev_get_drvdata(dev);
846
	struct cmos_rtc	*cmos = dev_get_drvdata(dev);
Lines 884-889 static int cmos_resume(struct device *de Link Here
884
#else
888
#else
885
#define	cmos_suspend	NULL
889
#define	cmos_suspend	NULL
886
#define	cmos_resume	NULL
890
#define	cmos_resume	NULL
891
892
static inline int cmos_poweroff(struct device *dev) { return -ENOSYS; }
887
#endif
893
#endif
888
894
889
/*----------------------------------------------------------------*/
895
/*----------------------------------------------------------------*/
Lines 942-947 static int cmos_pnp_resume(struct pnp_de Link Here
942
#define	cmos_pnp_resume		NULL
948
#define	cmos_pnp_resume		NULL
943
#endif
949
#endif
944
950
951
static void cmos_pnp_shutdown(struct pnp_dev *pdev)
952
{
953
	if (system_state == SYSTEM_POWER_OFF && !cmos_poweroff(&pdev->dev))
954
		return;
955
956
	cmos_do_shutdown();
957
}
945
958
946
static const struct pnp_device_id rtc_ids[] = {
959
static const struct pnp_device_id rtc_ids[] = {
947
	{ .id = "PNP0b00", },
960
	{ .id = "PNP0b00", },
Lines 961-966 static struct pnp_driver cmos_pnp_driver Link Here
961
	.flags		= PNP_DRIVER_RES_DO_NOT_CHANGE,
974
	.flags		= PNP_DRIVER_RES_DO_NOT_CHANGE,
962
	.suspend	= cmos_pnp_suspend,
975
	.suspend	= cmos_pnp_suspend,
963
	.resume		= cmos_pnp_resume,
976
	.resume		= cmos_pnp_resume,
977
	.driver		= {
978
		.name	  = (char *)driver_name,
979
		.shutdown = cmos_pnp_shutdown,
980
	}
964
};
981
};
965
982
966
#endif	/* CONFIG_PNP */
983
#endif	/* CONFIG_PNP */
Lines 986-991 static int __exit cmos_platform_remove(s Link Here
986
1003
987
static void cmos_platform_shutdown(struct platform_device *pdev)
1004
static void cmos_platform_shutdown(struct platform_device *pdev)
988
{
1005
{
1006
	if (system_state == SYSTEM_POWER_OFF && !cmos_poweroff(&pdev->dev))
1007
		return;
1008
989
	cmos_do_shutdown();
1009
	cmos_do_shutdown();
990
}
1010
}
991
1011

Return to bug 11411