1*4f9b9bbaSGeert Uytterhoeven /* 2*4f9b9bbaSGeert Uytterhoeven * Oki MSM6242 RTC Driver 3*4f9b9bbaSGeert Uytterhoeven * 4*4f9b9bbaSGeert Uytterhoeven * Copyright 2009 Geert Uytterhoeven 5*4f9b9bbaSGeert Uytterhoeven * 6*4f9b9bbaSGeert Uytterhoeven * Based on the A2000 TOD code in arch/m68k/amiga/config.c 7*4f9b9bbaSGeert Uytterhoeven * Copyright (C) 1993 Hamish Macdonald 8*4f9b9bbaSGeert Uytterhoeven */ 9*4f9b9bbaSGeert Uytterhoeven 10*4f9b9bbaSGeert Uytterhoeven #include <linux/delay.h> 11*4f9b9bbaSGeert Uytterhoeven #include <linux/io.h> 12*4f9b9bbaSGeert Uytterhoeven #include <linux/kernel.h> 13*4f9b9bbaSGeert Uytterhoeven #include <linux/module.h> 14*4f9b9bbaSGeert Uytterhoeven #include <linux/platform_device.h> 15*4f9b9bbaSGeert Uytterhoeven #include <linux/rtc.h> 16*4f9b9bbaSGeert Uytterhoeven 17*4f9b9bbaSGeert Uytterhoeven 18*4f9b9bbaSGeert Uytterhoeven enum { 19*4f9b9bbaSGeert Uytterhoeven MSM6242_SECOND1 = 0x0, /* 1-second digit register */ 20*4f9b9bbaSGeert Uytterhoeven MSM6242_SECOND10 = 0x1, /* 10-second digit register */ 21*4f9b9bbaSGeert Uytterhoeven MSM6242_MINUTE1 = 0x2, /* 1-minute digit register */ 22*4f9b9bbaSGeert Uytterhoeven MSM6242_MINUTE10 = 0x3, /* 10-minute digit register */ 23*4f9b9bbaSGeert Uytterhoeven MSM6242_HOUR1 = 0x4, /* 1-hour digit register */ 24*4f9b9bbaSGeert Uytterhoeven MSM6242_HOUR10 = 0x5, /* PM/AM, 10-hour digit register */ 25*4f9b9bbaSGeert Uytterhoeven MSM6242_DAY1 = 0x6, /* 1-day digit register */ 26*4f9b9bbaSGeert Uytterhoeven MSM6242_DAY10 = 0x7, /* 10-day digit register */ 27*4f9b9bbaSGeert Uytterhoeven MSM6242_MONTH1 = 0x8, /* 1-month digit register */ 28*4f9b9bbaSGeert Uytterhoeven MSM6242_MONTH10 = 0x9, /* 10-month digit register */ 29*4f9b9bbaSGeert Uytterhoeven MSM6242_YEAR1 = 0xa, /* 1-year digit register */ 30*4f9b9bbaSGeert Uytterhoeven MSM6242_YEAR10 = 0xb, /* 10-year digit register */ 31*4f9b9bbaSGeert Uytterhoeven MSM6242_WEEK = 0xc, /* Week register */ 32*4f9b9bbaSGeert Uytterhoeven MSM6242_CD = 0xd, /* Control Register D */ 33*4f9b9bbaSGeert Uytterhoeven MSM6242_CE = 0xe, /* Control Register E */ 34*4f9b9bbaSGeert Uytterhoeven MSM6242_CF = 0xf, /* Control Register F */ 35*4f9b9bbaSGeert Uytterhoeven }; 36*4f9b9bbaSGeert Uytterhoeven 37*4f9b9bbaSGeert Uytterhoeven #define MSM6242_HOUR10_AM (0 << 2) 38*4f9b9bbaSGeert Uytterhoeven #define MSM6242_HOUR10_PM (1 << 2) 39*4f9b9bbaSGeert Uytterhoeven #define MSM6242_HOUR10_HR_MASK (3 << 0) 40*4f9b9bbaSGeert Uytterhoeven 41*4f9b9bbaSGeert Uytterhoeven #define MSM6242_WEEK_SUNDAY 0 42*4f9b9bbaSGeert Uytterhoeven #define MSM6242_WEEK_MONDAY 1 43*4f9b9bbaSGeert Uytterhoeven #define MSM6242_WEEK_TUESDAY 2 44*4f9b9bbaSGeert Uytterhoeven #define MSM6242_WEEK_WEDNESDAY 3 45*4f9b9bbaSGeert Uytterhoeven #define MSM6242_WEEK_THURSDAY 4 46*4f9b9bbaSGeert Uytterhoeven #define MSM6242_WEEK_FRIDAY 5 47*4f9b9bbaSGeert Uytterhoeven #define MSM6242_WEEK_SATURDAY 6 48*4f9b9bbaSGeert Uytterhoeven 49*4f9b9bbaSGeert Uytterhoeven #define MSM6242_CD_30_S_ADJ (1 << 3) /* 30-second adjustment */ 50*4f9b9bbaSGeert Uytterhoeven #define MSM6242_CD_IRQ_FLAG (1 << 2) 51*4f9b9bbaSGeert Uytterhoeven #define MSM6242_CD_BUSY (1 << 1) 52*4f9b9bbaSGeert Uytterhoeven #define MSM6242_CD_HOLD (1 << 0) 53*4f9b9bbaSGeert Uytterhoeven 54*4f9b9bbaSGeert Uytterhoeven #define MSM6242_CE_T_MASK (3 << 2) 55*4f9b9bbaSGeert Uytterhoeven #define MSM6242_CE_T_64HZ (0 << 2) /* period 1/64 second */ 56*4f9b9bbaSGeert Uytterhoeven #define MSM6242_CE_T_1HZ (1 << 2) /* period 1 second */ 57*4f9b9bbaSGeert Uytterhoeven #define MSM6242_CE_T_1MINUTE (2 << 2) /* period 1 minute */ 58*4f9b9bbaSGeert Uytterhoeven #define MSM6242_CE_T_1HOUR (3 << 2) /* period 1 hour */ 59*4f9b9bbaSGeert Uytterhoeven 60*4f9b9bbaSGeert Uytterhoeven #define MSM6242_CE_ITRPT_STND (1 << 1) 61*4f9b9bbaSGeert Uytterhoeven #define MSM6242_CE_MASK (1 << 0) /* STD.P output control */ 62*4f9b9bbaSGeert Uytterhoeven 63*4f9b9bbaSGeert Uytterhoeven #define MSM6242_CF_TEST (1 << 3) 64*4f9b9bbaSGeert Uytterhoeven #define MSM6242_CF_12H (0 << 2) 65*4f9b9bbaSGeert Uytterhoeven #define MSM6242_CF_24H (1 << 2) 66*4f9b9bbaSGeert Uytterhoeven #define MSM6242_CF_STOP (1 << 1) 67*4f9b9bbaSGeert Uytterhoeven #define MSM6242_CF_REST (1 << 0) /* reset */ 68*4f9b9bbaSGeert Uytterhoeven 69*4f9b9bbaSGeert Uytterhoeven 70*4f9b9bbaSGeert Uytterhoeven struct msm6242_priv { 71*4f9b9bbaSGeert Uytterhoeven u32 __iomem *regs; 72*4f9b9bbaSGeert Uytterhoeven struct rtc_device *rtc; 73*4f9b9bbaSGeert Uytterhoeven }; 74*4f9b9bbaSGeert Uytterhoeven 75*4f9b9bbaSGeert Uytterhoeven static inline unsigned int msm6242_read(struct msm6242_priv *priv, 76*4f9b9bbaSGeert Uytterhoeven unsigned int reg) 77*4f9b9bbaSGeert Uytterhoeven { 78*4f9b9bbaSGeert Uytterhoeven return __raw_readl(&priv->regs[reg]) & 0xf; 79*4f9b9bbaSGeert Uytterhoeven } 80*4f9b9bbaSGeert Uytterhoeven 81*4f9b9bbaSGeert Uytterhoeven static inline void msm6242_write(struct msm6242_priv *priv, unsigned int val, 82*4f9b9bbaSGeert Uytterhoeven unsigned int reg) 83*4f9b9bbaSGeert Uytterhoeven { 84*4f9b9bbaSGeert Uytterhoeven return __raw_writel(val, &priv->regs[reg]); 85*4f9b9bbaSGeert Uytterhoeven } 86*4f9b9bbaSGeert Uytterhoeven 87*4f9b9bbaSGeert Uytterhoeven static inline void msm6242_set(struct msm6242_priv *priv, unsigned int val, 88*4f9b9bbaSGeert Uytterhoeven unsigned int reg) 89*4f9b9bbaSGeert Uytterhoeven { 90*4f9b9bbaSGeert Uytterhoeven msm6242_write(priv, msm6242_read(priv, reg) | val, reg); 91*4f9b9bbaSGeert Uytterhoeven } 92*4f9b9bbaSGeert Uytterhoeven 93*4f9b9bbaSGeert Uytterhoeven static inline void msm6242_clear(struct msm6242_priv *priv, unsigned int val, 94*4f9b9bbaSGeert Uytterhoeven unsigned int reg) 95*4f9b9bbaSGeert Uytterhoeven { 96*4f9b9bbaSGeert Uytterhoeven msm6242_write(priv, msm6242_read(priv, reg) & ~val, reg); 97*4f9b9bbaSGeert Uytterhoeven } 98*4f9b9bbaSGeert Uytterhoeven 99*4f9b9bbaSGeert Uytterhoeven static void msm6242_lock(struct msm6242_priv *priv) 100*4f9b9bbaSGeert Uytterhoeven { 101*4f9b9bbaSGeert Uytterhoeven int cnt = 5; 102*4f9b9bbaSGeert Uytterhoeven 103*4f9b9bbaSGeert Uytterhoeven msm6242_set(priv, MSM6242_CD_HOLD, MSM6242_CD); 104*4f9b9bbaSGeert Uytterhoeven 105*4f9b9bbaSGeert Uytterhoeven while ((msm6242_read(priv, MSM6242_CD) & MSM6242_CD_BUSY) && cnt) { 106*4f9b9bbaSGeert Uytterhoeven msm6242_clear(priv, MSM6242_CD_HOLD, MSM6242_CD); 107*4f9b9bbaSGeert Uytterhoeven udelay(70); 108*4f9b9bbaSGeert Uytterhoeven msm6242_set(priv, MSM6242_CD_HOLD, MSM6242_CD); 109*4f9b9bbaSGeert Uytterhoeven cnt--; 110*4f9b9bbaSGeert Uytterhoeven } 111*4f9b9bbaSGeert Uytterhoeven 112*4f9b9bbaSGeert Uytterhoeven if (!cnt) 113*4f9b9bbaSGeert Uytterhoeven pr_warning("msm6242: timed out waiting for RTC (0x%x)\n", 114*4f9b9bbaSGeert Uytterhoeven msm6242_read(priv, MSM6242_CD)); 115*4f9b9bbaSGeert Uytterhoeven } 116*4f9b9bbaSGeert Uytterhoeven 117*4f9b9bbaSGeert Uytterhoeven static void msm6242_unlock(struct msm6242_priv *priv) 118*4f9b9bbaSGeert Uytterhoeven { 119*4f9b9bbaSGeert Uytterhoeven msm6242_clear(priv, MSM6242_CD_HOLD, MSM6242_CD); 120*4f9b9bbaSGeert Uytterhoeven } 121*4f9b9bbaSGeert Uytterhoeven 122*4f9b9bbaSGeert Uytterhoeven static int msm6242_read_time(struct device *dev, struct rtc_time *tm) 123*4f9b9bbaSGeert Uytterhoeven { 124*4f9b9bbaSGeert Uytterhoeven struct msm6242_priv *priv = dev_get_drvdata(dev); 125*4f9b9bbaSGeert Uytterhoeven 126*4f9b9bbaSGeert Uytterhoeven msm6242_lock(priv); 127*4f9b9bbaSGeert Uytterhoeven 128*4f9b9bbaSGeert Uytterhoeven tm->tm_sec = msm6242_read(priv, MSM6242_SECOND10) * 10 + 129*4f9b9bbaSGeert Uytterhoeven msm6242_read(priv, MSM6242_SECOND1); 130*4f9b9bbaSGeert Uytterhoeven tm->tm_min = msm6242_read(priv, MSM6242_MINUTE10) * 10 + 131*4f9b9bbaSGeert Uytterhoeven msm6242_read(priv, MSM6242_MINUTE1); 132*4f9b9bbaSGeert Uytterhoeven tm->tm_hour = (msm6242_read(priv, MSM6242_HOUR10 & 3)) * 10 + 133*4f9b9bbaSGeert Uytterhoeven msm6242_read(priv, MSM6242_HOUR1); 134*4f9b9bbaSGeert Uytterhoeven tm->tm_mday = msm6242_read(priv, MSM6242_DAY10) * 10 + 135*4f9b9bbaSGeert Uytterhoeven msm6242_read(priv, MSM6242_DAY1); 136*4f9b9bbaSGeert Uytterhoeven tm->tm_wday = msm6242_read(priv, MSM6242_WEEK); 137*4f9b9bbaSGeert Uytterhoeven tm->tm_mon = msm6242_read(priv, MSM6242_MONTH10) * 10 + 138*4f9b9bbaSGeert Uytterhoeven msm6242_read(priv, MSM6242_MONTH1) - 1; 139*4f9b9bbaSGeert Uytterhoeven tm->tm_year = msm6242_read(priv, MSM6242_YEAR10) * 10 + 140*4f9b9bbaSGeert Uytterhoeven msm6242_read(priv, MSM6242_YEAR1); 141*4f9b9bbaSGeert Uytterhoeven if (tm->tm_year <= 69) 142*4f9b9bbaSGeert Uytterhoeven tm->tm_year += 100; 143*4f9b9bbaSGeert Uytterhoeven 144*4f9b9bbaSGeert Uytterhoeven if (!(msm6242_read(priv, MSM6242_CF) & MSM6242_CF_24H)) { 145*4f9b9bbaSGeert Uytterhoeven unsigned int pm = msm6242_read(priv, MSM6242_HOUR10) & 146*4f9b9bbaSGeert Uytterhoeven MSM6242_HOUR10_PM; 147*4f9b9bbaSGeert Uytterhoeven if (!pm && tm->tm_hour == 12) 148*4f9b9bbaSGeert Uytterhoeven tm->tm_hour = 0; 149*4f9b9bbaSGeert Uytterhoeven else if (pm && tm->tm_hour != 12) 150*4f9b9bbaSGeert Uytterhoeven tm->tm_hour += 12; 151*4f9b9bbaSGeert Uytterhoeven } 152*4f9b9bbaSGeert Uytterhoeven 153*4f9b9bbaSGeert Uytterhoeven msm6242_unlock(priv); 154*4f9b9bbaSGeert Uytterhoeven 155*4f9b9bbaSGeert Uytterhoeven return rtc_valid_tm(tm); 156*4f9b9bbaSGeert Uytterhoeven } 157*4f9b9bbaSGeert Uytterhoeven 158*4f9b9bbaSGeert Uytterhoeven static int msm6242_set_time(struct device *dev, struct rtc_time *tm) 159*4f9b9bbaSGeert Uytterhoeven { 160*4f9b9bbaSGeert Uytterhoeven struct msm6242_priv *priv = dev_get_drvdata(dev); 161*4f9b9bbaSGeert Uytterhoeven 162*4f9b9bbaSGeert Uytterhoeven msm6242_lock(priv); 163*4f9b9bbaSGeert Uytterhoeven 164*4f9b9bbaSGeert Uytterhoeven msm6242_write(priv, tm->tm_sec / 10, MSM6242_SECOND10); 165*4f9b9bbaSGeert Uytterhoeven msm6242_write(priv, tm->tm_sec % 10, MSM6242_SECOND1); 166*4f9b9bbaSGeert Uytterhoeven msm6242_write(priv, tm->tm_min / 10, MSM6242_MINUTE10); 167*4f9b9bbaSGeert Uytterhoeven msm6242_write(priv, tm->tm_min % 10, MSM6242_MINUTE1); 168*4f9b9bbaSGeert Uytterhoeven if (msm6242_read(priv, MSM6242_CF) & MSM6242_CF_24H) 169*4f9b9bbaSGeert Uytterhoeven msm6242_write(priv, tm->tm_hour / 10, MSM6242_HOUR10); 170*4f9b9bbaSGeert Uytterhoeven else if (tm->tm_hour >= 12) 171*4f9b9bbaSGeert Uytterhoeven msm6242_write(priv, MSM6242_HOUR10_PM + (tm->tm_hour - 12) / 10, 172*4f9b9bbaSGeert Uytterhoeven MSM6242_HOUR10); 173*4f9b9bbaSGeert Uytterhoeven else 174*4f9b9bbaSGeert Uytterhoeven msm6242_write(priv, tm->tm_hour / 10, MSM6242_HOUR10); 175*4f9b9bbaSGeert Uytterhoeven msm6242_write(priv, tm->tm_hour % 10, MSM6242_HOUR1); 176*4f9b9bbaSGeert Uytterhoeven msm6242_write(priv, tm->tm_mday / 10, MSM6242_DAY10); 177*4f9b9bbaSGeert Uytterhoeven msm6242_write(priv, tm->tm_mday % 10, MSM6242_DAY1); 178*4f9b9bbaSGeert Uytterhoeven if (tm->tm_wday != -1) 179*4f9b9bbaSGeert Uytterhoeven msm6242_write(priv, tm->tm_wday, MSM6242_WEEK); 180*4f9b9bbaSGeert Uytterhoeven msm6242_write(priv, (tm->tm_mon + 1) / 10, MSM6242_MONTH10); 181*4f9b9bbaSGeert Uytterhoeven msm6242_write(priv, (tm->tm_mon + 1) % 10, MSM6242_MONTH1); 182*4f9b9bbaSGeert Uytterhoeven if (tm->tm_year >= 100) 183*4f9b9bbaSGeert Uytterhoeven tm->tm_year -= 100; 184*4f9b9bbaSGeert Uytterhoeven msm6242_write(priv, tm->tm_year / 10, MSM6242_YEAR10); 185*4f9b9bbaSGeert Uytterhoeven msm6242_write(priv, tm->tm_year % 10, MSM6242_YEAR1); 186*4f9b9bbaSGeert Uytterhoeven 187*4f9b9bbaSGeert Uytterhoeven msm6242_unlock(priv); 188*4f9b9bbaSGeert Uytterhoeven return 0; 189*4f9b9bbaSGeert Uytterhoeven } 190*4f9b9bbaSGeert Uytterhoeven 191*4f9b9bbaSGeert Uytterhoeven static const struct rtc_class_ops msm6242_rtc_ops = { 192*4f9b9bbaSGeert Uytterhoeven .read_time = msm6242_read_time, 193*4f9b9bbaSGeert Uytterhoeven .set_time = msm6242_set_time, 194*4f9b9bbaSGeert Uytterhoeven }; 195*4f9b9bbaSGeert Uytterhoeven 196*4f9b9bbaSGeert Uytterhoeven static int __init msm6242_rtc_probe(struct platform_device *dev) 197*4f9b9bbaSGeert Uytterhoeven { 198*4f9b9bbaSGeert Uytterhoeven struct resource *res; 199*4f9b9bbaSGeert Uytterhoeven struct msm6242_priv *priv; 200*4f9b9bbaSGeert Uytterhoeven struct rtc_device *rtc; 201*4f9b9bbaSGeert Uytterhoeven int error; 202*4f9b9bbaSGeert Uytterhoeven 203*4f9b9bbaSGeert Uytterhoeven res = platform_get_resource(dev, IORESOURCE_MEM, 0); 204*4f9b9bbaSGeert Uytterhoeven if (!res) 205*4f9b9bbaSGeert Uytterhoeven return -ENODEV; 206*4f9b9bbaSGeert Uytterhoeven 207*4f9b9bbaSGeert Uytterhoeven priv = kzalloc(sizeof(*priv), GFP_KERNEL); 208*4f9b9bbaSGeert Uytterhoeven if (!priv) 209*4f9b9bbaSGeert Uytterhoeven return -ENOMEM; 210*4f9b9bbaSGeert Uytterhoeven 211*4f9b9bbaSGeert Uytterhoeven priv->regs = ioremap(res->start, resource_size(res)); 212*4f9b9bbaSGeert Uytterhoeven if (!priv->regs) { 213*4f9b9bbaSGeert Uytterhoeven error = -ENOMEM; 214*4f9b9bbaSGeert Uytterhoeven goto out_free_priv; 215*4f9b9bbaSGeert Uytterhoeven } 216*4f9b9bbaSGeert Uytterhoeven 217*4f9b9bbaSGeert Uytterhoeven rtc = rtc_device_register("rtc-msm6242", &dev->dev, &msm6242_rtc_ops, 218*4f9b9bbaSGeert Uytterhoeven THIS_MODULE); 219*4f9b9bbaSGeert Uytterhoeven if (IS_ERR(rtc)) { 220*4f9b9bbaSGeert Uytterhoeven error = PTR_ERR(rtc); 221*4f9b9bbaSGeert Uytterhoeven goto out_unmap; 222*4f9b9bbaSGeert Uytterhoeven } 223*4f9b9bbaSGeert Uytterhoeven 224*4f9b9bbaSGeert Uytterhoeven priv->rtc = rtc; 225*4f9b9bbaSGeert Uytterhoeven platform_set_drvdata(dev, priv); 226*4f9b9bbaSGeert Uytterhoeven return 0; 227*4f9b9bbaSGeert Uytterhoeven 228*4f9b9bbaSGeert Uytterhoeven out_unmap: 229*4f9b9bbaSGeert Uytterhoeven iounmap(priv->regs); 230*4f9b9bbaSGeert Uytterhoeven out_free_priv: 231*4f9b9bbaSGeert Uytterhoeven kfree(priv); 232*4f9b9bbaSGeert Uytterhoeven return error; 233*4f9b9bbaSGeert Uytterhoeven } 234*4f9b9bbaSGeert Uytterhoeven 235*4f9b9bbaSGeert Uytterhoeven static int __exit msm6242_rtc_remove(struct platform_device *dev) 236*4f9b9bbaSGeert Uytterhoeven { 237*4f9b9bbaSGeert Uytterhoeven struct msm6242_priv *priv = platform_get_drvdata(dev); 238*4f9b9bbaSGeert Uytterhoeven 239*4f9b9bbaSGeert Uytterhoeven rtc_device_unregister(priv->rtc); 240*4f9b9bbaSGeert Uytterhoeven iounmap(priv->regs); 241*4f9b9bbaSGeert Uytterhoeven kfree(priv); 242*4f9b9bbaSGeert Uytterhoeven return 0; 243*4f9b9bbaSGeert Uytterhoeven } 244*4f9b9bbaSGeert Uytterhoeven 245*4f9b9bbaSGeert Uytterhoeven static struct platform_driver msm6242_rtc_driver = { 246*4f9b9bbaSGeert Uytterhoeven .driver = { 247*4f9b9bbaSGeert Uytterhoeven .name = "rtc-msm6242", 248*4f9b9bbaSGeert Uytterhoeven .owner = THIS_MODULE, 249*4f9b9bbaSGeert Uytterhoeven }, 250*4f9b9bbaSGeert Uytterhoeven .remove = __exit_p(msm6242_rtc_remove), 251*4f9b9bbaSGeert Uytterhoeven }; 252*4f9b9bbaSGeert Uytterhoeven 253*4f9b9bbaSGeert Uytterhoeven static int __init msm6242_rtc_init(void) 254*4f9b9bbaSGeert Uytterhoeven { 255*4f9b9bbaSGeert Uytterhoeven return platform_driver_probe(&msm6242_rtc_driver, msm6242_rtc_probe); 256*4f9b9bbaSGeert Uytterhoeven } 257*4f9b9bbaSGeert Uytterhoeven 258*4f9b9bbaSGeert Uytterhoeven static void __exit msm6242_rtc_fini(void) 259*4f9b9bbaSGeert Uytterhoeven { 260*4f9b9bbaSGeert Uytterhoeven platform_driver_unregister(&msm6242_rtc_driver); 261*4f9b9bbaSGeert Uytterhoeven } 262*4f9b9bbaSGeert Uytterhoeven 263*4f9b9bbaSGeert Uytterhoeven module_init(msm6242_rtc_init); 264*4f9b9bbaSGeert Uytterhoeven module_exit(msm6242_rtc_fini); 265*4f9b9bbaSGeert Uytterhoeven 266*4f9b9bbaSGeert Uytterhoeven MODULE_AUTHOR("Geert Uytterhoeven <geert@linux-m68k.org>"); 267*4f9b9bbaSGeert Uytterhoeven MODULE_LICENSE("GPL"); 268*4f9b9bbaSGeert Uytterhoeven MODULE_DESCRIPTION("Oki MSM6242 RTC driver"); 269*4f9b9bbaSGeert Uytterhoeven MODULE_ALIAS("platform:rtc-msm6242"); 270