| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Driver for the SGS-Thomson M48T35 Timekeeper RAM chip |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 7 | 8 | * Copyright (C) 2008 Thomas Bogendoerfer |
|---|
| 8 | 9 | * |
|---|
| 9 | 10 | * Based on code written by Paul Gortmaker. |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 12 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 13 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 14 | | - * option) any later version. |
|---|
| 15 | 11 | */ |
|---|
| 16 | 12 | |
|---|
| 17 | 13 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 24 | 20 | |
|---|
| 25 | 21 | struct m48t35_rtc { |
|---|
| 26 | 22 | u8 pad[0x7ff8]; /* starts at 0x7ff8 */ |
|---|
| 23 | +#ifdef CONFIG_SGI_IP27 |
|---|
| 24 | + u8 hour; |
|---|
| 25 | + u8 min; |
|---|
| 26 | + u8 sec; |
|---|
| 27 | + u8 control; |
|---|
| 28 | + u8 year; |
|---|
| 29 | + u8 month; |
|---|
| 30 | + u8 date; |
|---|
| 31 | + u8 day; |
|---|
| 32 | +#else |
|---|
| 27 | 33 | u8 control; |
|---|
| 28 | 34 | u8 sec; |
|---|
| 29 | 35 | u8 min; |
|---|
| .. | .. |
|---|
| 32 | 38 | u8 date; |
|---|
| 33 | 39 | u8 month; |
|---|
| 34 | 40 | u8 year; |
|---|
| 41 | +#endif |
|---|
| 35 | 42 | }; |
|---|
| 36 | 43 | |
|---|
| 37 | 44 | #define M48T35_RTC_SET 0x80 |
|---|
| .. | .. |
|---|
| 153 | 160 | return -ENOMEM; |
|---|
| 154 | 161 | |
|---|
| 155 | 162 | priv->size = resource_size(res); |
|---|
| 156 | | - /* |
|---|
| 157 | | - * kludge: remove the #ifndef after ioc3 resource |
|---|
| 158 | | - * conflicts are resolved |
|---|
| 159 | | - */ |
|---|
| 160 | | -#ifndef CONFIG_SGI_IP27 |
|---|
| 161 | 163 | if (!devm_request_mem_region(&pdev->dev, res->start, priv->size, |
|---|
| 162 | 164 | pdev->name)) |
|---|
| 163 | 165 | return -EBUSY; |
|---|
| 164 | | -#endif |
|---|
| 166 | + |
|---|
| 165 | 167 | priv->baseaddr = res->start; |
|---|
| 166 | 168 | priv->reg = devm_ioremap(&pdev->dev, priv->baseaddr, priv->size); |
|---|
| 167 | 169 | if (!priv->reg) |
|---|